Skip to content

Commit

Permalink
#61
Browse files Browse the repository at this point in the history
- #61: Add 'Show Strike Images' module setting.
  • Loading branch information
Larkinabout committed Jun 30, 2023
1 parent 6e19127 commit 776bfb4
Show file tree
Hide file tree
Showing 15 changed files with 67 additions and 5 deletions.
4 changes: 4 additions & 0 deletions languages/br.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
"hint": "Choose whether to color skills by their rank",
"name": "Color Skills by Rank"
},
"showStrikeImages": {
"hint": "Choose whether to show strike images by default",
"name": "Show Strike Images"
},
"showStrikeNames": {
"hint": "Choose whether to show strike names by default",
"name": "Show Strike Names"
Expand Down
4 changes: 4 additions & 0 deletions languages/cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
"hint": "Choose whether to color skills by their rank",
"name": "Color Skills by Rank"
},
"showStrikeImages": {
"hint": "Choose whether to show strike images by default",
"name": "Show Strike Images"
},
"showStrikeNames": {
"hint": "Choose whether to show strike names by default",
"name": "Show Strike Names"
Expand Down
4 changes: 4 additions & 0 deletions languages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
"hint": "Choose whether to color skills by their rank",
"name": "Color Skills by Rank"
},
"showStrikeImages": {
"hint": "Choose whether to show strike images by default",
"name": "Show Strike Images"
},
"showStrikeNames": {
"hint": "Choose whether to show strike names by default",
"name": "Show Strike Names"
Expand Down
4 changes: 4 additions & 0 deletions languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
"hint": "Choose whether to color skills by their rank",
"name": "Color Skills by Rank"
},
"showStrikeImages": {
"hint": "Choose whether to show strike images by default",
"name": "Show Strike Images"
},
"showStrikeNames": {
"hint": "Choose whether to show strike names by default",
"name": "Show Strike Names"
Expand Down
4 changes: 4 additions & 0 deletions languages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
"hint": "Choose whether to color skills by their rank",
"name": "Color Skills by Rank"
},
"showStrikeImages": {
"hint": "Choose whether to show strike images by default",
"name": "Show Strike Images"
},
"showStrikeNames": {
"hint": "Choose whether to show strike names by default",
"name": "Show Strike Names"
Expand Down
4 changes: 4 additions & 0 deletions languages/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
"hint": "Choose whether to color skills by their rank",
"name": "Color Skills by Rank"
},
"showStrikeImages": {
"hint": "Choose whether to show strike images by default",
"name": "Show Strike Images"
},
"showStrikeNames": {
"hint": "Choose whether to show strike names by default",
"name": "Show Strike Names"
Expand Down
4 changes: 4 additions & 0 deletions languages/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
"hint": "Choose whether to color skills by their rank",
"name": "Color Skills by Rank"
},
"showStrikeImages": {
"hint": "Choose whether to show strike images by default",
"name": "Show Strike Images"
},
"showStrikeNames": {
"hint": "Choose whether to show strike names by default",
"name": "Show Strike Names"
Expand Down
4 changes: 4 additions & 0 deletions languages/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
"hint": "Choose whether to color skills by their rank",
"name": "Color Skills by Rank"
},
"showStrikeImages": {
"hint": "Choose whether to show strike images by default",
"name": "Show Strike Images"
},
"showStrikeNames": {
"hint": "Choose whether to show strike names by default",
"name": "Show Strike Names"
Expand Down
4 changes: 4 additions & 0 deletions languages/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
"hint": "Choose whether to color skills by their rank",
"name": "Color Skills by Rank"
},
"showStrikeImages": {
"hint": "Choose whether to show strike images by default",
"name": "Show Strike Images"
},
"showStrikeNames": {
"hint": "Choose whether to show strike names by default",
"name": "Show Strike Names"
Expand Down
4 changes: 4 additions & 0 deletions languages/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
"hint": "Choose whether to color skills by their rank",
"name": "Color Skills by Rank"
},
"showStrikeImages": {
"hint": "Choose whether to show strike images by default",
"name": "Show Strike Images"
},
"showStrikeNames": {
"hint": "Choose whether to show strike names by default",
"name": "Show Strike Names"
Expand Down
4 changes: 4 additions & 0 deletions languages/zh-tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
"hint": "Choose whether to color skills by their rank",
"name": "Color Skills by Rank"
},
"showStrikeImages": {
"hint": "Choose whether to show strike images by default",
"name": "Show Strike Images"
},
"showStrikeNames": {
"hint": "Choose whether to show strike names by default",
"name": "Show Strike Names"
Expand Down
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"compatibility": [
{
"minimum": "4.6.4",
"verified": "5.0.0-beta2"
"verified": "5.0.2"
}
]
}
Expand Down
6 changes: 4 additions & 2 deletions scripts/action-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
this.abbreviateSkills = Utils.getSetting('abbreviateSkills')
this.calculateAttackPenalty = Utils.getSetting('calculateAttackPenalty')
this.colorSkills = Utils.getSetting('colorSkills')
this.showStrikeImages = Utils.getSetting('showStrikeImages')
this.showStrikeNames = Utils.getSetting('showStrikeNames')
this.splitStrikes = Utils.getSetting('splitStrikes')
this.addDamageAndCritical = Utils.getSetting('addDamageAndCritical')
Expand Down Expand Up @@ -1297,10 +1298,11 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
}
const tooltip = await this.#getTooltip(tooltipData)
// Create group data
strikeGroupData = { id: strikeGroupId, name: strikeGroupName, listName: strikeGroupListName, type: 'system-derived', settings: { image, showTitle }, tooltip }
strikeGroupData = { id: strikeGroupId, name: strikeGroupName, listName: strikeGroupListName, type: 'system-derived', settings: { showTitle }, tooltip }
if (this.showStrikeImages) { strikeGroupData.settings.image = image }

// Add group to action list
this.addGroup(strikeGroupData, parentGroupData, true)
this.addGroup(strikeGroupData, parentGroupData)

if (strike.auxiliaryActions?.length) {
// Get actions
Expand Down
18 changes: 17 additions & 1 deletion scripts/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,22 @@ export function register (updateFunc) {
}
})

game.settings.register(MODULE.ID, 'showStrikeImages', {
name: game.i18n.localize(
'tokenActionHud.pf2e.settings.showStrikeImages.name'
),
hint: game.i18n.localize(
'tokenActionHud.pf2e.settings.showStrikeImages.hint'
),
scope: 'client',
config: true,
type: Boolean,
default: true,
onChange: (value) => {
updateFunc(value)
}
})

game.settings.register(MODULE.ID, 'showStrikeNames', {
name: game.i18n.localize(
'tokenActionHud.pf2e.settings.showStrikeNames.name'
Expand All @@ -43,7 +59,7 @@ export function register (updateFunc) {
scope: 'client',
config: true,
type: Boolean,
default: true,
default: false,
onChange: (value) => {
updateFunc(value)
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/token-action-hud-pf2e.min.js

Large diffs are not rendered by default.

0 comments on commit 776bfb4

Please sign in to comment.