From 6d4c5b74dcf694d125967424af6b6e1312a4a5c6 Mon Sep 17 00:00:00 2001 From: trotFunky Date: Sun, 6 Jul 2025 21:48:18 +0100 Subject: [PATCH] Fortune: Fix indenting in character sheet code When moving this part of the code to a dedicated function, the IDE "helpfully" "fixed" the indentation, making the organization of this part of the code less clear. Re-introduce the indentation to make the structure clearer. --- scripts/fortune_integration.mjs | 46 ++++++++++++++++----------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/scripts/fortune_integration.mjs b/scripts/fortune_integration.mjs index dc92409..5a34984 100644 --- a/scripts/fortune_integration.mjs +++ b/scripts/fortune_integration.mjs @@ -67,30 +67,30 @@ function character_sheet_fortune(app, html) { let fortune_div = document.createElement("div") fortune_div.classList.add("flex-group-center", "resource-content") - let fortune_label = document.createElement("span") - fortune_label.classList.add("resource-label-l") - let fortune_icon = document.createElement("i") - fortune_icon.classList.add("fas", "fa-leaf", "icon") - fortune_label.appendChild(fortune_icon) - fortune_label.appendChild(document.createTextNode(game.i18n.localize('MF.Fortune.Name'))) + let fortune_label = document.createElement("span") + fortune_label.classList.add("resource-label-l") + let fortune_icon = document.createElement("i") + fortune_icon.classList.add("fas", "fa-leaf", "icon") + fortune_label.appendChild(fortune_icon) + fortune_label.appendChild(document.createTextNode(game.i18n.localize('MF.Fortune.Name'))) fortune_div.appendChild(fortune_label) - let fortune_data_div = document.createElement("div") - fortune_data_div.classList.add("buttons-inc") - let fortune_input = foundry.applications.fields.createNumberInput({ - /* - * By setting the name of the field using this format, the backing - * flag will automatically be picked up by Foundry's code and updated - * when the field is changed on the sheet. - * This works even if it wasn't set previously ! - */ - name: `flags.${MillsFabula.id}.${fortune_flag}`, - value: app.document.getFlag(MillsFabula.id, fortune_flag) ?? 0, - step: 1, - min: 0, - type: "number" - }) - fortune_input.classList.add("fp-resource-inputs") - fortune_data_div.appendChild(fortune_input) + let fortune_data_div = document.createElement("div") + fortune_data_div.classList.add("buttons-inc") + let fortune_input = foundry.applications.fields.createNumberInput({ + /* + * By setting the name of the field using this format, the backing + * flag will automatically be picked up by Foundry's code and updated + * when the field is changed on the sheet. + * This works even if it wasn't set previously ! + */ + name: `flags.${MillsFabula.id}.${fortune_flag}`, + value: app.document.getFlag(MillsFabula.id, fortune_flag) ?? 0, + step: 1, + min: 0, + type: "number" + }) + fortune_input.classList.add("fp-resource-inputs") + fortune_data_div.appendChild(fortune_input) fortune_div.appendChild(fortune_data_div) fortune_fabula_div.appendChild(fortune_div)