diff --git a/langs/en-ca.json b/langs/en-ca.json index de9e051..1d2ad3e 100644 --- a/langs/en-ca.json +++ b/langs/en-ca.json @@ -173,10 +173,13 @@ "rollTarget": "Target", "difficulty": "(DC: {dc})", "RichEditor-no-collaborative": "Warning: This editor is not collaborative, that means that if you and someone else are editing it at the same time, you won't see that someone else is making changes until they save, and then your changes will be lost.", + "starred-ammo-placeholder": "Starred Ammo Slot", "AmmoTracker": { "no-ammo": "You don't have any ammo!", - "pin-button": "Pin {name} to your character sheet", - "pin-button-tooltip": "Pin {name}" + "star-button": "Add {name} as a starred ammo", + "star-button-tooltip": "Add Star", + "unstar-button": "Remove {name} as a starred ammo", + "unstar-button-tooltip": "Remove Star" } }, "notifs": { diff --git a/module/Apps/ActorSheets/HeroSkillsCardV1.mjs b/module/Apps/ActorSheets/HeroSkillsCardV1.mjs index be8fb26..7b1301a 100644 --- a/module/Apps/ActorSheets/HeroSkillsCardV1.mjs +++ b/module/Apps/ActorSheets/HeroSkillsCardV1.mjs @@ -140,20 +140,21 @@ export class HeroSkillsCardV1 extends GenericAppMixin(HandlebarsApplicationMixin static async prepareAmmo(ctx) { let total = 0; - ctx.favouriteAmmo = []; + let favouriteCount = 0; + ctx.favouriteAmmo = new Array(3).fill(null); for (const ammo of ctx.actor.itemTypes.ammo) { total += ammo.system.quantity; - if (ctx.favouriteAmmo.length < 3 && ammo.getFlag(game.system.id, `favourited`)) { - ctx.favouriteAmmo.push({ + if (favouriteCount < 3 && ammo.getFlag(game.system.id, `favourited`)) { + ctx.favouriteAmmo[favouriteCount] = { uuid: ammo.uuid, name: ammo.name, quantity: ammo.system.quantity, - }); + }; + favouriteCount++; }; }; - ctx.favouriteAmmo.length = 3; // assert array length ctx.ammo = total; return ctx; diff --git a/templates/Apps/HeroSkillsCardV1/content.hbs b/templates/Apps/HeroSkillsCardV1/content.hbs index 5259737..6f8c11b 100644 --- a/templates/Apps/HeroSkillsCardV1/content.hbs +++ b/templates/Apps/HeroSkillsCardV1/content.hbs @@ -104,7 +104,7 @@ {{/each}} -