Skills working

This commit is contained in:
Neill Cox 2024-05-06 11:30:52 +10:00
parent b6c3da1127
commit 9a6fab6014
5 changed files with 63 additions and 10 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