Compare commits

..

No commits in common. "e138bc2b56fcb62aedaa9949d20539da2d7058ef" and "23b3be246b99654b40c0a8e7e12418a2a33562f3" have entirely different histories.

6 changed files with 19 additions and 48 deletions

View File

@ -214,7 +214,7 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
// Boutons spéciaux MJs
this.html.find('.forcer-tmr-aleatoire').click(async event => this.actor.reinsertionAleatoire("Action MJ"))
this.html.find('.don-de-haut-reve').click(async event => this.actor.addDonDeHautReve())
this.html.find('.sortreserve-add').click(async event => this.actor.addSortReserve(RdDSheetUtility.getItemId(event)))
this.html.find('.nouveau-sort-reserve').click(async event => this.actor.addSortReserve())
this.html.find('.afficher-tmr').click(async event => this.actor.changeTMRVisible())
}

View File

@ -991,31 +991,21 @@ export class RdDActor extends RdDBaseActorSang {
}
}
async addSortReserve(itemId) {
if (itemId) {
const item = this.items.get(itemId)
if (item.type == ITEM_TYPES.sort && !item.system.isrituel) {
this.$createSortReserve(item)
return
}
}
async addSortReserve() {
const selectSortReserve = {
title: "Créer un sort en réserve",
label: "Choisir un sort",
list: this.itemTypes[ITEM_TYPES.sort].filter(it => !it.system.isrituel)
}
DialogSelect.select(selectSortReserve, sort => this.$createSortReserve(sort))
}
$createSortReserve(sort) {
this.createEmbeddedDocuments("Item",
[{
type: ITEM_TYPES.sortreserve,
name: sort.name,
img: sort.img,
system: { sortid: sort.id, draconic: sort.system.draconic, ptreve: Number(sort.system.ptreve.match(/\d+/)), coord: 'A1', heurecible: 'Vaisseau' }
}],
{ renderSheet: true })
DialogSelect.select(selectSortReserve, sort =>
this.createEmbeddedDocuments("Item",
[{
type: ITEM_TYPES.sortreserve,
name: sort.name,
img: sort.img,
system: { sortid: sort.id, draconic: sort.system.draconic, ptreve: Number(sort.system.ptreve.match(/\d+/)), coord: 'A1', heurecible: 'Vaisseau' }
}],
{ renderSheet: true }))
}
/* -------------------------------------------- */
async reinsertionAleatoire(raison, accessible = tmr => true) {

View File

@ -15,7 +15,6 @@ export class CarteTmr extends Draconique {
name: 'Carte des TMR',
hint: "Choix de l'image de la carte des TMR",
scope: "client",
requiresReload: true,
config: true,
choices: {
[TMR_V3_COULEUR]: "TMR Scriptarium v3 couleur",

View File

@ -816,23 +816,12 @@ input:is(.blessure-premiers_soins, .blessure-soins_complets) {
.competence-list .item-controls.hidden-controls {
display: none !important;
}
.item-controls i:is(.fas, .fa, .fa-solid, .fa-regular) {
.item-controls i:is(.fas, .fa, .fa-solid) {
font-size: 0.8em;
color: var(--color-controls);
}
.item-controls i:is(.fas, .far, .fa-solid, .fa-regular):hover {
opacity: 0.6;
}
img.item-controls-img {
max-width: 1em;
max-height: 1em;
border-width: 0;
margin: 0;
vertical-align: middle;
}
img.item-controls-img:hover {
opacity: 0.6;
.item-controls i:is(.fas, .far, .fa-solid):hover {
opacity: 0.7 ;
}
.rdd-roll-dialog .description-sort {

View File

@ -1,7 +1,6 @@
{{#if sortsReserve.length}}
<h3>Sorts en Réserve{{#if options.isGM}} <a class="sortreserve-add">
<img class="item-controls-img" src="systems/foundryvtt-reve-de-dragon/icons/tmr/sort-reserve.svg"/>
</a>{{/if}}
<h3>Sorts en Réserve{{#if options.isGM}} <a class="nouveau-sort-reserve"><i class="fa-solid fa-sparkles"></i>
</a>{{/if}}
</h3>
<ul class="item-list alterne-list">
{{#each (trier sortsReserve) as |sort key|}}

View File

@ -5,22 +5,16 @@
<li class="item list-item flexrow" data-item-id="{{sort._id}}" data-attribute="{{key}}" data-tooltip="{{#if sort.system.isrituel}}Rituel{{else}}Sort{{/if}}: {{sort.name}}">
<img class="sheet-competence-img" src="{{sort.img}}"/>
<span class="flex-shrink">{{itemSort-shortDraconic sort.system.draconic}}</span>
<span class="item-edit flex-grow-3">{{sort.name}}
{{#if sort.system.isrituel}} <i class="fa-regular fa-book-sparkles"></i>{{/if}}
</span>
<span class="item-edit flex-grow-3">{{sort.name}}{{#if sort.system.isrituel}}
<i class="fa-regular fa-book-sparkles"></i>{{/if}}</span>
<span class="flex-grow-2">
{{#if sort.system.caseTMRspeciale}}{{sort.system.caseTMRspeciale}}{{else}}{{upperFirst sort.system.caseTMR}}{{/if}}
</span>
</span>
<span class="flex-grow-1">R{{itemSort-spaceIfText sort.system.difficulte}} r{{itemSort-spaceIfText sort.system.ptreve}}</span>
<div class="item-controls flex-shrink">
<a class="item-edit" data-tooltip="Modifier"><i class="fas fa-edit"></i></a>
<a class="item-delete" data-tooltip="Supprimer"><i class="fas fa-trash"></i></a>
<a class="item-montrer" data-tooltip="Montrer"><i class="fas fa-comment"></i></a>
{{#if (and @root.options.isGM (not sort.system.isrituel))}}
<a class="sortreserve-add" data-tooltip="Ajouter ce sort en réserve">
<img class="item-controls-img" src="systems/foundryvtt-reve-de-dragon/icons/tmr/sort-reserve.svg"/>
</a>
{{/if}}
</div>
</li>
{{/each}}