From 1923a63ebf18c4819fbbc346dc144a80c6af6850 Mon Sep 17 00:00:00 2001 From: LeRatierBretonnien Date: Tue, 7 Feb 2023 15:36:06 +0100 Subject: [PATCH] Update tarot management --- modules/malefices-actor-sheet.js | 1 + modules/malefices-actor.js | 8 ++++++- system.json | 4 ++-- template.json | 3 ++- templates/actors/actor-sheet.hbs | 32 ++++++++++++++++++++++++++++ templates/items/item-tarot-sheet.hbs | 27 ++++++++++++++++------- 6 files changed, 63 insertions(+), 12 deletions(-) diff --git a/modules/malefices-actor-sheet.js b/modules/malefices-actor-sheet.js index d8d483a..47e277c 100644 --- a/modules/malefices-actor-sheet.js +++ b/modules/malefices-actor-sheet.js @@ -37,6 +37,7 @@ export class MaleficesActorSheet extends ActorSheet { limited: this.object.limited, armes: duplicate(this.actor.getArmes()), tarots: duplicate(this.actor.getTarots()), + tarotsCache: duplicate(this.actor.getHiddenTarots()), archetype: duplicate(this.actor.getArchetype()), equipements: duplicate(this.actor.getEquipements()), subActors: duplicate(this.actor.getSubActors()), diff --git a/modules/malefices-actor.js b/modules/malefices-actor.js index 5ca14ba..5bfc06f 100644 --- a/modules/malefices-actor.js +++ b/modules/malefices-actor.js @@ -102,7 +102,13 @@ export class MaleficesActor extends Actor { } /* -------------------------------------------- */ getTarots() { - let comp = duplicate(this.items.filter(item => item.type == 'tarot') || []) + let comp = duplicate(this.items.filter(item => item.type == 'tarot' && !item.system.isgm) || []) + MaleficesUtility.sortArrayObjectsByName(comp) + return comp; + } + /* -------------------------------------------- */ + getHiddenTarots() { + let comp = duplicate(this.items.filter(item => item.type == 'tarot' && item.system.isgm) || []) MaleficesUtility.sortArrayObjectsByName(comp) return comp; } diff --git a/system.json b/system.json index a6825ab..0fe8df6 100644 --- a/system.json +++ b/system.json @@ -64,7 +64,7 @@ ], "title": "Maléfices, le Jeu de Rôle", "url": "https://www.uberwald.me/gitea/public/fvtt-malefices", - "version": "10.0.14", - "download": "https://www.uberwald.me/gitea/public/fvtt-malefices/archive/fvtt-malefices-v10.0.14.zip", + "version": "10.0.16", + "download": "https://www.uberwald.me/gitea/public/fvtt-malefices/archive/fvtt-malefices-v10.0.16.zip", "background": "systems/fvtt-malefices/images/ui/malefice_welcome_page.webp" } \ No newline at end of file diff --git a/template.json b/template.json index 8ccd531..339cc55 100644 --- a/template.json +++ b/template.json @@ -110,7 +110,8 @@ }, "tarot": { "tarottype": "", - "isreversed": false, + "ispositif": true, + "isgm": false, "description": "" }, "archetype": { diff --git a/templates/actors/actor-sheet.hbs b/templates/actors/actor-sheet.hbs index 0cddf65..5bb4a97 100644 --- a/templates/actors/actor-sheet.hbs +++ b/templates/actors/actor-sheet.hbs @@ -279,6 +279,9 @@

+ + +
@@ -288,6 +291,35 @@ {{tarot.name}} + +
 
+ {{#if @root.isGM}} +
+ +
+ {{/if}} + + {{/each}} + + +