requires retargeting of styling

feature/applicationv2
macniel 2025-10-16 21:46:35 +02:00
parent 561e34d0ff
commit 96d7b18742
12 changed files with 66 additions and 51 deletions

View File

@ -21,7 +21,7 @@ export default {
icon: e.icon,
})
}))
return returnValue;
return returnValue
}
context.mods = {
@ -36,8 +36,8 @@ export default {
"at": await getModsOfAttribute('system.at.mod', actorData),
"pa": await getModsOfAttribute('system.pa.mod', actorData),
"fk": await getModsOfAttribute('system.fk.mod', actorData),
}
context.attributes = [
{
eigenschaft: "mu",
@ -87,7 +87,6 @@ export default {
tooltip: "Körperkraft",
wert: context.derived.attribute.kk.aktuell ?? 0,
},
]
Object.values(actorData.items).forEach((item) => {
@ -101,12 +100,12 @@ export default {
isAdvantage: !item.system.nachteil,
isDisadvantage: item.system.nachteil,
isBadAttribute: item.system.schlechteEigenschaft
});
})
}
}
);
)
context.specialAbilities = [];
context.specialAbilities = []
Object.values(actorData.items).forEach((item) => {
if (item.type === "SpecialAbility") {
context.specialAbilities.push({
@ -116,6 +115,8 @@ export default {
}
}
);
return context
},
_onRender: (context, options) => {

View File

@ -101,6 +101,8 @@ export default {
})
}
return context
},
_onRender: (context, options) => {

View File

@ -42,6 +42,8 @@ export default {
});
}
})
return context
},
_onRender: (context, options) => {

View File

@ -140,6 +140,8 @@ export default {
]
})
}
return context
},
_onRender: (context, options, element) => {
const mapAllSets = () => {

View File

@ -98,6 +98,8 @@ export default {
})
context.hasLiturgies = context.blessings.length > 0;
return context
},
_onRender: (context, options) => {

View File

@ -7,6 +7,8 @@ export default {
context.originalName = actorData.name
context.name = context.derived.name ?? actorData.name
context.effects = actorData.effects ?? []
return context
},
_onRender: (context, options) => {

View File

@ -69,7 +69,9 @@ export default {
context.flatSkills.push(obj);
}
}
);
)
return context
},
_onRender: (context, options) => {

View File

@ -38,7 +38,9 @@ export default {
})
}
})
context.hasSpells = context.spells.length > 0;
context.hasSpells = context.spells.length > 0
return context
},
_onRender: (context, options) => {

View File

@ -38,6 +38,13 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
sheet: {
tabs: [
{id: 'meta', group: 'sheet', label: 'Meta'},
{id: 'attributes', group: 'sheet', label: 'Eigenschaften'},
{id: 'combat', group: 'sheet', label: 'Kampf'},
{id: 'equipment', group: 'sheet', label: 'Inventar'},
{id: 'skills', group: 'sheet', label: 'Talente'},
{id: 'spells', group: 'sheet', label: 'Zauber'},
{id: 'liturgies', group: 'sheet', label: 'Liturgien'},
],
initial: 'meta'
}
@ -103,20 +110,41 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
await this.document.update(formData.object) // Note: formData.object
}
_getTabsConfig(group) {
const tabs = foundry.utils.deepClone(super._getTabsConfig(group))
Attributes._getTabConfig(tabs)
Combat._getTabConfig(tabs)
Equipment._getTabConfig(tabs)
Skills._getTabConfig(tabs)
Spells._getTabConfig(tabs)
Liturgies._getTabConfig(tabs)
Effects._getTabConfig(tabs)
return tabs
}
/*
_getTabsConfig(group) {
const tabs = foundry.utils.deepClone(super._getTabsConfig(group))
Attributes._getTabConfig(tabs)
Combat._getTabConfig(tabs)
Equipment._getTabConfig(tabs)
Skills._getTabConfig(tabs)
Spells._getTabConfig(tabs)
Liturgies._getTabConfig(tabs)
Effects._getTabConfig(tabs)
return tabs
}
*/
async _preparePartContext(partId, context) {
switch (partId) {
case "form":
const actorData = context.document
context.system = actorData.system
context.flags = actorData.flags
context.derived = context.document.system
context.originalName = actorData.name
context.name = context.derived.name ?? actorData.name
context.effects = actorData.effects ?? []
context.maxWounds = actorData.system.wunden.max ?? 3
context.wounds = actorData.system.wunden.aktuell ?? 0
context.woundsFilled = []
for (let i = 1; i <= context.maxWounds; i++) {
context.woundsFilled[i] = i <= context.wounds
}
context.zonenruestung = game.settings.get("DSA_4-1", "optional_ruestungzonen")
context.trefferzonen = game.settings.get("DSA_4-1", "optional_trefferzonen")
context.ausdauer = game.settings.get("DSA_4-1", "optional_ausdauer")
break;
case "meta":
Meta._prepareContext(context, this.object)
break
@ -142,31 +170,7 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
Effects._prepareContext(context, this.object)
break
}
}
/** @override */
async _prepareContext(options) {
const context = await super._prepareContext(options)
const actorData = context.document
context.system = actorData.system
context.flags = actorData.flags
context.derived = context.document.system
context.originalName = actorData.name
context.name = context.derived.name ?? actorData.name
context.effects = actorData.effects ?? []
context.maxWounds = actorData.system.wunden.max ?? 3
context.wounds = actorData.system.wunden.aktuell ?? 0
context.woundsFilled = []
for (let i = 1; i <= context.maxWounds; i++) {
context.woundsFilled[i] = i <= context.wounds
}
context.zonenruestung = game.settings.get("DSA_4-1", "optional_ruestungzonen")
context.trefferzonen = game.settings.get("DSA_4-1", "optional_trefferzonen")
context.ausdauer = game.settings.get("DSA_4-1", "optional_ausdauer")
return context;
return context
}
_onRender(context, options) {

View File

@ -3,10 +3,7 @@
@use "../atoms/colours" as colour;
.dsa41.sheet.actor.character {
.window-header.flexrow.draggable.resizable {
}
.application.sheet.dsa41.actor.character {
$sidebar-width: 224px;
$attribute-height: 60px;

View File

@ -95,6 +95,4 @@
</div>
{{/if}}
</div>
</section>

View File

@ -24,4 +24,5 @@
{{/each}}
</tbody>
</table>
</section>