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,
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()),

View File

@ -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;
}

View File

@ -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"
}

View File

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

View File

@ -279,6 +279,9 @@
<span class="item-name-label-header">
<h3><label class="items-title-text">Tarots</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>
@ -288,6 +291,35 @@
<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>
{{#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>
{{#if @root.isGM}}
<div class="item-controls item-controls-fixed">

View File

@ -23,16 +23,27 @@
<div class="tab" data-group="primary">
<ul>
<li class="flexrow">
<label class="item-field-label-long">Type </label>
<select class="item-field-label-long" type="text" name="system.tarottype" value="{{system.tarottype}}" data-dtype="String">
{{#select system.tarottype}}
{{#each config.tarotType as |type key| }}
<option value="{{key}}">{{type}}</option>
{{/each}}
{{/select}}
</select>
</li>
{{#if isGM}}
<li class="flexrow">
<label class="item-field-label-long">Type </label>
<select class="item-field-label-long" type="text" name="system.tarottype" value="{{system.tarottype}}" data-dtype="String">
{{#select system.tarottype}}
{{#each config.tarotType as |type key| }}
<option value="{{key}}">{{type}}</option>
{{/each}}
{{/select}}
</select>
<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>
</div>