This commit is contained in:
WBHarry 2025-08-07 23:26:42 +02:00 committed by GitHub
parent 5045801475
commit 22283cb506
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 98 additions and 34 deletions

View file

@ -178,6 +178,13 @@ export default class CharacterSheet extends DHBaseActorSheet {
async _preparePartContext(partId, context, options) {
context = await super._preparePartContext(partId, context, options);
switch (partId) {
case 'header':
const { playerCanEditSheet, levelupAuto } = game.settings.get(
CONFIG.DH.id,
CONFIG.DH.SETTINGS.gameSettings.Automation
);
context.showSettings = game.user.isGM || !levelupAuto || (levelupAuto && playerCanEditSheet);
break;
case 'loadout':
await this._prepareLoadoutContext(context, options);
break;
@ -188,6 +195,7 @@ export default class CharacterSheet extends DHBaseActorSheet {
await this._prepareBiographyContext(context, options);
break;
}
return context;
}

View file

@ -175,7 +175,6 @@ export default class DHBaseActorSheet extends DHApplicationMixin(ActorSheetV2) {
const newValue = (action.uses.value ?? 0) + (increase ? 1 : -1);
await action.update({ 'uses.value': Math.min(Math.max(newValue, 0), action.uses.max ?? 0) });
this.render();
}
/* -------------------------------------------- */