Compare commits

..

No commits in common. "3258285ceab5e61e7380c369a5f4080255886ad9" and "1c68c34641f6dee684bd254dff867564a68018c0" have entirely different histories.

9 changed files with 15 additions and 42 deletions

View File

@ -2,9 +2,6 @@
## 12.0.27 - Les vêtements d'Astrobazzarh ## 12.0.27 - Les vêtements d'Astrobazzarh
- Ajout de la liste des armures dans l'onglet caractéristiques - Ajout de la liste des armures dans l'onglet caractéristiques
- Correction des ajouts de blessures (prise en compte de l'endurance et des contusions) - Correction des ajouts de blessures (prise en compte de l'endurance et des contusions)
- Correction du choix d'une cible parmi toutes les cibles pour les combats
- Le Gardien peut créer des sorts en réserve parmi les sorts d'un personnage
- Correction des rituels de Détection et Lecture d'Aura des personnages prétirés
## 12.0.26 - Astrobazzarh le Haut-rêvant ## 12.0.26 - Astrobazzarh le Haut-rêvant
- bouton pour le don de haut-rêve en un clic - bouton pour le don de haut-rêve en un clic

View File

@ -215,7 +215,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('.afficher-tmr').click(async event => this.actor.changeTMRVisible()) this.html.find('.afficher-tmr').click(async event => this.actor.changeTMRVisible())
} }

View File

@ -40,7 +40,6 @@ import { RdDItemArme } from "./item-arme.js";
import { RdDCombatManager } from "./rdd-combat.js"; import { RdDCombatManager } from "./rdd-combat.js";
import { RdDItemTete } from "./item/tete.js"; import { RdDItemTete } from "./item/tete.js";
import { SystemCompendiums } from "./settings/system-compendiums.js"; import { SystemCompendiums } from "./settings/system-compendiums.js";
import { DialogSelect } from "./dialog-select.js";
export const MAINS_DIRECTRICES = ['Droitier', 'Gaucher', 'Ambidextre'] export const MAINS_DIRECTRICES = ['Droitier', 'Gaucher', 'Ambidextre']
@ -991,22 +990,6 @@ export class RdDActor extends RdDBaseActorSang {
} }
} }
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.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) { async reinsertionAleatoire(raison, accessible = tmr => true) {
const innaccessible = this.buildTMRInnaccessible(); const innaccessible = this.buildTMRInnaccessible();

View File

@ -2,11 +2,11 @@
export class DialogSelect extends Dialog { export class DialogSelect extends Dialog {
static extractIdNameImg(it) { return { id: it.id, name: it.name, img: it.img } } static extractIdNameImg(it) { return { id: it.id, name: it.name, img: it.img } }
static async select(selectionData, onSelectChoice) { static async select(selectData, onSelectChoice) {
const html = await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/dialog-select.html", selectionData) const html = await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/dialog-select.html", selectData)
const dialogData = { const dialogData = {
title: selectionData.title ?? selectionData.label, title: selectData.title ?? selectData.label,
content: html, content: html,
buttons: {} buttons: {}
} }
@ -18,7 +18,7 @@ export class DialogSelect extends Dialog {
'max-height': 600, 'max-height': 600,
'z-index': 99999 'z-index': 99999
} }
new DialogSelect(dialogData, dialogOptions, selectionData, onSelectChoice).render(true) new DialogSelect(dialogData, dialogOptions, selectData, onSelectChoice).render(true)
} }
constructor(dialogData, dialogOptions, selectionData, onSelectChoice) { constructor(dialogData, dialogOptions, selectionData, onSelectChoice) {
@ -36,7 +36,7 @@ export class DialogSelect extends Dialog {
} }
choiceSelected(selectedId) { choiceSelected(selectedId) {
const selected = this.selectionData.list.find(it => it.id == selectedId) const selected = this.selectionData.find(it => it.id == selectedId)
this.close() this.close()
if (selected) { if (selected) {
this.onSelectChoice(selected) this.onSelectChoice(selected)

View File

@ -11,12 +11,7 @@ export class Targets {
} }
static extractTokenData(target) { static extractTokenData(target) {
return { return { id: target?.id, name: target?.document.name, img: target?.document.texture.src ?? target?.actor.img ?? 'icons/svg/mystery-man.svg' };
id: target?.id,
name: target?.document.name,
img: target?.document.texture.src ?? target?.actor.img ?? 'icons/svg/mystery-man.svg',
target
};
} }
static buildActorTokenData(tokenId, actor) { static buildActorTokenData(tokenId, actor) {
return { id: tokenId, name: actor.name, img: actor.img ?? 'icons/svg/mystery-man.svg' }; return { id: tokenId, name: actor.name, img: actor.img ?? 'icons/svg/mystery-man.svg' };
@ -40,7 +35,7 @@ export class Targets {
label: "Choisir une seule des cibles", label: "Choisir une seule des cibles",
list: targets.map(it => Targets.extractTokenData(it)) list: targets.map(it => Targets.extractTokenData(it))
}; };
DialogSelect.select(selectData, t => onSelectTarget(t.target)) DialogSelect.select(selectData, onSelectTarget)
} }
} }
} }

View File

@ -2101,7 +2101,7 @@ items:
ptreve: '1' ptreve: '1'
xp: 0 xp: 0
bonuscase: '' bonuscase: ''
isrituel: true isrituel: false
coutseuil: 0 coutseuil: 0
folder: null folder: null
ownership: ownership:
@ -2168,7 +2168,7 @@ items:
ptreve: '3' ptreve: '3'
xp: 0 xp: 0
bonuscase: '' bonuscase: ''
isrituel: true isrituel: false
coutseuil: 0 coutseuil: 0
folder: null folder: null
ownership: ownership:

View File

@ -2259,7 +2259,7 @@ items:
ptreve: '3' ptreve: '3'
xp: 0 xp: 0
bonuscase: '' bonuscase: ''
isrituel: true isrituel: false
coutseuil: 0 coutseuil: 0
folder: null folder: null
ownership: ownership:
@ -2317,7 +2317,7 @@ items:
ptreve: '1' ptreve: '1'
xp: 0 xp: 0
bonuscase: '' bonuscase: ''
isrituel: true isrituel: false
coutseuil: 0 coutseuil: 0
folder: null folder: null
ownership: ownership:

View File

@ -2457,7 +2457,7 @@ items:
ptreve: '1' ptreve: '1'
xp: 0 xp: 0
bonuscase: '' bonuscase: ''
isrituel: true isrituel: false
coutseuil: 0 coutseuil: 0
folder: null folder: null
ownership: ownership:
@ -2524,7 +2524,7 @@ items:
ptreve: '3' ptreve: '3'
xp: 0 xp: 0
bonuscase: '' bonuscase: ''
isrituel: true isrituel: false
coutseuil: 0 coutseuil: 0
folder: null folder: null
ownership: ownership:

View File

@ -1,7 +1,5 @@
{{#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</h3>
</a>{{/if}}
</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|}}
<li class="item list-item flexrow" data-item-id="{{sort._id}}" data-attribute="{{key}}" <li class="item list-item flexrow" data-item-id="{{sort._id}}" data-attribute="{{key}}"