Update tarot management

This commit is contained in:
LeRatierBretonnien 2023-02-07 15:36:06 +01:00
parent 06537cbcd9
commit 1923a63ebf
6 changed files with 63 additions and 12 deletions

View File

@ -37,6 +37,7 @@ export class MaleficesActorSheet extends ActorSheet {
limited: this.object.limited, limited: this.object.limited,
armes: duplicate(this.actor.getArmes()), armes: duplicate(this.actor.getArmes()),
tarots: duplicate(this.actor.getTarots()), tarots: duplicate(this.actor.getTarots()),
tarotsCache: duplicate(this.actor.getHiddenTarots()),
archetype: duplicate(this.actor.getArchetype()), archetype: duplicate(this.actor.getArchetype()),
equipements: duplicate(this.actor.getEquipements()), equipements: duplicate(this.actor.getEquipements()),
subActors: duplicate(this.actor.getSubActors()), subActors: duplicate(this.actor.getSubActors()),

View File

@ -102,7 +102,13 @@ export class MaleficesActor extends Actor {
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
getTarots() { 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) MaleficesUtility.sortArrayObjectsByName(comp)
return comp; return comp;
} }

View File

@ -64,7 +64,7 @@
], ],
"title": "Maléfices, le Jeu de Rôle", "title": "Maléfices, le Jeu de Rôle",
"url": "https://www.uberwald.me/gitea/public/fvtt-malefices", "url": "https://www.uberwald.me/gitea/public/fvtt-malefices",
"version": "10.0.14", "version": "10.0.16",
"download": "https://www.uberwald.me/gitea/public/fvtt-malefices/archive/fvtt-malefices-v10.0.14.zip", "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" "background": "systems/fvtt-malefices/images/ui/malefice_welcome_page.webp"
} }

View File

@ -110,7 +110,8 @@
}, },
"tarot": { "tarot": {
"tarottype": "", "tarottype": "",
"isreversed": false, "ispositif": true,
"isgm": false,
"description": "" "description": ""
}, },
"archetype": { "archetype": {

View File

@ -279,6 +279,9 @@
<span class="item-name-label-header"> <span class="item-name-label-header">
<h3><label class="items-title-text">Tarots</label></h3> <h3><label class="items-title-text">Tarots</label></h3>
</span> </span>
<span class="item-field-label-medium">
<label class="item-field-label-medium">Sens</label>
</span>
<div class="item-controls item-controls-fixed"> <div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="weapon" title="Create Item"><i class="fas fa-plus"></i></a> <a class="item-control item-add" data-type="weapon" title="Create Item"><i class="fas fa-plus"></i></a>
</div> </div>
@ -288,6 +291,35 @@
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img" <a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{tarot.img}}" /></a> src="{{tarot.img}}" /></a>
<span class="item-name-label">{{tarot.name}}</span> <span class="item-name-label">{{tarot.name}}</span>
<span class="item-field-label-medium"><label>{{#if tarot.system.ispositif}}Positif{{else}}Négatif{{/if}}</label></span>
<div class="item-filler">&nbsp;</div>
{{#if @root.isGM}}
<div class="item-controls item-controls-fixed">
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
{{/if}}
</li>
{{/each}}
</ul>
<ul class="item-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Tarot secret(MJ)</label></h3>
</span>
<span class="item-field-label-medium">
<label class="item-field-label-medium">Sens</label>
</span>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="weapon" title="Create Item"><i class="fas fa-plus"></i></a>
</div>
</li>
{{#each tarotsCache as |tarot key|}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{tarot._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{tarot.img}}" /></a>
<span class="item-name-label">{{tarot.name}}</span>
<span class="item-field-label-medium"><label>{{#if tarot.system.ispositif}}Positif{{else}}Négatif{{/if}}</label></span>
<div class="item-filler">&nbsp;</div> <div class="item-filler">&nbsp;</div>
{{#if @root.isGM}} {{#if @root.isGM}}
<div class="item-controls item-controls-fixed"> <div class="item-controls item-controls-fixed">

View File

@ -34,6 +34,17 @@
</select> </select>
</li> </li>
{{#if isGM}}
<li class="flexrow">
<label class="item-field-label-long">En positif ?</label>
<input type="checkbox" class="item-field-label-short" name="system.ispositif" {{checked system.ispositif}} />
</li>
<li class="flexrow">
<label class="item-field-label-long">Carte cachée (ie MJ seulement) ?</label>
<input type="checkbox" class="item-field-label-short" name="system.isgm" {{checked system.isgm}} />
</li>
{{/if}}
</ul> </ul>
</div> </div>
</div> </div>