diff --git a/module/actor/actor-sheet.js b/module/actor/actor-sheet.js index ae8fdab..8918ca3 100644 --- a/module/actor/actor-sheet.js +++ b/module/actor/actor-sheet.js @@ -32,29 +32,32 @@ export default class DeltaGreenActorSheet extends foundry.appv1.sheets /** @override */ get template() { + const templatePath = "systems/deltagreen/templates/actor"; + let templateName = "limited-sheet.html"; + if (this.actor !== null) { - if (this.actor.type === "agent") { - if (!game.user.isGM && this.actor.limited) { - return "systems/deltagreen/templates/actor/limited-sheet.html"; - } + const actorIsLimited = !game.user.isGM && this.actor.limited; - // return `systems/deltagreen/templates/actor/${this.actor.data.type}-sheet.html`; - return `systems/deltagreen/templates/actor/actor-sheet.html`; + switch (this.actor.type) { + case "agent": + templateName = actorIsLimited ? "limited-sheet.html" : "actor-sheet.html"; + break; + case "unnatural": + templateName = "unnatural-sheet.html"; // No limited sheet + break; + case "npc": + templateName = actorIsLimited ? "npc-limited-sheet.html" : "npc-sheet.html"; + break; + case "vehicle": + templateName = "vehicle-sheet.html"; // No limited sheet + break; + default: + templateName = "actor-sheet.html"; // No limited sheet + break; } - if (this.actor.type === "unnatural") { - return `systems/deltagreen/templates/actor/unnatural-sheet.html`; - } - if (this.actor.type === "npc") { - return `systems/deltagreen/templates/actor/npc-sheet.html`; - } - if (this.actor.type === "vehicle") { - return `systems/deltagreen/templates/actor/vehicle-sheet.html`; - } - - return "systems/deltagreen/templates/actor/limited-sheet.html"; } - return "systems/deltagreen/templates/actor/limited-sheet.html"; + return `${templatePath}/${templateName}`; } /** @override */ diff --git a/module/templates.js b/module/templates.js index 2e602fa..7d4fe12 100644 --- a/module/templates.js +++ b/module/templates.js @@ -9,6 +9,7 @@ export default async function preloadHandlebarsTemplates() { "systems/deltagreen/templates/actor/limited-sheet.html", "systems/deltagreen/templates/actor/unnatural-sheet.html", "systems/deltagreen/templates/actor/npc-sheet.html", + "systems/deltagreen/templates/actor/npc-limited-sheet.html", "systems/deltagreen/templates/dialog/modify-percentile-roll.html", "systems/deltagreen/templates/actor/vehicle-sheet.html", "systems/deltagreen/templates/actor/partials/custom-skills-partial.html", diff --git a/templates/actor/npc-limited-sheet.html b/templates/actor/npc-limited-sheet.html new file mode 100644 index 0000000..ab9dbd5 --- /dev/null +++ b/templates/actor/npc-limited-sheet.html @@ -0,0 +1,22 @@ +