Skills workng

This commit is contained in:
Neill Cox 2024-05-05 16:37:08 +10:00
parent 4f5b33d29b
commit 9de7b72c02
5 changed files with 64 additions and 3 deletions

View file

@ -44,7 +44,9 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
* @private
*/
#buildCharacterActions () {
debugger;
this._get_attributes({id: "attributes", type:"system"})
this._get_skills({id: "skills", type:"system"})
this.#buildInventory()
}
@ -75,6 +77,34 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
}
_get_skills(parent) {
debugger;
const macroType = "skills";
let actions = [];
let skills = Object.entries(this.actor.system.skills)
skills.forEach((a) => {
const key = a[1].name;
const value = a[1].level
// img
let actionId = key;
let otf = 'Sk:"' + key + '"'; // This is going to end badly if the delimiter is set to ":"
actions.push({
id: actionId,
name: coreModule.api.Utils.i18n(key),
description: coreModule.api.Utils.i18n('GURPS.Skills'),
encodedValue: [macroType, otf].join(this.delimiter),
})
});
this.addActions(actions, parent)
}
/**
* Build multiple token actions
* @private