diff --git a/hench.mjs b/hench.mjs index c580974..09c6e0b 100644 --- a/hench.mjs +++ b/hench.mjs @@ -1,6 +1,6 @@ import { HenchDataModel } from "./module/data-models.mjs"; -import { HenchDebugSheet } from "./module/sheets/hench-debug.mjs"; +import { HenchActorSheet } from "./module/sheets/hench-actor-sheet.mjs"; Handlebars.registerHelper('int2checkbox', (size, threshold, options) => { return new Array(size).fill(0).map( @@ -14,7 +14,7 @@ Hooks.once("init", () => { }; Actors.unregisterSheet('core', ActorSheet); - Actors.registerSheet('henchDebug', HenchDebugSheet, { + Actors.registerSheet('hench', HenchActorSheet, { makeDefault: true, label: 'Hench Debug Sheet', }); diff --git a/module/helpers/object-helper.mjs b/module/helpers/mutation-helper.mjs similarity index 91% rename from module/helpers/object-helper.mjs rename to module/helpers/mutation-helper.mjs index 60615ef..e65e9d6 100644 --- a/module/helpers/object-helper.mjs +++ b/module/helpers/mutation-helper.mjs @@ -1,4 +1,4 @@ -export function getValueAtPath(obj, fieldPath) { +function getValueAtPath(obj, fieldPath) { const pathSequence = fieldPath.split('.'); let pointer = obj; @@ -10,7 +10,7 @@ export function getValueAtPath(obj, fieldPath) { return pointer; } -export function copyAndMutateAtPath(obj, fieldPath, val) { +function copyAndMutateAtPath(obj, fieldPath, val) { const copy = deepCopy(obj); const changed = mutateAtPath(copy, fieldPath, val); @@ -36,11 +36,11 @@ function mutateAtPath(obj, fieldPath, val) { return obj; } -export function deepCopy(obj) { +function deepCopy(obj) { return structuredClone(obj); } -export function getDataPathFromString(dataPathString) { +function getDataPathFromString(dataPathString) { const arraySplit = dataPathString.indexOf('['); const isArray = arraySplit > 0; diff --git a/module/sheets/hench-debug.mjs b/module/sheets/hench-actor-sheet.mjs similarity index 86% rename from module/sheets/hench-debug.mjs rename to module/sheets/hench-actor-sheet.mjs index d8d5519..169578c 100644 --- a/module/sheets/hench-debug.mjs +++ b/module/sheets/hench-actor-sheet.mjs @@ -1,10 +1,11 @@ import { playbookKeys, validatePlaybookKey, getPlaybookMutation } from "../playbooks.mjs"; -import { getValueAtPath, copyAndMutateAtPath, deepCopy, updateField } from "../helpers/object-helper.mjs"; +import { updateField } from "../helpers/object-helper.mjs"; -export class HenchDebugSheet extends ActorSheet { +export class HenchActorSheet extends ActorSheet { /** @override */ get template() { - return `systems/hench/templates/hench-debug.hbs`; + console.log(`Mapping sheet: ${this.actor.type} => systems/hench/templates/actors/${this.actor.type}.hbs`) + return `systems/hench/templates/actors/${this.actor.type}.hbs`; } /** @override */ diff --git a/templates/hench-debug.hbs b/templates/actors/hench.hbs similarity index 100% rename from templates/hench-debug.hbs rename to templates/actors/hench.hbs diff --git a/todo.md b/todo.md index da23960..1b47d11 100644 --- a/todo.md +++ b/todo.md @@ -1,9 +1,11 @@ -- [] Define Move Model -- [] Define Hench Model +- [x] Define Move Model +- [x] Define Hench Model - [] Define Boss Model - [x] Define Prompt Model (DEFUNCT) - [] Define Storyline Model - [] ? Define Table Model +- [] Implement baseline hench sheet +- [] Implement baseline boss sheet - [] Design Hench sheet - [] Design Boss sheet - [] Implement Hench sheet