PC sheet review + dialog rolls update
All checks were successful
Release Creation / build (release) Successful in 1m3s
All checks were successful
Release Creation / build (release) Successful in 1m3s
This commit is contained in:
@@ -32,7 +32,9 @@ export default class HellbornActorSheet extends HandlebarsApplicationMixin(found
|
||||
editImage: HellbornActorSheet.#onEditImage,
|
||||
toggleSheet: HellbornActorSheet.#onToggleSheet,
|
||||
edit: HellbornActorSheet.#onItemEdit,
|
||||
delete: HellbornActorSheet.#onItemDelete
|
||||
delete: HellbornActorSheet.#onItemDelete,
|
||||
updateCheckboxArray: HellbornActorSheet.#onUpdateCheckboxArray,
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
@@ -184,6 +186,18 @@ export default class HellbornActorSheet extends HandlebarsApplicationMixin(found
|
||||
return fp.browse()
|
||||
}
|
||||
|
||||
static #onUpdateCheckboxArray(event, target) {
|
||||
console.log("Update checkbox array", event, target)
|
||||
let arrayName = target.dataset.name
|
||||
let arrayIdx = Number(target.dataset.index)
|
||||
let dataPath = `system.mortality.${arrayName}`
|
||||
let tab = foundry.utils.duplicate(this.document.system.mortality[arrayName])
|
||||
tab[arrayIdx] = target.checked
|
||||
this.actor.update( { [dataPath]: tab } )
|
||||
// Dump
|
||||
console.log("Array name", arrayName, arrayIdx, target.checked, dataPath)
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit an existing item within the Actor
|
||||
* Start with the uuid, if it's not found, fallback to the id (as Embedded item in the actor)
|
||||
|
||||
@@ -90,6 +90,14 @@ export const WEAPON_TYPES = {
|
||||
"ranged": { id: "ranged", label: "Ranged" },
|
||||
}
|
||||
|
||||
export const AMMO_TYPES = {
|
||||
"blessed": { id: "blessed", label: "Blessed" },
|
||||
"hollow-points": { id: "hollow-points", label: "Hollow Points" },
|
||||
"incendiary": { id: "incendiary", label: "Incendiary" },
|
||||
"poisoned": { id: "poisoned", label: "Poisoned" },
|
||||
"rubber": { id: "rubber", label: "Rubber" },
|
||||
"tesla": { id: "tesla", label: "Tesla" },
|
||||
}
|
||||
|
||||
/**
|
||||
* Include all constant definitions within the SYSTEM global export
|
||||
@@ -104,6 +112,7 @@ export const SYSTEM = {
|
||||
MALEFICA_LEVELS,
|
||||
MALEFICA_DOMAINS,
|
||||
WEAPON_TYPES,
|
||||
AMMO_TYPES,
|
||||
DIFFICULTY_CHOICES,
|
||||
CHOICE_ADVANTAGES_DISADVANTAGES,
|
||||
ASCII
|
||||
|
||||
@@ -135,11 +135,10 @@ export default class HellbornRoll extends Roll {
|
||||
fullFormula: formula,
|
||||
rollModes,
|
||||
fieldRollMode,
|
||||
difficultyChoices: SYSTEM.DIFFICULTY_CHOICES,
|
||||
choiceAdvantages: SYSTEM.CHOICE_ADVANTAGES_DISADVANTAGES,
|
||||
choiceDisadvantages: SYSTEM.CHOICE_ADVANTAGES_DISADVANTAGES,
|
||||
hasTarget: options.hasTarget,
|
||||
difficulty: "unknown",
|
||||
difficulty: "0",
|
||||
nbAdvantages: "0",
|
||||
nbDisadvantages: "0",
|
||||
}
|
||||
|
||||
@@ -58,8 +58,18 @@ export default class HellbornActor extends foundry.abstract.TypeDataModel {
|
||||
|
||||
schema.limboes = new fields.StringField({ required: true, nullable: false, initial: "" })
|
||||
schema.ammo = new fields.StringField({ required: true, nullable: false, initial: "" })
|
||||
schema.ammoList = new fields.SchemaField(
|
||||
Object.values(SYSTEM.AMMO_TYPES).reduce((obj, stat) => {
|
||||
obj[stat.id] = new fields.StringField({ required: true, nullable: false, initial: "" })
|
||||
return obj
|
||||
}, {}),
|
||||
)
|
||||
|
||||
schema.mortality = new fields.SchemaField({
|
||||
/* Enabled: Array of 5 boolean field */
|
||||
enabled: new fields.ArrayField(new fields.BooleanField(),
|
||||
{ required: true, initial: [false, false, false, false, false], min:5, max:5 }),
|
||||
|
||||
current: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||
max: new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 }),
|
||||
})
|
||||
|
||||
@@ -193,21 +193,4 @@ export default class HellbornUtils {
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
static setupCSSRootVariables() {
|
||||
const era = game.settings.get("fvtt-cthulhu-eternal", "settings-era")
|
||||
|
||||
let eraCSS = SYSTEM.ERA_CSS[era];
|
||||
if (!eraCSS) eraCSS = SYSTEM.ERA_CSS["jazz"];
|
||||
|
||||
document.documentElement.style.setProperty('--font-size-standard', eraCSS.baseFontSize);
|
||||
document.documentElement.style.setProperty('--font-size-title', eraCSS.titleFontSize);
|
||||
document.documentElement.style.setProperty('--font-size-result', eraCSS.titleFontSize);
|
||||
document.documentElement.style.setProperty('--font-primary', eraCSS.primaryFont);
|
||||
document.documentElement.style.setProperty('--font-secondary', eraCSS.secondaryFont);
|
||||
document.documentElement.style.setProperty('--font-title', eraCSS.titleFont);
|
||||
document.documentElement.style.setProperty('--img-icon-color-filter', eraCSS.imgFilter);
|
||||
document.documentElement.style.setProperty('--background-image-base', `linear-gradient(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.8)), url("../assets/ui/${era}_background_main.webp")`);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user