diff --git a/src/module/dialog/restingDialog.mjs b/src/module/dialog/restingDialog.mjs index 01da6bd9..7dcc00dd 100644 --- a/src/module/dialog/restingDialog.mjs +++ b/src/module/dialog/restingDialog.mjs @@ -99,6 +99,7 @@ export class RestingDialog extends HandlebarsApplicationMixin(ApplicationV2) { lepMod: [-1, -2, -3, -4, -5], display: "range", noLabel: "Gutes Wetter", + nestingLevel: 1, labels: [ "Schlechtes Wetter I", "Schlechtes Wetter II", @@ -114,6 +115,7 @@ export class RestingDialog extends HandlebarsApplicationMixin(ApplicationV2) { aspMod: -1, lepMod: -1, display: "boolean", + nestingLevel: 1, group: "bad_camp", active: false, value: "on" @@ -220,6 +222,14 @@ export class RestingDialog extends HandlebarsApplicationMixin(ApplicationV2) { const elementInMod = this.element.querySelector('output[name="inMod"]') const elementWoundMod = this.element.querySelector('output[name="woundMod"]') + if (this.restingType === this.#type.DRAUßEN) { + this.element.querySelector('input[name="bad_weather"]').removeAttribute('disabled') + this.element.querySelector('input[name="bad_camp"]').removeAttribute('disabled') + } else { + this.element.querySelector('input[name="bad_weather"]').setAttribute('disabled', 'disabled') + this.element.querySelector('input[name="bad_camp"]').setAttribute('disabled', 'disabled') + } + const context = this.#updateData() elementLepMod.value = context.lepModDisplay elementKoMod.value = context.koRollDisplay @@ -334,8 +344,6 @@ export class RestingDialog extends HandlebarsApplicationMixin(ApplicationV2) { context.inRollDisplay = `1w20+${this.regInMod}` } - console.log(this, context) - return context } diff --git a/src/module/setup/partials.mjs b/src/module/setup/partials.mjs index cf2de449..f589948e 100644 --- a/src/module/setup/partials.mjs +++ b/src/module/setup/partials.mjs @@ -15,6 +15,7 @@ function loadPartials(hbs) { 'systems/DSA_4-1/templates/ui/partial-action-button.hbs', 'systems/DSA_4-1/templates/ui/partial-equipment-button.hbs', 'systems/DSA_4-1/templates/ui/partial-array-editor.hbs', + 'systems/DSA_4-1/templates/actor/character/tab-set.hbs', 'systems/DSA_4-1/templates/dialog/liturgy-dialog.hbs' ]).then(resolve); }) diff --git a/src/module/sheets/character/equipment.mjs b/src/module/sheets/character/equipment.mjs index d38ac604..bdb26eaa 100644 --- a/src/module/sheets/character/equipment.mjs +++ b/src/module/sheets/character/equipment.mjs @@ -1,7 +1,7 @@ import {PlayerCharacterDataModel} from "../../data/character.mjs"; export default { - _prepareContext: (context) => { + _prepareContext: (context, actor, thisObject) => { const actorData = context.document context.spells = [] @@ -53,7 +53,7 @@ export default { context.sets.push({ tab: "set" + (setIndex + 1), - name: romanNumerals[setIndex], + label: romanNumerals[setIndex], index: setIndex, slots: [ { @@ -290,7 +290,7 @@ export default { ], {jQuery: false}); }, _getTabConfig: (group) => { - group.tabs.push({id: "equipment", group: "sheet", label: "Ausrüstung"}) + group?.tabs.push({id: "equipment", group: "sheet", label: "Ausrüstung"}) }, template: `systems/DSA_4-1/templates/actor/character/tab-equipment.hbs` } \ No newline at end of file diff --git a/src/module/sheets/character/liturgies.mjs b/src/module/sheets/character/liturgies.mjs index 4c3d38f0..c5293522 100644 --- a/src/module/sheets/character/liturgies.mjs +++ b/src/module/sheets/character/liturgies.mjs @@ -104,7 +104,7 @@ export default { _getTabConfig: (group, thisObject) => { const hasLiturgies = thisObject.document.items.filter(p => p.type === "Liturgy").length > 0 ?? false if (hasLiturgies) { - group.tabs.push({id: "liturgies", group: "sheet", label: "Liturgien"}) + group?.tabs.push({id: "liturgies", group: "sheet", label: "Liturgien"}) } }, template: `systems/DSA_4-1/templates/actor/character/tab-liturgies.hbs` diff --git a/src/module/sheets/character/meta.mjs b/src/module/sheets/character/meta.mjs index de5d56fe..57b92286 100644 --- a/src/module/sheets/character/meta.mjs +++ b/src/module/sheets/character/meta.mjs @@ -14,7 +14,7 @@ export default { }, _getTabConfig: (group) => { - group.tabs.push({id: "meta", group: "sheet", label: "Meta"}) + group?.tabs.push({id: "meta", group: "sheet", label: "Meta"}) }, template: `systems/DSA_4-1/templates/actor/character/tab-meta.hbs` } \ No newline at end of file diff --git a/src/module/sheets/characterSheet.mjs b/src/module/sheets/characterSheet.mjs index b59c2cfb..02c13ac1 100644 --- a/src/module/sheets/characterSheet.mjs +++ b/src/module/sheets/characterSheet.mjs @@ -59,7 +59,7 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) { sheet: { tabs: [], initial: 'meta' - } + }, } /** @inheritDoc */ @@ -94,7 +94,16 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) { }, effects: { template: Effects.template - } + }, + set1: { + template: "systems/DSA_4-1/templates/actor/character/tab-set.hbs" + }, + set2: { + template: "systems/DSA_4-1/templates/actor/character/tab-set.hbs" + }, + set3: { + template: "systems/DSA_4-1/templates/actor/character/tab-set.hbs" + }, } @@ -542,7 +551,7 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) { await Combat._prepareContext(context, this.document) break case "equipment": - await Equipment._prepareContext(context, this.document) + await Equipment._prepareContext(context, this.document, this) break case "skills": await Skills._prepareContext(context, this.document) diff --git a/src/templates/actor/character/tab-equipment.hbs b/src/templates/actor/character/tab-equipment.hbs index 2f59d916..68cb7693 100644 --- a/src/templates/actor/character/tab-equipment.hbs +++ b/src/templates/actor/character/tab-equipment.hbs @@ -19,25 +19,22 @@
{{> "systems/DSA_4-1/templates/ui/partial-equipment-button.hbs" equipments}}
- - + \ No newline at end of file diff --git a/src/templates/actor/character/tab-set.hbs b/src/templates/actor/character/tab-set.hbs index 43b5bb2c..cde2bd41 100644 --- a/src/templates/actor/character/tab-set.hbs +++ b/src/templates/actor/character/tab-set.hbs @@ -1,29 +1,25 @@ -
+
+ + {{#each this.slots}} +
+ {{/each}} + {{!-- + {{#if (eq ../actor.system.setEquipped @index)}} + + {{else}} + + {{/if}} -
- - - + --}} - {{#each this.slots}} -
- {{/each}} - {{#if (eq ../actor.system.setEquipped @index)}} - - {{else}} - - {{/if}} - -
- -
\ No newline at end of file + \ No newline at end of file diff --git a/src/templates/dialog/resting-dialog.hbs b/src/templates/dialog/resting-dialog.hbs index 87cb1b60..afae5b85 100644 --- a/src/templates/dialog/resting-dialog.hbs +++ b/src/templates/dialog/resting-dialog.hbs @@ -24,10 +24,10 @@ {{#each circumstances}} -
+