Compare commits

..

3 Commits

Author SHA1 Message Date
e138bc2b56 Mettre en réserve depuis un sort
Ajout d'une icône pour mettre les sorts en réserve depuis la
liste de sorts
2024-12-10 21:10:36 +01:00
979d49f96e Force reload on TMR change 2024-12-09 23:12:22 +01:00
22cab26908 Merge pull request '12.0.27 - Les vêtements d'Astrobazzarh' (#730) from VincentVk/foundryvtt-reve-de-dragon:v11 into v11
Reviewed-on: public/foundryvtt-reve-de-dragon#730
2024-12-09 23:02:09 +01:00
6 changed files with 48 additions and 19 deletions

View File

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

View File

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

View File

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

View File

@ -816,12 +816,23 @@ input:is(.blessure-premiers_soins, .blessure-soins_complets) {
.competence-list .item-controls.hidden-controls { .competence-list .item-controls.hidden-controls {
display: none !important; display: none !important;
} }
.item-controls i:is(.fas, .fa, .fa-solid) { .item-controls i:is(.fas, .fa, .fa-solid, .fa-regular) {
font-size: 0.8em; font-size: 0.8em;
color: var(--color-controls); color: var(--color-controls);
} }
.item-controls i:is(.fas, .far, .fa-solid):hover { .item-controls i:is(.fas, .far, .fa-solid, .fa-regular):hover {
opacity: 0.7 ; 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;
} }
.rdd-roll-dialog .description-sort { .rdd-roll-dialog .description-sort {

View File

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

View File

@ -5,16 +5,22 @@
<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}}"> <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}}"/> <img class="sheet-competence-img" src="{{sort.img}}"/>
<span class="flex-shrink">{{itemSort-shortDraconic sort.system.draconic}}</span> <span class="flex-shrink">{{itemSort-shortDraconic sort.system.draconic}}</span>
<span class="item-edit flex-grow-3">{{sort.name}}{{#if sort.system.isrituel}} <span class="item-edit flex-grow-3">{{sort.name}}
<i class="fa-regular fa-book-sparkles"></i>{{/if}}</span> {{#if sort.system.isrituel}} <i class="fa-regular fa-book-sparkles"></i>{{/if}}
</span>
<span class="flex-grow-2"> <span class="flex-grow-2">
{{#if sort.system.caseTMRspeciale}}{{sort.system.caseTMRspeciale}}{{else}}{{upperFirst sort.system.caseTMR}}{{/if}} {{#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> <span class="flex-grow-1">R{{itemSort-spaceIfText sort.system.difficulte}} r{{itemSort-spaceIfText sort.system.ptreve}}</span>
<div class="item-controls flex-shrink"> <div class="item-controls flex-shrink">
<a class="item-edit" data-tooltip="Modifier"><i class="fas fa-edit"></i></a> <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-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> <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> </div>
</li> </li>
{{/each}} {{/each}}