diff --git a/hench.mjs b/hench.mjs index 8b25a54..bd35beb 100644 --- a/hench.mjs +++ b/hench.mjs @@ -14,6 +14,17 @@ Handlebars.registerHelper('partialList', (list, start, end, options) => { ).reduce((prev, next) => (prev + next), ""); }); +Handlebars.registerHelper('canDecrease', (value, cap) => { + return value > cap; +}); + +Handlebars.registerHelper('canIncrease', (value, cap) => { + return value < cap; +}); + +Handlebars.registerHelper('increment', (value) => (value + 1)); +Handlebars.registerHelper('decrement', (value) => (value - 1)); + Hooks.once("init", () => { CONFIG.Actor.dataModels = { hench: HenchDataModel, diff --git a/module/sheets/hench-actor-sheet.mjs b/module/sheets/hench-actor-sheet.mjs index a11d905..1e5da02 100644 --- a/module/sheets/hench-actor-sheet.mjs +++ b/module/sheets/hench-actor-sheet.mjs @@ -18,6 +18,9 @@ export class HenchActorSheet extends ActorSheet { context.maxStress = 12; context.maxExp = 5; + context.minGear = 3; + context.maxGear = 5; + return context; } @@ -72,6 +75,15 @@ export class HenchActorSheet extends ActorSheet { await updateField(this.actor, primaryPath, stringValue) await updateField(this.actor, secondaryPath, markedValue); }); + + // increase/decrease buttons + html.find('.hench-increment-button-field').click((event) => { + const element = event.currentTarget; + const path = element.dataset.fieldPath; + const value = element.dataset.value; + + updateField(this.actor, path, value); + }); } _changePlaybook(newPlaybookKeyEvent) { diff --git a/styles/hench.css b/styles/hench.css index 9697045..7ecc0a8 100644 --- a/styles/hench.css +++ b/styles/hench.css @@ -43,12 +43,20 @@ justify-content: center; } +.hench-box.hench-box-stretch { + align-items: stretch; +} + .hench-box > * { flex-grow: 1; flex-shrink: 0; align-items: center; } +.hench-box.hench-box-stretch > * { + align-items: stretch; +} + .hench-flex-fixed { flex-grow: 0; flex-shrink: 0; @@ -81,6 +89,11 @@ text-align: center; } +.hench-title { + font-weight: 500; + font-size: 1.5em; +} + /* Inputs */ .hench-sheet-container input[type="text"], .hench-sheet-container select { border: 0px; @@ -124,6 +137,7 @@ .hench-harm-fixed-width { width: 8em; text-align: center; + margin: auto; } .hench-harm-input-cell { @@ -137,4 +151,5 @@ .hench-harm-row { border-bottom: 1px solid #000; + align-items: stretch; } \ No newline at end of file diff --git a/templates/actors/hench.hbs b/templates/actors/hench.hbs index 00cf6cb..ae5fa58 100644 --- a/templates/actors/hench.hbs +++ b/templates/actors/hench.hbs @@ -3,7 +3,7 @@
-
+
@@ -25,8 +25,8 @@
-
-
+
+
Inclinations
    @@ -48,7 +48,12 @@
    -
    +
    +
    +
    + Details +
    +
    {{#each actor.system.details}}
    @@ -59,8 +64,8 @@ {{/each}}
    -
    -
    +
    +
    Mission Planning
      @@ -72,8 +77,8 @@
    -
    -
    +
    +
    @@ -85,42 +90,43 @@
    - +
    -
    -
    - Gear -
    -
    -
    - {{#partialList actor.system.fixedGear 0 5}} -
    -
    - + +
    + +
    +
    +
    +
    + Gear +
    +
    +
    +
    + +
    +
    + Limit: {{actor.system.gearLimit}} +
    +
    + +
    +
    + {{#each actor.system.fixedGear}} +
    +
    +
    - {{item.description}} + {{this.description}}
    - {{/partialList}} -
    -
    - {{#partialList actor.system.fixedGear 5 9}} -
    -
    - -
    -
    -
    - {{item.description}} -
    -
    -
    - {{/partialList}} -
    -
    + {{/each}} +
    +
    @@ -131,128 +137,138 @@
    -
    -
    - -
    -
    -
    - Abilities -
    - {{#each actor.system.moves}} -
    -
    - + +
    +
    +
    +
    + Experience +
    -
    -
    - -
    -
    - {{this.description}} -
    - {{#if this.hasWriteIn}} +
    + {{#int2checkbox maxExp actor.system.experience}}
    - +
    - {{/if}} -
    -
    - {{/each}} -
    -
    - -
    -
    -
    - -
    -
    - + {{/int2checkbox}}
    + {{#each actor.system.experienceTriggers}} +
    +
    + +
    +
    + {{this.description}} +
    +
    + {{/each}}
    -
    - -
    -
    -
    -
    - Harm -
    -
    - -
    -
    - 3: -
    - {{#each actor.system.harm.levelThree}} -
    - + +
    + +
    +
    +
    +
    + Harm +
    - {{/each}} -
    - Need help. -
    -
    - -
    -
    - 2: -
    - {{#each actor.system.harm.levelTwo}} -
    - + +
    +
    + 3: +
    + {{#each actor.system.harm.levelThree}} +
    + +
    + {{/each}} +
    + Need help. +
    - {{/each}} -
    - -1 Card -
    -
    - -
    -
    - 1: -
    - {{#each actor.system.harm.levelOne}} -
    - + +
    +
    + 2: +
    + {{#each actor.system.harm.levelTwo}} +
    + +
    + {{/each}} +
    + -1 Card +
    +
    + +
    +
    + 1: +
    + {{#each actor.system.harm.levelOne}} +
    + +
    + {{/each}} +
    + +
    - {{/each}} -
    -
    -
    -
    - -
    -
    -
    - Experience -
    -
    - {{#int2checkbox maxExp actor.system.experience}} -
    - + +
    +
    +
    +
    + Abilities +
    - {{/int2checkbox}} + {{#each actor.system.moves}} +
    +
    + +
    +
    +
    + +
    +
    + {{this.description}} +
    + {{#if this.hasWriteIn}} +
    + +
    + {{/if}} +
    +
    + {{/each}} +
    +
    + +
    +
    +
    + +
    +
    + +
    +
    +
    +
    -
      - {{#each actor.system.experienceTriggers}} -
    • - {{this.description}} -
    • - {{/each}} -
    -
    +
    Advancements
    {{#each actor.system.baseAdvancements}} @@ -267,8 +283,8 @@ {{/each}}
    -
    -
    +
    +
    Advancements