forked from public/foundryvtt-reve-de-dragon
		
	Merge branch 'v1.4-dialog' into 'v1.4'
Rework dialogues See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!212
This commit is contained in:
		| @@ -324,12 +324,13 @@ export class RdDActor extends Actor { | |||||||
|   /* -------------------------------------------- */ |   /* -------------------------------------------- */ | ||||||
|   getDraconicList() { |   getDraconicList() { | ||||||
|     return this.items.filter(it => Misc.data(it).type == 'competence' && Misc.templateData(it).categorie == 'draconic') |     return this.items.filter(it => Misc.data(it).type == 'competence' && Misc.templateData(it).categorie == 'draconic') | ||||||
|  |       .sort(Misc.descending(it => Misc.templateData(it).niveau)); | ||||||
|   } |   } | ||||||
|   /* -------------------------------------------- */ |   /* -------------------------------------------- */ | ||||||
|   getBestDraconic() { |   getBestDraconic() { | ||||||
|     const list = this.getDraconicList().sort(Misc.descending(it => Misc.templateData(it).niveau)); |     const list = this.getDraconicList(); | ||||||
|     if (list.length == 0) { |     if (list.length == 0) { | ||||||
|       return { name: "Aucun", data: { name: "Aucun", data: { niveau: -11 } } }; |       return { name: "Aucun", data: { name: "Aucun", data: { niveau: 0 } } }; | ||||||
|     } |     } | ||||||
|     return duplicate(list[0]); |     return duplicate(list[0]); | ||||||
|   } |   } | ||||||
| @@ -541,9 +542,8 @@ export class RdDActor extends Actor { | |||||||
|     ChatMessage.create(message); |     ChatMessage.create(message); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |  | ||||||
|   /* -------------------------------------------- */ |   /* -------------------------------------------- */ | ||||||
|   async dormir(heures = 1) { |   async dormir(heures) { | ||||||
|     let message = { |     let message = { | ||||||
|       whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name), |       whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name), | ||||||
|       content: `${this.name}: Vous dormez ${heures == 1 ? 'une' : heures} heure${heures == 1 ? '' : 's'}.` |       content: `${this.name}: Vous dormez ${heures == 1 ? 'une' : heures} heure${heures == 1 ? '' : 's'}.` | ||||||
| @@ -552,9 +552,9 @@ export class RdDActor extends Actor { | |||||||
|     for (let i = 0; i < heures; i++) { |     for (let i = 0; i < heures; i++) { | ||||||
|       await this._recupererEthylisme(message); |       await this._recupererEthylisme(message); | ||||||
|       await this.recupererFatigue(message); |       await this.recupererFatigue(message); | ||||||
|       await this.recuperationReve(message); |       await this.recuperationReve(message, 1); | ||||||
|       if (EffetsDraconiques.isDonDoubleReve(this)) { |       if (EffetsDraconiques.isDonDoubleReve(this)) { | ||||||
|         await this.recuperationReve(message); |         await this.recuperationReve(message, 2); | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
|     ChatMessage.create(message); |     ChatMessage.create(message); | ||||||
| @@ -620,11 +620,13 @@ export class RdDActor extends Actor { | |||||||
|   } |   } | ||||||
|  |  | ||||||
|   /* -------------------------------------------- */ |   /* -------------------------------------------- */ | ||||||
|   async recuperationReve(message) { |   async recuperationReve(message, demiHeure) { | ||||||
|     const seuil = Misc.templateData(this).reve.seuil.value; |     const seuil = Misc.templateData(this).reve.seuil.value; | ||||||
|     const reveActuel = this.getReveActuel(); |     const reveActuel = this.getReveActuel(); | ||||||
|     if (reveActuel >= seuil) { |     if (reveActuel >= seuil) { | ||||||
|       message.content += `Vous avez suffisament rêvé, au delà de votre seuil. `; |       if (demiHeure == 1) { | ||||||
|  |         message.content += `Vous avez suffisament rêvé, au delà de votre seuil. `; | ||||||
|  |       } | ||||||
|     } |     } | ||||||
|     else { |     else { | ||||||
|       let deRecuperation = (await DeDraconique.ddr("selfroll")).total; |       let deRecuperation = (await DeDraconique.ddr("selfroll")).total; | ||||||
| @@ -1967,28 +1969,29 @@ export class RdDActor extends Actor { | |||||||
|   } |   } | ||||||
|  |  | ||||||
|   /* -------------------------------------------- */ |   /* -------------------------------------------- */ | ||||||
|   filterDraconicList(sortList) { |   computeDraconicAndSortIndex(sortList) { | ||||||
|     let draconicDone = {}; |     let draconicList = this.getDraconicList().map(d => duplicate(Misc.data(d))); | ||||||
|     let newDraconicList = []; |  | ||||||
|     let draconicList = this.getDraconicList(); |  | ||||||
|     let bestDraconic = this.getBestDraconic(); |  | ||||||
|     for (let sort of sortList) { |     for (let sort of sortList) { | ||||||
|       let voie = sort.data.draconic; |       let draconicsSort = this.getDraconicsSort(draconicList, sort).map(it => it.name); | ||||||
|       let draconic = RdDItemCompetence.getVoieDraconic(draconicList, voie); |       for (let index = 0; index < draconicList.length && sort.data.listIndex==undefined; index++){ | ||||||
|       //console.log(draconicList, bestDraconic, draconic, voie); |         if (draconicsSort.includes(draconicList[index].name)){ | ||||||
|       if (sort.name.toLowerCase().includes('aura')) { |           sort.data.listIndex = index; | ||||||
|         draconic = bestDraconic; |         } | ||||||
|       } |       } | ||||||
|       // TODO: duplicate sur Misc.data? |  | ||||||
|       draconic = duplicate(Misc.data(draconic)); |  | ||||||
|       if (draconicDone[draconic.name] == undefined) { |  | ||||||
|         draconic.data.defaut_carac = 'reve'; |  | ||||||
|         newDraconicList.push(draconic); |  | ||||||
|         draconicDone[draconic.name] = newDraconicList.length - 1; // Patch local pour relier facilement voie/compétence |  | ||||||
|       } |  | ||||||
|       sort.data.listIndex = draconicDone[draconic.name] || 0; |  | ||||||
|     } |     } | ||||||
|     return newDraconicList; |     return draconicList; | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   getDraconicsSort(draconicList, sort) { | ||||||
|  |     //console.log(draconicList, bestDraconic, draconic, voie); | ||||||
|  |     switch (Grammar.toLowerCaseNoAccent(sort.name)) { | ||||||
|  |       case "lecture d'aura": | ||||||
|  |       case "detection d'aura": | ||||||
|  |         return draconicList; | ||||||
|  |       case "annulation de magie": | ||||||
|  |         return draconicList.filter(it => !Grammar.toLowerCaseNoAccent(Misc.data(it).name).includes('thanatos')); | ||||||
|  |     } | ||||||
|  |     return [RdDItemCompetence.getVoieDraconic(draconicList, sort.data.draconic)]; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   /* -------------------------------------------- */ |   /* -------------------------------------------- */ | ||||||
| @@ -2009,7 +2012,7 @@ export class RdDActor extends Actor { | |||||||
|     } |     } | ||||||
|     if (this.currentTMR) this.currentTMR.minimize(); // Hide |     if (this.currentTMR) this.currentTMR.minimize(); // Hide | ||||||
|  |  | ||||||
|     let draconicList = this.filterDraconicList(sortList); |     let draconicList = this.computeDraconicAndSortIndex(sortList); | ||||||
|     const actorData = Misc.data(this); |     const actorData = Misc.data(this); | ||||||
|     let rollData = { |     let rollData = { | ||||||
|       forceCarac: { 'reve': duplicate(actorData.data.carac.reve) }, |       forceCarac: { 'reve': duplicate(actorData.data.carac.reve) }, | ||||||
| @@ -2028,6 +2031,7 @@ export class RdDActor extends Actor { | |||||||
|     const dialog = await RdDRoll.create(this, rollData, |     const dialog = await RdDRoll.create(this, rollData, | ||||||
|       { |       { | ||||||
|         html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-sort.html', |         html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-sort.html', | ||||||
|  |         options: { height: 600 }, | ||||||
|         close: html => { this.currentTMR.maximize() } // Re-display TMR |         close: html => { this.currentTMR.maximize() } // Re-display TMR | ||||||
|       }, |       }, | ||||||
|       { |       { | ||||||
| @@ -2035,17 +2039,9 @@ export class RdDActor extends Actor { | |||||||
|         label: 'Lancer un sort', |         label: 'Lancer un sort', | ||||||
|         callbacks: [ |         callbacks: [ | ||||||
|           this.createCallbackExperience(), |           this.createCallbackExperience(), | ||||||
|           { action: r => this._rollUnSortResult(r, false) } |           { action: r => this._rollUnSortResult(r) } | ||||||
|         ] |         ] | ||||||
|       }, |       } | ||||||
|       { |  | ||||||
|         name: 'mettre-en-reserve', |  | ||||||
|         label: 'Mettre un sort en réserve', |  | ||||||
|         callbacks: [ |  | ||||||
|           this.createCallbackExperience(), |  | ||||||
|           { action: r => this._rollUnSortResult(r, true) } |  | ||||||
|         ] |  | ||||||
|       }, |  | ||||||
|     ); |     ); | ||||||
|     dialog.render(true); |     dialog.render(true); | ||||||
|   } |   } | ||||||
| @@ -2095,17 +2091,11 @@ export class RdDActor extends Actor { | |||||||
|   } |   } | ||||||
|  |  | ||||||
|   /* -------------------------------------------- */ |   /* -------------------------------------------- */ | ||||||
|   async _rollUnSortResult(rollData, isSortReserve = false) { |   async _rollUnSortResult(rollData) { | ||||||
|     let rolled = rollData.rolled; |     let rolled = rollData.rolled; | ||||||
|     let selectedSort = rollData.selectedSort; |     let selectedSort = rollData.selectedSort; | ||||||
|     let closeTMR = !isSortReserve; |  | ||||||
|     if (selectedSort.data.isrituel && isSortReserve) { |  | ||||||
|       ui.notifications.error("Impossible de mettre le rituel '" + selectedSort.name + "' en réserve"); |  | ||||||
|       this.currentTMR.close(); // Close TMR ! |  | ||||||
|       return; |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     rollData.isSortReserve = isSortReserve; |     rollData.isSortReserve = rollData.mettreEnReserve && !selectedSort.data.isrituel; | ||||||
|     rollData.show = {} |     rollData.show = {} | ||||||
|     rollData.depenseReve = Number(selectedSort.data.ptreve_reel); |     rollData.depenseReve = Number(selectedSort.data.ptreve_reel); | ||||||
|  |  | ||||||
| @@ -2126,7 +2116,6 @@ export class RdDActor extends Actor { | |||||||
|  |  | ||||||
|         if (rollData.isSortReserve) { |         if (rollData.isSortReserve) { | ||||||
|           await this.sortMisEnReserve(rollData, selectedSort); |           await this.sortMisEnReserve(rollData, selectedSort); | ||||||
|           closeTMR = false; |  | ||||||
|         } |         } | ||||||
|       } |       } | ||||||
|       else { |       else { | ||||||
| @@ -2146,10 +2135,10 @@ export class RdDActor extends Actor { | |||||||
|     reveActuel = Math.max(reveActuel - rollData.depenseReve, 0); |     reveActuel = Math.max(reveActuel - rollData.depenseReve, 0); | ||||||
|     await this.update({ "data.reve.reve.value": reveActuel }); |     await this.update({ "data.reve.reve.value": reveActuel }); | ||||||
|  |  | ||||||
|     if (closeTMR) { |     if (rollData.isSortReserve) { | ||||||
|       this.currentTMR.close(); // Close TMR ! |  | ||||||
|     } else { |  | ||||||
|       this.currentTMR.maximize(); // Re-display TMR |       this.currentTMR.maximize(); // Re-display TMR | ||||||
|  |     } else { | ||||||
|  |       this.currentTMR.close(); // Close TMR ! | ||||||
|     } |     } | ||||||
|     // Final chat message |     // Final chat message | ||||||
|     RdDResolutionTable.displayRollData(rollData, this, 'chat-resultat-sort.html'); |     RdDResolutionTable.displayRollData(rollData, this, 'chat-resultat-sort.html'); | ||||||
| @@ -2320,7 +2309,7 @@ export class RdDActor extends Actor { | |||||||
|       { |       { | ||||||
|         oeuvre: oeuvre, |         oeuvre: oeuvre, | ||||||
|         art: oeuvre.type, |         art: oeuvre.type, | ||||||
|         competence: duplicate(Misc.data(this.getCompetence(oeuvre.data.competence ?? artData.art))), |         competence: duplicate(Misc.data(this.getCompetence(artData.compName ?? oeuvre.data.competence ?? artData.art))), | ||||||
|         diffLibre: - (oeuvre.data.niveau ?? 0), |         diffLibre: - (oeuvre.data.niveau ?? 0), | ||||||
|         diffConditions: 0, |         diffConditions: 0, | ||||||
|         use: { libre: false, conditions: true }, |         use: { libre: false, conditions: true }, | ||||||
| @@ -2402,8 +2391,8 @@ export class RdDActor extends Actor { | |||||||
|   async rollRecetteCuisine(id) { |   async rollRecetteCuisine(id) { | ||||||
|     const oeuvre = Misc.data(this.getRecetteCuisine(id)); |     const oeuvre = Misc.data(this.getRecetteCuisine(id)); | ||||||
|     const artData = { |     const artData = { | ||||||
|       art: 'cuisine', |  | ||||||
|       verbe: 'Cuisiner', |       verbe: 'Cuisiner', | ||||||
|  |       compName: 'cuisine', | ||||||
|       proportions: 1, |       proportions: 1, | ||||||
|       ajouterEquipement: false |       ajouterEquipement: false | ||||||
|     }; |     }; | ||||||
|   | |||||||
| @@ -15,8 +15,7 @@ export class DeDraconique extends Roll{ | |||||||
|   evaluate() { |   evaluate() { | ||||||
|     super.evaluate(); |     super.evaluate(); | ||||||
|     const rerolls = Math.ceil(this.total / 8); |     const rerolls = Math.ceil(this.total / 8); | ||||||
|     this.terms[this.terms.length - 1] = rerolls; |     this.terms[this.terms.length - 1].number = rerolls; | ||||||
|     this.results[this.results.length - 1] = rerolls; |  | ||||||
|     this._total -= rerolls; |     this._total -= rerolls; | ||||||
|     return this; |     return this; | ||||||
|   } |   } | ||||||
|   | |||||||
| @@ -1,7 +1,6 @@ | |||||||
| import { RollDataAjustements } from "./rolldata-ajustements.js"; | import { RollDataAjustements } from "./rolldata-ajustements.js"; | ||||||
| import { HtmlUtility } from "./html-utility.js"; | import { HtmlUtility } from "./html-utility.js"; | ||||||
| import { RdDItemCompetence } from "./item-competence.js"; | import { RdDItemCompetence } from "./item-competence.js"; | ||||||
| import { RdDItemMeditation } from "./item-meditation.js"; |  | ||||||
| import { RdDItemSort } from "./item-sort.js"; | import { RdDItemSort } from "./item-sort.js"; | ||||||
| import { Misc } from "./misc.js"; | import { Misc } from "./misc.js"; | ||||||
| import { RdDBonus } from "./rdd-bonus.js"; | import { RdDBonus } from "./rdd-bonus.js"; | ||||||
| @@ -169,7 +168,8 @@ export class RdDRoll extends Dialog { | |||||||
|         $("#carac").val(defaut_carac); |         $("#carac").val(defaut_carac); | ||||||
|       } |       } | ||||||
|       if (rollData.selectedSort) { |       if (rollData.selectedSort) { | ||||||
|         $("#draconic").val(rollData.selectedSort.data.listIndex); // Uniquement a la selection du sort, pour permettre de changer  |         dialog.setSelectedSort(rollData.selectedSort); | ||||||
|  |         $(".draconic").val(rollData.selectedSort.data.listIndex); // Uniquement a la selection du sort, pour permettre de changer  | ||||||
|       } |       } | ||||||
|       RdDItemSort.setCoutReveReel(rollData.selectedSort); |       RdDItemSort.setCoutReveReel(rollData.selectedSort); | ||||||
|       $("#diffLibre").val(Misc.toInt(rollData.diffLibre)); |       $("#diffLibre").val(Misc.toInt(rollData.diffLibre)); | ||||||
| @@ -194,20 +194,16 @@ export class RdDRoll extends Dialog { | |||||||
|       this.rollData.selectedCarac = this.rollData.carac[caracKey]; // Update the selectedCarac |       this.rollData.selectedCarac = this.rollData.carac[caracKey]; // Update the selectedCarac | ||||||
|       this.updateRollResult(); |       this.updateRollResult(); | ||||||
|     }); |     }); | ||||||
|     html.find('#draconic').change((event) => { |     html.find('.roll-draconic').change((event) => { | ||||||
|       let draconicKey = Misc.toInt(event.currentTarget.value); |       let draconicKey = Misc.toInt(event.currentTarget.value); | ||||||
|       this.rollData.competence = this.rollData.draconicList[draconicKey]; // Update the selectedCarac |       this.rollData.competence = this.rollData.draconicList[draconicKey]; // Update the selectedCarac | ||||||
|       this.updateRollResult(); |       this.updateRollResult(); | ||||||
|     }); |     }); | ||||||
|     html.find('#sort').change((event) => { |     html.find('.roll-sort').change((event) => { | ||||||
|       let sortKey = Misc.toInt(event.currentTarget.value); |       let sortKey = Misc.toInt(event.currentTarget.value); | ||||||
|       this.rollData.selectedSort = this.rollData.sortList[sortKey]; // Update the selectedCarac |       this.setSelectedSort(this.rollData.sortList[sortKey]); | ||||||
|       this.rollData.bonus = RdDItemSort.getCaseBonus(this.rollData.selectedSort, this.rollData.tmr.coord); |  | ||||||
|       this.rollData.diffLibre = RdDItemSort.getDifficulte(this.rollData.selectedSort, -7) |  | ||||||
|       RdDItemSort.setCoutReveReel(this.rollData.selectedSort); |  | ||||||
|       $("#draconic").val(this.rollData.selectedSort.data.listIndex); // Uniquement a la selection du sort, pour permettre de changer  |  | ||||||
|       $("#diffLibre").val(this.rollData.diffLibre); |  | ||||||
|       this.updateRollResult(); |       this.updateRollResult(); | ||||||
|  |       $("#diffLibre").val(this.rollData.diffLibre); | ||||||
|     }); |     }); | ||||||
|     html.find('#ptreve-variable').change((event) => { |     html.find('#ptreve-variable').change((event) => { | ||||||
|       let ptreve = Misc.toInt(event.currentTarget.value); |       let ptreve = Misc.toInt(event.currentTarget.value); | ||||||
| @@ -257,6 +253,29 @@ export class RdDRoll extends Dialog { | |||||||
|     }); |     }); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   async setSelectedSort(sort) { | ||||||
|  |     this.rollData.selectedSort = sort; // Update the selectedCarac | ||||||
|  |     this.rollData.competence = RdDItemCompetence.getVoieDraconic(this.rollData.draconicList, sort.data.draconic); | ||||||
|  |     this.rollData.bonus = RdDItemSort.getCaseBonus(sort, this.rollData.tmr.coord); | ||||||
|  |     this.rollData.diffLibre = RdDItemSort.getDifficulte(sort, -7); | ||||||
|  |     RdDItemSort.setCoutReveReel(sort); | ||||||
|  |     const htmlSortDescription = await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/partial-description-sort.html", { sort: sort }); | ||||||
|  |     $(".sort-ou-rituel").text(sort.data.isrituel ? "rituel" : "sort"); | ||||||
|  |     $(".bonus-case").text(`${this.rollData.bonus}%`); | ||||||
|  |     $(".details-sort").remove(); | ||||||
|  |     $(".description-sort").append(htmlSortDescription); | ||||||
|  |     $(".roll-draconic").val(sort.data.listIndex); | ||||||
|  |     $(".div-sort-difficulte-fixe").text(Misc.toSignedString(sort.data.difficulte)); | ||||||
|  |     $(".div-sort-ptreve-fixe").text(sort.data.ptreve); | ||||||
|  |     const diffVariable = RdDItemSort.isDifficulteVariable(sort); | ||||||
|  |     const coutVariable = RdDItemSort.isCoutVariable(sort); | ||||||
|  |     HtmlUtility._showControlWhen($(".div-sort-non-rituel"), !sort.data.isrituel); | ||||||
|  |     HtmlUtility._showControlWhen($(".div-sort-difficulte-var"), diffVariable); | ||||||
|  |     HtmlUtility._showControlWhen($(".div-sort-difficulte-fixe"), !diffVariable); | ||||||
|  |     HtmlUtility._showControlWhen($(".div-sort-ptreve-var"), coutVariable); | ||||||
|  |     HtmlUtility._showControlWhen($(".div-sort-ptreve-fixe"), !coutVariable); | ||||||
|  |   } | ||||||
|  |  | ||||||
|   /* -------------------------------------------- */ |   /* -------------------------------------------- */ | ||||||
|   async updateRollResult() { |   async updateRollResult() { | ||||||
|     let rollData = this.rollData; |     let rollData = this.rollData; | ||||||
| @@ -270,11 +289,6 @@ export class RdDRoll extends Dialog { | |||||||
|     if (rollData.coupsNonMortels) { |     if (rollData.coupsNonMortels) { | ||||||
|       dmgText = `(${dmgText}) non-mortel` |       dmgText = `(${dmgText}) non-mortel` | ||||||
|     } |     } | ||||||
|     if (rollData.selectedSort) { |  | ||||||
|       rollData.bonus = RdDItemSort.getCaseBonus(rollData.selectedSort, rollData.tmr.coord); |  | ||||||
|       HtmlUtility._showControlWhen($("#div-sort-difficulte"), RdDItemSort.isDifficulteVariable(rollData.selectedSort)) |  | ||||||
|       HtmlUtility._showControlWhen($("#div-sort-ptreve"), RdDItemSort.isCoutVariable(rollData.selectedSort)) |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     RollDataAjustements.calcul(rollData, this.actor); |     RollDataAjustements.calcul(rollData, this.actor); | ||||||
|     rollData.finalLevel = this._computeFinalLevel(rollData); |     rollData.finalLevel = this._computeFinalLevel(rollData); | ||||||
|   | |||||||
| @@ -157,6 +157,8 @@ export class RdDUtility { | |||||||
|       'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-alchimie.html', |       'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-alchimie.html', | ||||||
|       'systems/foundryvtt-reve-de-dragon/templates/dialog-astrologie-joueur.html', |       'systems/foundryvtt-reve-de-dragon/templates/dialog-astrologie-joueur.html', | ||||||
|       // Partials |       // Partials | ||||||
|  |       'systems/foundryvtt-reve-de-dragon/templates/partial-description-overflow.html', | ||||||
|  |       'systems/foundryvtt-reve-de-dragon/templates/partial-description-sort.html', | ||||||
|       'systems/foundryvtt-reve-de-dragon/templates/partial-roll-ajustements.html', |       'systems/foundryvtt-reve-de-dragon/templates/partial-roll-ajustements.html', | ||||||
|       'systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffLibre.html', |       'systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffLibre.html', | ||||||
|       'systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffCondition.html', |       'systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffCondition.html', | ||||||
|   | |||||||
| @@ -447,6 +447,16 @@ table {border: 1px solid #7a7971;} | |||||||
|   font-size: 0.70rem; |   font-size: 0.70rem; | ||||||
|   text-align: right; |   text-align: right; | ||||||
| } | } | ||||||
|  | .poesie-overflow { | ||||||
|  |   color: rgba(82, 17, 131, 0.9); | ||||||
|  |   max-height: 2.5rem; | ||||||
|  |   overflow: hidden; | ||||||
|  | } | ||||||
|  | .poesie-overflow:hover { | ||||||
|  |   max-height: unset; | ||||||
|  |   overflow: visible; | ||||||
|  | } | ||||||
|  |  | ||||||
| /* ======================================== */ | /* ======================================== */ | ||||||
| /* Sheet  */ | /* Sheet  */ | ||||||
| .window-app.sheet .window-content .sheet-header{ | .window-app.sheet .window-content .sheet-header{ | ||||||
|   | |||||||
| @@ -15,10 +15,8 @@ | |||||||
|     </div> |     </div> | ||||||
|   </div>   |   </div>   | ||||||
|    |    | ||||||
|   <div id="tableResolution"> |   <div id="tableResolution"></div> | ||||||
|   </div> |   <div id="tableProbaReussite"></div> | ||||||
|   <div id="tableProbaReussite"> |  | ||||||
|   </div> |  | ||||||
| </form> | </form> | ||||||
|  |  | ||||||
| <script> | <script> | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|         <label>Caractéristique: </label><label class="flex-grow">{{selectedCarac.label}}</label> |         <label>Caractéristique: </label><label class="flex-grow">{{selectedCarac.label}}</label> | ||||||
|         <label>{{competence.name}}:</label><label class="flex-grow">{{numberFormat competence.data.niveau decimals=0 sign=true}}</label></label> |         <label>{{competence.name}}:</label><label class="flex-grow">{{numberFormat competence.data.niveau decimals=0 sign=true}}</label></label> | ||||||
|       </div> |       </div> | ||||||
|       {{> "systems/foundryvtt-reve-de-dragon/templates/chat-poesie.html" oeuvre.data}} |       {{> "systems/foundryvtt-reve-de-dragon/templates/partial-description-overflow.html" oeuvre.data}} | ||||||
|     </div> |     </div> | ||||||
|     <div class="flex-group-left"> |     <div class="flex-group-left"> | ||||||
|       <div class="flexrow"> |       <div class="flexrow"> | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|         <label for="carac">Caractéristique:</label>{{>"systems/foundryvtt-reve-de-dragon/templates/partial-select-carac.html"}} |         <label for="carac">Caractéristique:</label>{{>"systems/foundryvtt-reve-de-dragon/templates/partial-select-carac.html"}} | ||||||
|         <label>{{competence.name}}:</label><label class="flex-grow">{{numberFormat competence.data.niveau decimals=0 sign=true}}</label></label> |         <label>{{competence.name}}:</label><label class="flex-grow">{{numberFormat competence.data.niveau decimals=0 sign=true}}</label></label> | ||||||
|       </div> |       </div> | ||||||
|       {{> "systems/foundryvtt-reve-de-dragon/templates/chat-poesie.html" oeuvre.data}} |       {{> "systems/foundryvtt-reve-de-dragon/templates/partial-description-overflow.html" oeuvre.data}} | ||||||
|     </div> |     </div> | ||||||
|     <div class="flex-group-left"> |     <div class="flex-group-left"> | ||||||
|       <div class="flexrow"> |       <div class="flexrow"> | ||||||
|   | |||||||
| @@ -18,7 +18,7 @@ | |||||||
|       <div id="tableAjustements" class="flexrow"></div> |       <div id="tableAjustements" class="flexrow"></div> | ||||||
|     </div> |     </div> | ||||||
|   </div> |   </div> | ||||||
|   {{> "systems/foundryvtt-reve-de-dragon/templates/chat-poesie.html" oeuvre.data}} |   {{> "systems/foundryvtt-reve-de-dragon/templates/partial-description-overflow.html" oeuvre.data}} | ||||||
|  |  | ||||||
|   <div id="tableResolution"></div> |   <div id="tableResolution"></div> | ||||||
|   <div id="tableProbaReussite"></div> |   <div id="tableProbaReussite"></div> | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ | |||||||
|         <label>Caractéristique: </label><label class="flex-grow">{{selectedCarac.label}}</label> |         <label>Caractéristique: </label><label class="flex-grow">{{selectedCarac.label}}</label> | ||||||
|         <label>{{competence.name}}:</label><label class="flex-grow">{{numberFormat competence.data.niveau decimals=0 sign=true}}</label></label> |         <label>{{competence.name}}:</label><label class="flex-grow">{{numberFormat competence.data.niveau decimals=0 sign=true}}</label></label> | ||||||
|       </div> |       </div> | ||||||
|       {{> "systems/foundryvtt-reve-de-dragon/templates/chat-poesie.html" oeuvre.data}} |       {{> "systems/foundryvtt-reve-de-dragon/templates/partial-description-overflow.html" oeuvre.data}} | ||||||
|     </div> |     </div> | ||||||
|     <div class="flex-group-left"> |     <div class="flex-group-left"> | ||||||
|       <div class="flexrow"> |       <div class="flexrow"> | ||||||
|   | |||||||
| @@ -9,7 +9,7 @@ | |||||||
|         </label> |         </label> | ||||||
|         <label>{{competence.name}}:</label><label class="flex-grow">{{numberFormat competence.data.niveau decimals=0 sign=true}}</label></label> |         <label>{{competence.name}}:</label><label class="flex-grow">{{numberFormat competence.data.niveau decimals=0 sign=true}}</label></label> | ||||||
|       </div> |       </div> | ||||||
|       {{> "systems/foundryvtt-reve-de-dragon/templates/chat-poesie.html" oeuvre.data}} |       {{> "systems/foundryvtt-reve-de-dragon/templates/partial-description-overflow.html" oeuvre.data}} | ||||||
|     </div> |     </div> | ||||||
|     <div class="flex-group-left"> |     <div class="flex-group-left"> | ||||||
|       <div class="flexrow"> |       <div class="flexrow"> | ||||||
|   | |||||||
| @@ -1,9 +1,5 @@ | |||||||
| <form class="rdddialog"> | <form class="rdddialog"> | ||||||
|   <h2 class="tooltip" style="width: 100%;">Cuisiner: {{oeuvre.name}} |   <h2>Cuisiner: {{oeuvre.name}}</h2> | ||||||
|     <div class="tooltiptext ttt-titre"> |  | ||||||
|       {{> "systems/foundryvtt-reve-de-dragon/templates/chat-poesie.html" oeuvre.data}} |  | ||||||
|     </div> |  | ||||||
|   </h2> |  | ||||||
|      |      | ||||||
|   <div class="grid grid-2col"> |   <div class="grid grid-2col"> | ||||||
|     <div class="flex-group-left"> |     <div class="flex-group-left"> | ||||||
| @@ -38,7 +34,7 @@ | |||||||
|       <div id="tableAjustements" class="flexrow"></div> |       <div id="tableAjustements" class="flexrow"></div> | ||||||
|     </div> |     </div> | ||||||
|   </div> |   </div> | ||||||
|  |   {{> "systems/foundryvtt-reve-de-dragon/templates/partial-description-overflow.html" oeuvre.data}} | ||||||
|   <div id="tableResolution"></div> |   <div id="tableResolution"></div> | ||||||
|   <div id="tableProbaReussite"></div> |   <div id="tableProbaReussite"></div> | ||||||
| </form> | </form> | ||||||
|   | |||||||
| @@ -1,12 +1,27 @@ | |||||||
| <form class="skill-roll-dialog"> | <form class="skill-roll-dialog"> | ||||||
|   <h2>Rêve de Dragon de force {{rencontre.force}}!</h2> |   <h2>Rêve de Dragon de force {{rencontre.force}}!</h2> | ||||||
|   <div class="form-group"> |   <div class="grid grid-2col"> | ||||||
|  |     <div class="flex-group-left"> | ||||||
|  |       <img class="chat-icon" src="{{competence.img}}" alt="{{competence.name}}"/> | ||||||
|  |       <div class="grid grid-2col"> | ||||||
|  |         <label for="carac">Rêve actuel:</label><label class="flex-grow" name="carac">{{selectedCarac.value}}</label> | ||||||
|  |         <label for="competence">{{competence.name}}:</label><label class="flex-grow" name="competence">{{numberFormat competence.data.niveau decimals=0 sign=true}}</label> | ||||||
|  |       </div> | ||||||
|  |     </div> | ||||||
|  |     <div class="flex-group-left"> | ||||||
|  |       <div class="flexrow"> | ||||||
|  |         <label>Difficulté</label> | ||||||
|  |         <label>{{numberFormat diffLibre decimals=0 sign=true}}</label> | ||||||
|  |       </div> | ||||||
|  |       {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffCondition.html"}} | ||||||
|  |       <div id="tableAjustements" class="flexrow"></div> | ||||||
|  |     </div> | ||||||
|   </div> |   </div> | ||||||
|   <div id="tableAjustements"></div> |  | ||||||
|   <div id="tableResolution"></div> |   <div id="tableResolution"></div> | ||||||
|   <div id="tableProbaReussite"></div> |   <div id="tableProbaReussite"></div> | ||||||
|   </form> | </form> | ||||||
|    |    | ||||||
|   <script> | <script> | ||||||
|   </script> | </script> | ||||||
|    |    | ||||||
| @@ -1,63 +1,77 @@ | |||||||
|  | {{log 'lancer de sort' this}} | ||||||
| <form class="dialog-roll-sort"> | <form class="dialog-roll-sort"> | ||||||
|   <div class="form-group"> |   <h2>Lancer le <span class="sort-ou-rituel">{{#if sort.data.isrituel}}rituel{{else}}sort{{/if}}</span>: | ||||||
|     <label>Rêve : <label>{{numberFormat selectedCarac.value decimals=0 sign=false}}</label></label> |     <select name="sort" class="roll-sort flex-grow" data-dtype="String"> | ||||||
|     <label>TMR : {{tmr.label}} ({{tmr.coord}})</label> |       {{#select sort}} | ||||||
|   </div> |       {{#each sortList as |sort key|}} | ||||||
|  |       <option value={{key}}>{{this.name}} - {{#if this.data.caseTMRspeciale}} {{this.data.caseTMRspeciale}} | ||||||
|   <div class="form-group"> |         {{else}}{{this.data.caseTMR}}{{/if}} / R{{this.data.difficulte}} r {{sort.data.ptreve}} ({{sort.data.draconic}}) | ||||||
|     <label>Draconic </label> |       </option> | ||||||
|     <select name="draconic" id="draconic" data-dtype="String"> |  | ||||||
|         {{#select draconic}} |  | ||||||
|         {{#each draconicList as |draconic key|}} |  | ||||||
|         <option value={{key}}>{{draconic.name}} : {{draconic.data.niveau}}</option> |  | ||||||
|         {{/each}} |  | ||||||
|         {{/select}} |  | ||||||
|     </select> |  | ||||||
|     <label>  Conditions</label> |  | ||||||
|     <select name="diffConditions" id="diffConditions" data-dtype="number"> |  | ||||||
|         {{#select diffConditions}} |  | ||||||
|         {{#each ajustementsConditions as |key|}} |  | ||||||
|         <option value={{key}}>{{numberFormat key decimals=0 sign=true}}</option> |  | ||||||
|         {{/each}} |  | ||||||
|         {{/select}} |  | ||||||
|     </select> |  | ||||||
|   </div> |  | ||||||
|  |  | ||||||
|   <div class="form-group"> |  | ||||||
|     <label>Sort </label> |  | ||||||
|     <select name="sort" id="sort" data-dtype="String"> |  | ||||||
|         {{#select sort}} |  | ||||||
|         {{#each sortList as |sort key|}} |  | ||||||
|         <option value={{key}}>{{this.name}} - {{#if this.data.caseTMRspeciale}} {{this.data.caseTMRspeciale}} {{else}}{{this.data.caseTMR}}{{/if}} / R{{this.data.difficulte}} r {{sort.data.ptreve}} ({{sort.data.draconic}})</option> |  | ||||||
|         {{/each}} |  | ||||||
|         {{/select}} |  | ||||||
|     </select> |  | ||||||
|   </div> |  | ||||||
|  |  | ||||||
|   <div class="form-group" id="div-sort-difficulte"> |  | ||||||
|     <label>Difficulté </label> |  | ||||||
|     <select name="diffLibre" id="diffLibre" data-dtype="number"> |  | ||||||
|       {{#select diffLibre}} |  | ||||||
|       {{#each difficultesLibres  as |key|}} |  | ||||||
|       <option value={{key}}>{{numberFormat key decimals=0 sign=true}}</option> |  | ||||||
|       {{/each}} |  | ||||||
|     {{/select}} |  | ||||||
|     </select> |  | ||||||
|   </div> |  | ||||||
|  |  | ||||||
|   <div class="form-group" id="div-sort-ptreve"> |  | ||||||
|     <label>Couts en Points de Rêve </label> |  | ||||||
|     <select name="ptreve-variable" id="ptreve-variable" data-dtype="number"> |  | ||||||
|       {{#select ptreve-variable}} |  | ||||||
|       {{#each coutreve as |cout key|}} |  | ||||||
|       <option value={{cout}}>{{cout}}</option> |  | ||||||
|       {{/each}} |       {{/each}} | ||||||
|       {{/select}} |       {{/select}} | ||||||
|     </select> |     </select> | ||||||
|  |   </h2> | ||||||
|  |   <img class="chat-icon" src="{{competence.img}}" alt="{{competence.name}}" /> | ||||||
|  |   <div class="grid grid-2col"> | ||||||
|  |     <div class="flex-group-left"> | ||||||
|  |       <div class="flexrow"> | ||||||
|  |         <label for="tmr">TMR - {{tmr.coord}}:</label><label name="tmr">{{tmr.label}}</label> | ||||||
|  |       </div> | ||||||
|  |       <div class="flexrow"> | ||||||
|  |         <label for="carac">Rêve:</label><label name="carac">{{selectedCarac.value}}</label> | ||||||
|  |       </div> | ||||||
|  |       <div class="flexrow"> | ||||||
|  |         <label for="ptreve-variable">Points de Rêve: </label> | ||||||
|  |         <select name="ptreve-variable" class="div-sort-ptreve-var" id="ptreve-variable" data-dtype="number"> | ||||||
|  |           {{#select ptreve-variable}} | ||||||
|  |           {{#each coutreve as |cout key|}} | ||||||
|  |           <option value={{cout}}>{{cout}}</option> | ||||||
|  |           {{/each}} | ||||||
|  |           {{/select}} | ||||||
|  |         </select> | ||||||
|  |         <label class="div-sort-ptreve-fixe">{{selectedSort.data.ptreve}}</select> | ||||||
|  |       </div> | ||||||
|  |       <div class="flexrow div-sort-non-rituel"> | ||||||
|  |         <label>Mettre en réserve</label> | ||||||
|  |         <input class="checkbox-by-name" type="checkbox" name="mettreEnReserve" {{#if mettreEnReserve}}checked{{/if}} /> | ||||||
|  |       </div> | ||||||
|  |     </div> | ||||||
|  |     <div class="flex-group-left"> | ||||||
|  |       <div class="flexrow"> | ||||||
|  |         <label for="competence">Draconic:</label> | ||||||
|  |         <select name="competence" class="roll-draconic" data-dtype="String"> | ||||||
|  |           {{#select draconic}} | ||||||
|  |           {{#each draconicList as |draconic key|}} | ||||||
|  |           <option value={{key}}>{{draconic.name}} : {{numberFormat draconic.data.niveau decimals=0 sign=true}} | ||||||
|  |           </option> | ||||||
|  |           {{/each}} | ||||||
|  |           {{/select}} | ||||||
|  |         </select> | ||||||
|  |       </div> | ||||||
|  |       <div class="flexrow"> | ||||||
|  |         <label for="diffLibre">Difficulté </label> | ||||||
|  |         <select name="diffLibre" class="div-sort-difficulte-var" id="diffLibre" data-dtype="number"> | ||||||
|  |           {{#select diffLibre}} | ||||||
|  |           {{#each difficultesLibres as |key|}} | ||||||
|  |           <option value={{key}}>{{numberFormat key decimals=0 sign=true}}</option> | ||||||
|  |           {{/each}} | ||||||
|  |           {{/select}} | ||||||
|  |         </select> | ||||||
|  |         <label class="div-sort-difficulte-fixe">{{numberFormat selectedSort.data.difficulte decimals=0 sign=true}}</label> | ||||||
|  |       </div> | ||||||
|  |       {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffCondition.html"}} | ||||||
|  |       <div class="flexrow"> | ||||||
|  |         <label for="bonus-case">Bonus de case </label> | ||||||
|  |         <label name="bonus-case" class="bonus-case">0%</label> | ||||||
|  |       </div> | ||||||
|  |       <div id="tableAjustements" class="flexrow"></div> | ||||||
|  |     </div> | ||||||
|  |   </div> | ||||||
|  |   <div class="description-sort"> | ||||||
|  |     <hr> | ||||||
|  |     {{> "systems/foundryvtt-reve-de-dragon/templates/partial-description-sort.html" sort=selectedSort}} | ||||||
|   </div> |   </div> | ||||||
|  |  | ||||||
|   <div id="tableAjustements"> |  | ||||||
|   </div> |  | ||||||
|   <div id="tableResolution"></div> |   <div id="tableResolution"></div> | ||||||
|   <div id="tableProbaReussite"></div> |   <div id="tableProbaReussite"></div> | ||||||
| </form> | </form> | ||||||
|   | |||||||
							
								
								
									
										8
									
								
								templates/partial-description-overflow.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								templates/partial-description-overflow.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | |||||||
|  | {{#if (or description reference)}} | ||||||
|  | <div class="poesie-extrait poesie-overflow"> | ||||||
|  |   {{{description}}} | ||||||
|  |   {{#if reference}} | ||||||
|  |   <p class="poesie-reference">{{reference}}</p> | ||||||
|  |   {{/if}} | ||||||
|  | </div> | ||||||
|  | {{/if}} | ||||||
							
								
								
									
										10
									
								
								templates/partial-description-sort.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								templates/partial-description-sort.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,10 @@ | |||||||
|  | <div class="flex-group-left details-sort"> | ||||||
|  |   {{#if sort.data.cible}}<label><strong>Cible</strong>: {{sort.data.cible}}  </label>{{/if}} | ||||||
|  |   {{#if sort.data.JR}}<label><strong>JR</strong>: {{sort.data.JR}}  </label>{{/if}} | ||||||
|  |   {{#if sort.data.portee}}<label><strong>Portée</strong>: {{sort.data.portée}}  </label>{{/if}} | ||||||
|  |   {{#if sort.data.duree}}<label><strong>Durée</strong>: {{sort.data.duree}}  </label>{{/if}} | ||||||
|  |   {{#if sort.data.coutseuil}}<label><strong>Coût de seuil</strong>: {{sort.data.coutseuil}}</label>{{/if}} | ||||||
|  | </div> | ||||||
|  | <div class="details-sort"> | ||||||
|  |   {{> "systems/foundryvtt-reve-de-dragon/templates/partial-description-overflow.html" sort.data}} | ||||||
|  | </div> | ||||||
		Reference in New Issue
	
	Block a user