added check adv on drop

css for 20q
This commit is contained in:
Vlyan
2020-12-28 09:34:59 +01:00
parent be84785cb8
commit 84f346448d
5 changed files with 83 additions and 38 deletions

View File

@@ -87,7 +87,8 @@ export class BaseSheetL5r5e extends ActorSheet {
// Item subtype specific
switch (item.data.type) {
case "advancement":
case "advancement": // no break
case "peculiarity":
// Modify the bought at rank to the current actor rank
item.data.data.bought_at_rank = this.actor.data.data.identity.school_rank;
break;
@@ -107,6 +108,14 @@ export class BaseSheetL5r5e extends ActorSheet {
}).render(true);
return;
}
// Modify the bought at rank to the current actor rank
item.data.data.bought_at_rank = this.actor.data.data.identity.school_rank;
// Verify cost
item.data.data.xp_cost =
item.data.data.xp_cost > 0 ? item.data.data.xp_cost : CONFIG.l5r5e.xp.techniqueCost;
item.data.data.xp_used = item.data.data.xp_cost;
break;
}

View File

@@ -114,13 +114,6 @@ export class TwentyQuestionsDialog extends FormApplication {
return;
}
// Toggle
html.find(".toggle-on-click").on("click", (event) => {
const elmt = $(event.currentTarget).data("toggle");
const tgt = html.find("." + elmt);
tgt.hasClass("toggle-active") ? tgt.removeClass("toggle-active") : tgt.addClass("toggle-active");
});
// Delete a dnd element
html.find(`.property-delete`).on("click", (event) => {
const stepKey = $(event.currentTarget).parents(".tq-drag-n-drop").data("step");