set the list display as a user flag

This commit is contained in:
IrkTheImp 2025-06-27 20:17:38 -05:00
parent 798c07dffe
commit 51602de36d
4 changed files with 8 additions and 7 deletions

View file

@ -293,7 +293,7 @@ export default class CharacterSheet extends DaggerheartSheet(ActorSheetV2) {
top: loadout.slice(0, Math.min(2, nrLoadoutCards)),
bottom: nrLoadoutCards > 2 ? loadout.slice(2, Math.min(5, nrLoadoutCards)) : [],
nrTotal: nrLoadoutCards,
listView: this.document.system.layout.listView
listView: game.user.getFlag(SYSTEM.id, SYSTEM.FLAGS.displayDomainCardsAsList)
},
vault: vault.map(x => ({
...x,
@ -450,8 +450,9 @@ export default class CharacterSheet extends DaggerheartSheet(ActorSheetV2) {
}
static async toggleLoadoutView(_, button) {
const listView = !(button.dataset.value === 'true');
await this.document.update({ 'system.layout.listView': listView });
const newAbilityView = !(button.dataset.value === 'true');
await game.user.setFlag(SYSTEM.id, SYSTEM.FLAGS.displayDomainCardsAsList, newAbilityView);
this.render();
}
static async attackRoll(event, button) {