Compare commits

..

No commits in common. "main" and "release" have entirely different histories.

View file

@ -67,30 +67,30 @@ function character_sheet_fortune(app, html) {
let fortune_div = document.createElement("div") let fortune_div = document.createElement("div")
fortune_div.classList.add("flex-group-center", "resource-content") fortune_div.classList.add("flex-group-center", "resource-content")
let fortune_label = document.createElement("span") let fortune_label = document.createElement("span")
fortune_label.classList.add("resource-label-l") fortune_label.classList.add("resource-label-l")
let fortune_icon = document.createElement("i") let fortune_icon = document.createElement("i")
fortune_icon.classList.add("fas", "fa-leaf", "icon") fortune_icon.classList.add("fas", "fa-leaf", "icon")
fortune_label.appendChild(fortune_icon) fortune_label.appendChild(fortune_icon)
fortune_label.appendChild(document.createTextNode(game.i18n.localize('MF.Fortune.Name'))) fortune_label.appendChild(document.createTextNode(game.i18n.localize('MF.Fortune.Name')))
fortune_div.appendChild(fortune_label) fortune_div.appendChild(fortune_label)
let fortune_data_div = document.createElement("div") let fortune_data_div = document.createElement("div")
fortune_data_div.classList.add("buttons-inc") fortune_data_div.classList.add("buttons-inc")
let fortune_input = foundry.applications.fields.createNumberInput({ let fortune_input = foundry.applications.fields.createNumberInput({
/* /*
* By setting the name of the field using this format, the backing * By setting the name of the field using this format, the backing
* flag will automatically be picked up by Foundry's code and updated * flag will automatically be picked up by Foundry's code and updated
* when the field is changed on the sheet. * when the field is changed on the sheet.
* This works even if it wasn't set previously ! * This works even if it wasn't set previously !
*/ */
name: `flags.${MillsFabula.id}.${fortune_flag}`, name: `flags.${MillsFabula.id}.${fortune_flag}`,
value: app.document.getFlag(MillsFabula.id, fortune_flag) ?? 0, value: app.document.getFlag(MillsFabula.id, fortune_flag) ?? 0,
step: 1, step: 1,
min: 0, min: 0,
type: "number" type: "number"
}) })
fortune_input.classList.add("fp-resource-inputs") fortune_input.classList.add("fp-resource-inputs")
fortune_data_div.appendChild(fortune_input) fortune_data_div.appendChild(fortune_input)
fortune_div.appendChild(fortune_data_div) fortune_div.appendChild(fortune_data_div)
fortune_fabula_div.appendChild(fortune_div) fortune_fabula_div.appendChild(fortune_div)