Skip to content

Commit

Permalink
Merge pull request #1431 from crnormand/main
Browse files Browse the repository at this point in the history
Create Release v0.14.1
  • Loading branch information
mjeffw authored May 25, 2022
2 parents 7a5254f + bf9c617 commit 216fe5f
Show file tree
Hide file tree
Showing 8 changed files with 144 additions and 15 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Pre-Release Creation

on:
release:
types: [prereleased]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

# get part of the tag after the `v`
- name: Extract tag version number
id: get_version
uses: battila7/get-version-action@v2

# Substitute the Manifest and Download URLs in the module.json
- name: Substitute Manifest and Download Links For Versioned Ones
id: sub_manifest_link_version
uses: microsoft/variable-substitution@v1
with:
files: 'system.json'
env:
esmodules: '["module/gurps.js", "lib/xregexp-all.js"]'
version: ${{steps.get_version.outputs.version-without-v}}
manifest: https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/system.json
download: https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/system.zip

# Create a zip file with all files required by the module to add to the release
- run: zip -r ./system.zip system.json template.json LICENSE.txt icons/ lang/ lib/ module/ scripts/ styles/ templates/ ui/

# Create a release for this specific version
- name: Update Release with Files
id: create_version_release
uses: ncipollo/release-action@v1
with:
allowUpdates: true # Set this to false if you want to prevent updating existing releases
name: ${{ github.event.release.name }}
draft: ${{ github.event.release.unpublished }}
prerelease: ${{ github.event.release.prerelease }}
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: './system.json, ./system.zip'
tag: ${{ github.event.release.tag_name }}
body: ${{ github.event.release.body }}
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Release Creation

on:
release:
types: [released]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

# get part of the tag after the `v`
- name: Extract tag version number
id: get_version
uses: battila7/get-version-action@v2

# Substitute the Manifest and Download URLs in the module.json
- name: Substitute Manifest and Download Links For Versioned Ones
id: sub_manifest_link_version
uses: microsoft/variable-substitution@v1
with:
files: 'system.json'
env:
esmodules: '["module/gurps.js", "lib/xregexp-all.js"]'
version: ${{steps.get_version.outputs.version-without-v}}
manifest: https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/system.json
download: https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/system.zip

# Create a zip file with all files required by the module to add to the release
- run: zip -r ./system.zip system.json template.json LICENSE.txt icons/ lang/ lib/ module/ scripts/ styles/ templates/ ui/

# Create a release for this specific version
- name: Update Release with Files
id: create_version_release
uses: ncipollo/release-action@v1
with:
allowUpdates: true # Set this to false if you want to prevent updating existing releases
name: ${{ github.event.release.name }}
draft: ${{ github.event.release.unpublished }}
prerelease: ${{ github.event.release.prerelease }}
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: './system.json, ./system.zip'
tag: ${{ github.event.release.tag_name }}
body: ${{ github.event.release.body }}
8 changes: 8 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

If you can't access the Google doc, here is a [PDF](https://github.com/crnormand/gurps/raw/main/docs/Guide%20for%20GURPS%204e%20on%20Foundry%20VTT.pdf) of the latest version.

Release 0.14.2


Release 0.14.1 5/25/2022

- Add guard code to prevent tokens without actors in combat from breaking everything.
- Fix integration with Nordlond Bestiary module (Issue [1423](https://github.com/crnormand/gurps/issues/1423)).

Release 0.14.0 5/18/2022

- Partial fix for Modifier Bucket when Minimal UI module is active.
Expand Down
19 changes: 14 additions & 5 deletions lib/moustachewax.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
'use strict'

import * as HitLocations from '../module/hitlocation/hitlocation.js'
import { isArray, isEmpty, getComparison, getOperation, i18n, i18n_f, zeroFill, recurselist, quotedAttackName } from './utilities.js'
import {
isArray,
isEmpty,
getComparison,
getOperation,
i18n,
i18n_f,
zeroFill,
recurselist,
quotedAttackName,
} from './utilities.js'
import * as settings from './miscellaneous-settings.js'
import Maneuvers from '../module/actor/maneuver.js'
import { parseDecimalNumber } from './parse-decimal-number/parse-decimal-number.js'
Expand Down Expand Up @@ -114,7 +124,7 @@ export default function () {
if (value == null) return false
if (value == '0') return true
if (value == '') return false
return !isNaN(parseInt(value)) // Used to allow "numbers" like '12F' or '11U' for fencing/unwieldy parry
return !isNaN(parseInt(value)) // Used to allow "numbers" like '12F' or '11U' for fencing/unwieldy parry
})
Handlebars.registerHelper('not', function (value) {
return !value
Expand Down Expand Up @@ -437,7 +447,7 @@ export default function () {

Handlebars.registerHelper('inCombat', function (data) {
if (data.actor && !!game.combats.active) {
return game.combats.active.combatants.contents.map(it => it.actor.id).includes(data.actor.id)
return game.combats.active.combatants.contents.map(it => it.actor.id).includes(data?.actor?.id)
}
return false
})
Expand Down Expand Up @@ -761,12 +771,11 @@ ${content}
return value
}
})

Handlebars.registerHelper('quotedAttackName', function (prefix, item) {
return prefix + ':' + quotedAttackName(item)
})


// === register Handlebars partials ===
// Partial name will be the last component of the path name, e.g.: 'systems/gurps/templates/actor/foo.hbs" -- the name is "foo".
// Use it in an HTML/HBS file like this: {{> foo }}.
Expand Down
25 changes: 20 additions & 5 deletions module/gurps.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,19 @@ import {
import { ModifierBucket } from './modifier-bucket/bucket-app.js'
import { ChangeLogWindow } from '../lib/change-log.js'
import { SemanticVersion } from '../lib/semver.js'
import { d6ify, recurselist, atou, utoa, makeRegexPatternFrom, i18n, zeroFill, wait, i18n_f, quotedAttackName, requestFpHp } from '../lib/utilities.js'
import {
d6ify,
recurselist,
atou,
utoa,
makeRegexPatternFrom,
i18n,
zeroFill,
wait,
i18n_f,
quotedAttackName,
requestFpHp,
} from '../lib/utilities.js'
import { doRoll } from '../module/dierolls/dieroll.js'
import { ResourceTrackerManager } from './actor/resource-tracker-manager.js'
import { DamageTables, initializeDamageTables } from '../module/damage/damage-tables.js'
Expand Down Expand Up @@ -649,7 +661,7 @@ const actionFuncs = {
return false
}
if (action.calcOnly) return att.damage

let dam = parseForRollOrDamage(att.damage)
if (!dam) {
ui.notifications?.warn('Damage is not rollable')
Expand Down Expand Up @@ -786,8 +798,8 @@ const actionFuncs = {
.replace(/\[.*\]/, '')
.replace(/ +/g, ' ')
.trim()
const chatthing = `[${p}${quotedAttackName({name: thing, mode: att.mode})}]`
const followon = `[D:${quotedAttackName({name: thing, mode: att.mode})}]`
const chatthing = `[${p}${quotedAttackName({ name: thing, mode: att.mode })}]`
const followon = `[D:${quotedAttackName({ name: thing, mode: att.mode })}]`
let target = att.level
if (!target) {
ui.notifications.warn(`attack named ${thing} has level of 0 or NaN`)
Expand All @@ -802,7 +814,7 @@ const actionFuncs = {
blind: action.blindroll,
event,
obj: att, // save the attack in the optional parameters, in case it has rcl/rof
followon: followon
followon: followon,
}
let targetmods = []
if (opt.obj.checkotf && !(await GURPS.executeOTF(opt.obj.checkotf, false, event))) return false
Expand Down Expand Up @@ -1998,6 +2010,8 @@ Hooks.once('init', async function () {
Hooks.on('renderActorSheet', (...args) => {
colorGurpsActorSheet()
})

Hooks.call('gurpsinit', GURPS)
})

Hooks.once('ready', async function () {
Expand Down Expand Up @@ -2386,4 +2400,5 @@ Hooks.once('ready', async function () {
TriggerHappySupport.init()

// End of system "READY" hook.
Hooks.call('gurpsready')
})
13 changes: 9 additions & 4 deletions module/modifier-bucket/bucket-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ Hooks.once('init', async function () {

// Listen for the Ctrl key and show the single dice image
/**
** We need to discuss... currently, holding down the CTRL key will make a private roll for the GM (or a blind roll for the player).
***
** TODO We need to discuss... currently, holding down the CTRL key will make a private roll for the GM (or a blind roll for the player).
** TODO Can't you just talk to me before changing something???
***
game.keybindings.register('gurps', 'toggleDiceDisplay', {
name: 'Toggle dice display',
uneditable: [{ key: 'ControlLeft' }, { key: 'ControlRight' }],
Expand Down Expand Up @@ -386,6 +387,8 @@ export class ModifierBucket extends Application {
constructor(options = {}) {
super(options)

console.trace('+++++ Create ModifierBucket +++++')

this.isTooltip = game.settings.get(Settings.SYSTEM_NAME, Settings.SETTING_MODIFIER_TOOLTIP)

this.editor = new ModifierBucketEditor(this, {
Expand Down Expand Up @@ -800,7 +803,9 @@ export class ModifierBucket extends Application {
}

_injectHTML(html) {
if ($('body').find('#bucket-app').length === 0) html.insertAfter($('body').find('#hotbar'))
this._element = html
if ($('body').find('#bucket-app').length === 0) {
html.insertAfter($('body').find('#hotbar'))
this._element = html
} else console.warn('=== HOLA ===\n That weird Modifier Bucket problem just happened! \n============')
}
}
2 changes: 2 additions & 0 deletions module/modifier-bucket/tooltip-window.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export default class ModifierBucketEditor extends Application {
constructor(bucket, options = {}) {
super(options)

console.trace('+++++ Create ModifierBucketEditor +++++')

this.bucket = bucket // reference to class ModifierBucket, which is the 'button' that opens this window
this.inside = false
this.tabIndex = 0
Expand Down
2 changes: 1 addition & 1 deletion styles/simple.css
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
display: inline-block;
grid-row: 3;
grid-column: 2;
border: 5px solid #1c2024;
/* border: 5px solid #1c2024; */
border-radius: 5px;
background-color: lightgrey;
display: flex;
Expand Down

0 comments on commit 216fe5f

Please sign in to comment.