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
Hamish committed Nov 23, 2020
2 parents c09020f + 55b69ee commit ff4f0b1
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 6 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [0.9.17] 2020-11-23
### Changed/added
- Added option to keep categories open (if click-to-open is enabled) when an action is pressed, so categories don't have to be constantly reopened

## [0.9.16] 2020-11-21
### Bugfix
- DND Check for null combat
Expand Down
2 changes: 2 additions & 0 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@
"tokenactionhud.settings.showIcons.hint": "If enabled, the action image will be displayed on the HUD button where available.",
"tokenactionhud.settings.clickOpenCategory.name": "Click-to-open categories",
"tokenactionhud.settings.clickOpenCategory.hint": "If enabled, categories will open on click instead of hover.",
"tokenactionhud.settings.clickCloseCategory.name": "Close categories on action",
"tokenactionhud.settings.clickCloseCategory.hint": "If enabled, categories will close when an action is chosen. Has no effect is click-to-open (above) is disabled.",

"tokenactionhud.settings.dnd5e.ignorePassiveFeats.name": "Ignore passive feats",
"tokenactionhud.settings.dnd5e.ignorePassiveFeats.hint": "If enabled, passive feats are not shown.",
Expand Down
76 changes: 75 additions & 1 deletion module.json
Original file line number Diff line number Diff line change
@@ -1 +1,75 @@
{"name":"token-action-hud","title":"Token Action HUD","author":"^ and stick#0520","description":"Creates a HUD showing a selected token's common actions.","minimumCoreVersion":"0.6.0","compatibleCoreVersion":"0.7.6","scripts":["./lib/tagify/tagify.min.js"],"esmodules":["./scripts/init.js"],"styles":["./styles/token-action-hud.css","/styles/lib/tagify/tagify.css"],"systems":["dnd5e","dungeonworld","pf2e","wfrp4e","sfrpg","sw5e","demonlord","pf1","lancer"],"languages":[{"lang":"en","name":"English","path":"lang/en.json"},{"lang":"ko","name":"Korean","path":"lang/ko.json"},{"lang":"pt-br","name":"Brazilian Portuguese","path":"lang/br.json"},{"lang":"es","name":"Spanish","path":"lang/es.json"},{"lang":"fr","name":"French","path":"lang/fr.json"},{"lang":"pl","name":"Polish","path":"lang/pl.json"},{"lang":"ja","name":"日本語","path":"lang/ja.json"},{"lang":"cn","name":"中文","path":"lang/cn.json"}],"url":"https://github.com/espositos/fvtt-tokenactionhud","manifest":"https://github.com/espositos/fvtt-tokenactionhud/raw/master/module.json","version":"0.9.16","download":"https://github.com/espositos/fvtt-tokenactionhud/releases/download/0.9.16/release_0.9.16.zip"}
{
"name": "token-action-hud",
"title": "Token Action HUD",
"author": "^ and stick#0520",
"description": "Creates a HUD showing a selected token's common actions.",
"minimumCoreVersion": "0.6.0",
"compatibleCoreVersion": "0.7.7",
"scripts": [
"./lib/tagify/tagify.min.js"
],
"esmodules": [
"./scripts/init.js"
],
"styles": [
"./styles/token-action-hud.css",
"/styles/lib/tagify/tagify.css"
],
"systems": [
"dnd5e",
"dungeonworld",
"pf2e",
"wfrp4e",
"sfrpg",
"sw5e",
"demonlord",
"pf1",
"lancer"
],
"languages": [
{
"lang": "en",
"name": "English",
"path": "lang/en.json"
},
{
"lang": "ko",
"name": "Korean",
"path": "lang/ko.json"
},
{
"lang": "pt-br",
"name": "Brazilian Portuguese",
"path": "lang/br.json"
},
{
"lang": "es",
"name": "Spanish",
"path": "lang/es.json"
},
{
"lang": "fr",
"name": "French",
"path": "lang/fr.json"
},
{
"lang": "pl",
"name": "Polish",
"path": "lang/pl.json"
},
{
"lang": "ja",
"name": "日本語",
"path": "lang/ja.json"
},
{
"lang": "cn",
"name": "中文",
"path": "lang/cn.json"
}
],
"url": "https://github.com/espositos/fvtt-tokenactionhud",
"manifest": "https://github.com/espositos/fvtt-tokenactionhud/raw/master/module.json",
"version": "0.9.16",
"download": "https://github.com/espositos/fvtt-tokenactionhud/releases/download/0.9.16/release_0.9.16.zip"
}
10 changes: 10 additions & 0 deletions scripts/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,16 @@ export const registerSettings = function(app, systemManager, rollHandlers) {
default : false,
onChange: value => { updateFunc(value); }
});

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

systemManager.doRegisterSettings(appName, updateFunc);

Expand Down
13 changes: 8 additions & 5 deletions scripts/tokenactionhud.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ export class TokenActionHUD extends Application {
const action = '.tah-action';

const handleClick = e => {
if (settings.get('clickOpenCategory') && !settings.get('clickCloseCategory'))
e.stopPropagation();

let target = e.target;

if (target.tagName !== 'BUTTON')
Expand Down Expand Up @@ -149,13 +152,13 @@ export class TokenActionHUD extends Application {

let category = $(this)[0];
let boundClick;
if (!$(category).hasClass('hover')) {
boundClick = openCategory.bind(this);
boundClick = boundClick(event);
}
else {
if ($(category).hasClass('hover')) {
boundClick = closeCategory.bind(this);
boundClick(event);
}
else {
boundClick = openCategory.bind(this);
boundClick(event);
}
}

Expand Down

0 comments on commit ff4f0b1

Please sign in to comment.