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
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('.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())
}

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 = {
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.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.$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 })
}
/* -------------------------------------------- */
async reinsertionAleatoire(raison, accessible = tmr => true) {

View File

@ -15,6 +15,7 @@ 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,12 +816,23 @@ 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) {
.item-controls i:is(.fas, .fa, .fa-solid, .fa-regular) {
font-size: 0.8em;
color: var(--color-controls);
}
.item-controls i:is(.fas, .far, .fa-solid):hover {
opacity: 0.7 ;
.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;
}
.rdd-roll-dialog .description-sort {

View File

@ -1,6 +1,7 @@
{{#if sortsReserve.length}}
<h3>Sorts en Réserve{{#if options.isGM}} <a class="nouveau-sort-reserve"><i class="fa-solid fa-sparkles"></i>
</a>{{/if}}
<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>
<ul class="item-list alterne-list">
{{#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}}">
<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}}