Fix: Correction du libellé Coût en Âme et ajout de la catégorie Balance
- Correction du libellé 'Coût en Âme' en 'Coût en points de pouvoir' pour les runes - Fix: Ajout des gestionnaires d'événements pour les automatisations des Talents - Ajout des actions addAutomation et deleteAutomation dans base-item-sheet.mjs - Ajout des attributs data-action sur les boutons du template partial-automation.hbs - Ajout des attributs name sur les champs d'automatisation pour la sauvegarde - Ajout de la catégorie 'Balance' dans les options d'allégeance pour Dons et Tendances Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
@@ -32,6 +32,7 @@
|
|||||||
"MNBL": {
|
"MNBL": {
|
||||||
"all": "Tous",
|
"all": "Tous",
|
||||||
"allegiance": "Allégeance",
|
"allegiance": "Allégeance",
|
||||||
|
"balance": "Balance",
|
||||||
"beastslords": "Seigneurs des Bêtes",
|
"beastslords": "Seigneurs des Bêtes",
|
||||||
"chaos": "Chaos",
|
"chaos": "Chaos",
|
||||||
"difficulty": "Difficulté",
|
"difficulty": "Difficulté",
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ export default class MournbladeCYD2ItemSheetV2 extends HandlebarsApplicationMixi
|
|||||||
postItem: MournbladeCYD2ItemSheetV2.#onPostItem,
|
postItem: MournbladeCYD2ItemSheetV2.#onPostItem,
|
||||||
addPredilection: MournbladeCYD2ItemSheetV2.#onAddPredilection,
|
addPredilection: MournbladeCYD2ItemSheetV2.#onAddPredilection,
|
||||||
deletePredilection: MournbladeCYD2ItemSheetV2.#onDeletePredilection,
|
deletePredilection: MournbladeCYD2ItemSheetV2.#onDeletePredilection,
|
||||||
|
addAutomation: MournbladeCYD2ItemSheetV2.#onAddAutomation,
|
||||||
|
deleteAutomation: MournbladeCYD2ItemSheetV2.#onDeleteAutomation,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -139,4 +141,34 @@ export default class MournbladeCYD2ItemSheetV2 extends HandlebarsApplicationMixi
|
|||||||
preds.splice(idx, 1);
|
preds.splice(idx, 1);
|
||||||
await this.document.update({ "system.predilections": preds });
|
await this.document.update({ "system.predilections": preds });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
static async #onAddAutomation(event) {
|
||||||
|
const automations = foundry.utils.duplicate(this.document.system.automations || []);
|
||||||
|
automations.push({
|
||||||
|
id: foundry.utils.randomID(),
|
||||||
|
eventtype: "on-drop",
|
||||||
|
name: "",
|
||||||
|
bonusname: "vigueur",
|
||||||
|
bonus: 0,
|
||||||
|
competence: "",
|
||||||
|
minLevel: 0,
|
||||||
|
baCost: 0
|
||||||
|
});
|
||||||
|
await this.document.update({
|
||||||
|
"system.automations": automations,
|
||||||
|
"system.isautomated": true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
static async #onDeleteAutomation(event, target) {
|
||||||
|
const idx = Number(target.dataset.automationIndex);
|
||||||
|
const automations = foundry.utils.duplicate(this.document.system.automations || []);
|
||||||
|
automations.splice(idx, 1);
|
||||||
|
await this.document.update({ "system.automations": automations });
|
||||||
|
if (automations.length === 0) {
|
||||||
|
await this.document.update({ "system.isautomated": false });
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ export const MOURNBLADECYD2_CONFIG = {
|
|||||||
tous: localizeOrFallback("MNBL.all", "Tous"),
|
tous: localizeOrFallback("MNBL.all", "Tous"),
|
||||||
chaos: localizeOrFallback("MNBL.chaos", "Chaos"),
|
chaos: localizeOrFallback("MNBL.chaos", "Chaos"),
|
||||||
loi: localizeOrFallback("MNBL.law", "Loi"),
|
loi: localizeOrFallback("MNBL.law", "Loi"),
|
||||||
|
balance: localizeOrFallback("MNBL.balance", "Balance"),
|
||||||
betes: localizeOrFallback("MNBL.beastslords", "Seigneurs des Bêtes"),
|
betes: localizeOrFallback("MNBL.beastslords", "Seigneurs des Bêtes"),
|
||||||
elementaires: localizeOrFallback("MNBL.elementslords", "Seigneurs des Éléments")
|
elementaires: localizeOrFallback("MNBL.elementslords", "Seigneurs des Éléments")
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -13,13 +13,13 @@
|
|||||||
<li class="automation-item item flexrow" data-automation-field="eventtype" data-automation-index="{{key}}">
|
<li class="automation-item item flexrow" data-automation-field="eventtype" data-automation-index="{{key}}">
|
||||||
<label class="generic-label item-field-label-medium">Evènement</label>
|
<label class="generic-label item-field-label-medium">Evènement</label>
|
||||||
<select class="item-field-label-long automation-edit-field" type="text" data-automation-index="{{key}}" data-automation-field="eventtype"
|
<select class="item-field-label-long automation-edit-field" type="text" data-automation-index="{{key}}" data-automation-field="eventtype"
|
||||||
value="{{automation.eventtype}}" data-dtype="String">
|
name="system.automations.{{key}}.eventtype" value="{{automation.eventtype}}" data-dtype="String">
|
||||||
{{selectOptions @root.config.optionsAutomationEvent selected=automation.eventtype valueAttr="key" nameAttr="key" labelAttr="label"}}
|
{{selectOptions @root.config.optionsAutomationEvent selected=automation.eventtype valueAttr="key" nameAttr="key" labelAttr="label"}}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<label class="generic-label item-field-label-medium"> </label>
|
<label class="generic-label item-field-label-medium"> </label>
|
||||||
|
|
||||||
<a class="item-control item-field-label-medium delete-automation" title="Supprimer" data-automation-index="{{key}}"><i
|
<a class="item-control item-field-label-medium delete-automation" title="Supprimer" data-automation-index="{{key}}" data-action="deleteAutomation"><i
|
||||||
class="fas fa-trash"></i></a>
|
class="fas fa-trash"></i></a>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
@@ -27,11 +27,11 @@
|
|||||||
{{#if (eq automation.eventtype "on-drop")}}
|
{{#if (eq automation.eventtype "on-drop")}}
|
||||||
<li class="automation-item item flexrow">
|
<li class="automation-item item flexrow">
|
||||||
<label class="generic-label item-field-label-long">Compétence/Attribut</label>
|
<label class="generic-label item-field-label-long">Compétence/Attribut</label>
|
||||||
<input type="text" class="item-field-label-medium automation-edit-field" data-automation-index="{{key}}" data-automation-field="competence" value="{{automation.competence}}" data-dtype="String" />
|
<input type="text" class="item-field-label-medium automation-edit-field" data-automation-index="{{key}}" data-automation-field="competence" name="system.automations.{{key}}.competence" value="{{automation.competence}}" data-dtype="String" />
|
||||||
</li>
|
</li>
|
||||||
<li class="automation-item item flexrow">
|
<li class="automation-item item flexrow">
|
||||||
<label class="generic-label item-field-label-long">Valeur minimum</label>
|
<label class="generic-label item-field-label-long">Valeur minimum</label>
|
||||||
<input type="text" class="item-field-label-medium automation-edit-field" data-automation-index="{{key}}" data-automation-field="minLevel" value="{{automation.minLevel}}" data-dtype="Number" />
|
<input type="text" class="item-field-label-medium automation-edit-field" data-automation-index="{{key}}" data-automation-field="minLevel" name="system.automations.{{key}}.minLevel" value="{{automation.minLevel}}" data-dtype="Number" />
|
||||||
</li>
|
</li>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
@@ -39,28 +39,28 @@
|
|||||||
<li class="automation-item item flexrow">
|
<li class="automation-item item flexrow">
|
||||||
<label class="generic-label item-field-label-long">Désignation</label>
|
<label class="generic-label item-field-label-long">Désignation</label>
|
||||||
<select class="item-field-label-long automation-edit-field" type="text" data-automation-index="{{key}}" data-automation-field="bonusname"
|
<select class="item-field-label-long automation-edit-field" type="text" data-automation-index="{{key}}" data-automation-field="bonusname"
|
||||||
value="{{automation.bonusname}}" data-dtype="String">
|
name="system.automations.{{key}}.bonusname" value="{{automation.bonusname}}" data-dtype="String">
|
||||||
{{selectOptions @root.config.optionsBonusPermanent selected=automation.bonusname valueAttr="key" nameAttr="key" labelAttr="label"}}
|
{{selectOptions @root.config.optionsBonusPermanent selected=automation.bonusname valueAttr="key" nameAttr="key" labelAttr="label"}}
|
||||||
</select>
|
</select>
|
||||||
</li>
|
</li>
|
||||||
<li class="automation-item item flexrow">
|
<li class="automation-item item flexrow">
|
||||||
<label class="generic-label item-field-label-long">Bonus</label>
|
<label class="generic-label item-field-label-long">Bonus</label>
|
||||||
<input type="text" class="item-field-label-medium automation-edit-field" data-automation-index="{{key}}" data-automation-field="bonus" value="{{automation.bonus}}" data-dtype="Number" />
|
<input type="text" class="item-field-label-medium automation-edit-field" data-automation-index="{{key}}" data-automation-field="bonus" name="system.automations.{{key}}.bonus" value="{{automation.bonus}}" data-dtype="Number" />
|
||||||
</li>
|
</li>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if (eq automation.eventtype "prepare-roll")}}
|
{{#if (eq automation.eventtype "prepare-roll")}}
|
||||||
<li class="automation-item item flexrow">
|
<li class="automation-item item flexrow">
|
||||||
<label class="generic-label item-field-label-long">Compétence/Attribut</label>
|
<label class="generic-label item-field-label-long">Compétence/Attribut</label>
|
||||||
<input type="text" class="item-field-label-medium automation-edit-field" data-automation-index="{{key}}" data-automation-field="competence" value="{{automation.competence}}" data-dtype="String" />
|
<input type="text" class="item-field-label-medium automation-edit-field" data-automation-index="{{key}}" data-automation-field="competence" name="system.automations.{{key}}.competence" value="{{automation.competence}}" data-dtype="String" />
|
||||||
</li>
|
</li>
|
||||||
<li class="automation-item item flexrow">
|
<li class="automation-item item flexrow">
|
||||||
<label class="generic-label item-field-label-long">Bonus</label>
|
<label class="generic-label item-field-label-long">Bonus</label>
|
||||||
<input type="text" class="item-field-label-medium automation-edit-field" data-automation-index="{{key}}" data-automation-field="bonus" value="{{automation.bonus}}" data-dtype="Number" />
|
<input type="text" class="item-field-label-medium automation-edit-field" data-automation-index="{{key}}" data-automation-field="bonus" name="system.automations.{{key}}.bonus" value="{{automation.bonus}}" data-dtype="Number" />
|
||||||
</li>
|
</li>
|
||||||
<li class="automation-item item flexrow">
|
<li class="automation-item item flexrow">
|
||||||
<label class="generic-label item-field-label-long">Coût en BA</label>
|
<label class="generic-label item-field-label-long">Coût en BA</label>
|
||||||
<input type="text" class="item-field-label-medium automation-edit-field" data-automation-index="{{key}}" data-automation-field="baCost" value="{{automation.baCost}}" data-dtype="Number" />
|
<input type="text" class="item-field-label-medium automation-edit-field" data-automation-index="{{key}}" data-automation-field="baCost" name="system.automations.{{key}}.baCost" value="{{automation.baCost}}" data-dtype="Number" />
|
||||||
</li>
|
</li>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
@@ -69,6 +69,6 @@
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<li class="flexrow item">
|
<li class="flexrow item">
|
||||||
<button id="add-automation" class="chat-card-button">Ajouter une automatisation</button>
|
<button id="add-automation" class="chat-card-button" data-action="addAutomation">Ajouter une automatisation</button>
|
||||||
</li>
|
</li>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
Reference in New Issue
Block a user