Fix for Q13: "skill and disadv" OR "adv"

This commit is contained in:
Vlyan
2021-01-06 10:57:46 +01:00
parent c474015e5c
commit 0a1750de30
7 changed files with 24 additions and 15 deletions

View File

@@ -312,8 +312,10 @@ export class TwentyQuestionsDialog extends FormApplication {
// Check "Or" conditions
formData["step7.social_add_glory"] = formData["step7.skill"] === "none" ? 5 : 0;
formData["step8.social_add_honor"] = formData["step8.skill"] === "none" ? 10 : 0;
if (formData["step13.skill"] !== "none" && this.object.data.step13.advantage.length > 0) {
if (this.object.data.step13.advantage.length > 0) {
formData["step13.skill"] = "none";
setProperty(this.object.data, "step13.disadvantage", []);
}
// Update 20Q object data

View File

@@ -45,13 +45,12 @@ export class HelpDialog extends FormApplication {
super.activateListeners(html);
// Buttons
["edge", "drivethrurpg", "discord"].forEach((name) => {
html.find(`button[name='${name}']`).on("click", (event) => {
event.preventDefault();
event.stopPropagation();
ui.notifications.info(game.i18n.localize(`l5r5e.logo.${name}-info`));
window.open(game.i18n.localize(`l5r5e.logo.${name}-link`), "_blank");
});
html.find(`button`).on("click", (event) => {
event.preventDefault();
event.stopPropagation();
const name = $(event.currentTarget).data("type");
ui.notifications.info(game.i18n.localize(`l5r5e.logo.${name}-info`));
window.open(game.i18n.localize(`l5r5e.logo.${name}-link`), "_blank");
});
}