Skip to content
This repository has been archived by the owner on Jul 10, 2021. It is now read-only.

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
espositos committed Jun 14, 2021
2 parents 2cac784 + 7b51676 commit 3874c91
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 3 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [1.0.37] 2021-06-14
### Changed
- Added setting to set background color of HUD.

## [1.0.36] 2021-06-14
### Bugfix
- DND35 fix thanks to Rughalt
Expand Down
2 changes: 2 additions & 0 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@
"tokenactionhud.settings.rollHandler.name": "HUD roll handler",
"tokenactionhud.settings.scale.hint": "Adjust the scale of the HUD in percentage terms (100 being the default)",
"tokenactionhud.settings.scale.name": "HUD scale",
"tokenactionhud.settings.background.hint": "Takes a valid HTML color (e.g. 'red', '#00000055', '#FFF', etc.) and uses it as the background, makes no checks as to the validity of the code.",
"tokenactionhud.settings.background.name": "HUD Background color",
"tokenactionhud.settings.showHudTitle.name": "Show HUD Title",
"tokenactionhud.settings.showHudTitle.hint": "Prints a title above the HUD, normally the selected token's alias.",
"tokenactionhud.settings.showIcons.hint": "If enabled, the action image will be displayed on the HUD button where available.",
Expand Down
10 changes: 10 additions & 0 deletions scripts/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,16 @@ export const registerSettings = function(app, systemManager, rollHandlers) {
default: 1,
onChange: value => { updateFunc(value); }
});

game.settings.register(appName, 'background', {
name: game.i18n.localize('tokenactionhud.settings.background.name'),
hint: game.i18n.localize('tokenactionhud.settings.background.hint'),
scope: 'client',
config: true,
type: String,
default: 'none',
onChange: value => { updateFunc(value); }
});

game.settings.register(appName,'activeCssAsText', {
name : game.i18n.localize('tokenactionhud.settings.activeCssAsText.name'),
Expand Down
6 changes: 6 additions & 0 deletions scripts/tokenactionhud.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export class TokenActionHUD extends Application {
left: 150,
top: 80,
scale: 1,
background: 'none',
popOut: false,
minimizable: false,
resizable: false,
Expand All @@ -71,13 +72,18 @@ export class TokenActionHUD extends Application {
return scale;
}

getBackground() {
return settings.get('background');
}

/** @override */
getData(options = {}) {
const data = super.getData();
data.actions = this.targetActions;
data.id = 'token-action-hud';
data.hovering = settings.get('onTokenHover');;
data.scale = this.getScale();
data.background = this.getBackground();
settings.Logger.debug('HUD data:', data);
return data;
}
Expand Down
2 changes: 1 addition & 1 deletion templates/category.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{{#if this.info2}}<div class="tah-info2">{{this.info2}}</div>{{/if}}
{{#if this.info3}}<div class="tah-info3">{{this.info3}}</div>{{/if}}
</button>
<div class="tah-content">
<div class="tah-content" {{#if background}}style='background: {{background}}'{{/if}}>
{{#each subcategories}}
{{>"modules/token-action-hud/templates/subcategory.hbs"}}
{{/each}}
Expand Down
4 changes: 2 additions & 2 deletions templates/template.hbs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

<div id="{{id}}" style="top: {{top}}; left: {{left}}; transform: scale({{scale}}); transform-origin: top left">
<div id="{{id}}" style="top: {{top}}; left: {{left}}; {{#if background}}background: {{background}};{{/if}} transform: scale({{scale}}); transform-origin: top left">
{{#if actions.actorId}}
{{#if actions.hudTitle}}
<div id="tah-hudTitle">{{actions.hudTitle}}</div>
{{/if}}
<div id="tah-reposition"><i class="fas fa-arrows-alt"></i></div>
{{#each actions.categories}}
{{>"modules/token-action-hud/templates/category.hbs"}}
{{>"modules/token-action-hud/templates/category.hbs" background=../background}}
{{/each}}
{{#unless hovering}}
<div id="tah-categories"><i class="fa fa-book"></i></div>
Expand Down

0 comments on commit 3874c91

Please sign in to comment.