feat: add Settlement actor type with Overview/Buildings/Inventory tabs
- New TypeDataModel: archetype, territory, renown, currency (gp/sp/cp), garrison, underSiege, isCapital, founded, taxNotes, description, notes - 3-tab ApplicationV2 sheet with drag & drop for building/weapon/armor/equipment - Currency steppers (+/−), building constructed toggle, qty controls - LESS-based CSS (settlement-sheet.less) + base.less updated for shared styles - Full i18n keys in lang/en.json (8 settlement archetypes) - system.json: registered settlement actor type Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -37,6 +37,8 @@ export default class OathHammerCharacterSheet extends OathHammerActorSheet {
|
||||
rollInitiative: OathHammerCharacterSheet.#onRollInitiative,
|
||||
adjustQty: OathHammerCharacterSheet.#onAdjustQty,
|
||||
adjustCurrency: OathHammerCharacterSheet.#onAdjustCurrency,
|
||||
adjustStress: OathHammerCharacterSheet.#onAdjustStress,
|
||||
clearStress: OathHammerCharacterSheet.#onClearStress,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -201,6 +203,7 @@ export default class OathHammerCharacterSheet extends OathHammerActorSheet {
|
||||
break
|
||||
case "magic":
|
||||
context.tab = context.tabs.magic
|
||||
context.stressBlocked = doc.system.arcaneStress.value >= doc.system.arcaneStress.threshold
|
||||
context.spells = doc.itemTypes.spell.map(s => ({
|
||||
id: s.id, uuid: s.uuid, img: s.img, name: s.name, system: s.system,
|
||||
_descTooltip: _stripHtml(s.system.effect)
|
||||
@@ -404,6 +407,17 @@ export default class OathHammerCharacterSheet extends OathHammerActorSheet {
|
||||
const current = foundry.utils.getProperty(this.document, field) ?? 0
|
||||
await this.document.update({ [field]: Math.max(0, current + delta) })
|
||||
}
|
||||
|
||||
static async #onAdjustStress(event, target) {
|
||||
const delta = parseInt(target.dataset.delta, 10)
|
||||
const current = this.document.system.arcaneStress.value ?? 0
|
||||
const max = this.document.system.arcaneStress.threshold
|
||||
await this.document.update({ "system.arcaneStress.value": Math.max(0, Math.min(max, current + delta)) })
|
||||
}
|
||||
|
||||
static async #onClearStress(_event, _target) {
|
||||
await this.document.update({ "system.arcaneStress.value": 0 })
|
||||
}
|
||||
}
|
||||
|
||||
/** Strip HTML tags and collapse whitespace for use in data-tooltip attributes. */
|
||||
|
||||
Reference in New Issue
Block a user