Merge pull request #1 from dairefinn/dfinn/limited-npc-sheets
Adds limited visibility NPC sheets
This commit is contained in:
+12
-18
@@ -33,25 +33,19 @@ export default class DeltaGreenActorSheet extends foundry.appv1.sheets
|
||||
/** @override */
|
||||
get template() {
|
||||
if (this.actor !== null) {
|
||||
if (this.actor.type === "agent") {
|
||||
if (!game.user.isGM && this.actor.limited) {
|
||||
return "systems/deltagreen/templates/actor/limited-sheet.html";
|
||||
}
|
||||
|
||||
// return `systems/deltagreen/templates/actor/${this.actor.data.type}-sheet.html`;
|
||||
return `systems/deltagreen/templates/actor/actor-sheet.html`;
|
||||
const actorIsLimited = !game.user.isGM && this.actor.limited;
|
||||
switch (this.actor.type) {
|
||||
case "agent":
|
||||
return actorIsLimited ? "systems/deltagreen/templates/actor/limited-sheet.html" : "systems/deltagreen/templates/actor/actor-sheet.html";
|
||||
case "unnatural":
|
||||
return `systems/deltagreen/templates/actor/unnatural-sheet.html`; // No limited sheet
|
||||
case "npc":
|
||||
return actorIsLimited ? "systems/deltagreen/templates/actor/npc-limited-sheet.html" : "systems/deltagreen/templates/actor/npc-sheet.html";
|
||||
case "vehicle":
|
||||
return `systems/deltagreen/templates/actor/vehicle-sheet.html`; // No limited sheet
|
||||
default:
|
||||
return "systems/deltagreen/templates/actor/actor-sheet.html"; // No limited sheet
|
||||
}
|
||||
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";
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<form class="{{cssClass}} {{getCharacterSheetStyle}} flexcol" autocomplete="off">
|
||||
|
||||
{{!-- Sheet Header --}}
|
||||
<header class="sheet-header">
|
||||
|
||||
<div class="header-fields">
|
||||
|
||||
{{!-- Name, Profession, Portrait --}}
|
||||
<div class="flexrow">
|
||||
<img class="profile-img" src="{{actor.img}}" data-edit="img" title="{{actor.name}}" height="150" width="100"/>
|
||||
<div class="horizontal-flex-column">
|
||||
<div>
|
||||
<h1 class="charname"><input name="name" type="text" value="{{actor.name}}" title="{{localize 'DG.AgentNameFieldTooltip' }}"/></h1>
|
||||
</div>
|
||||
<div>
|
||||
<h2 class="profession"><input name="system.biography.profession" type="text" value="{{actor.system.biography.profession}}" placeholder="{{localize 'DG.FallbackText.ProfessionAndOrRank'}}"/></h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
{{!-- Sheet Tab Navigation --}}
|
||||
<nav class="sheet-tabs tabs" data-group="primary">
|
||||
<a class="item" data-tab="bio">{{localize 'DG.Navigation.CV'}}</a>
|
||||
</nav>
|
||||
|
||||
{{!-- Sheet Body --}}
|
||||
<section class="sheet-body">
|
||||
{{!-- Biography Tab --}}
|
||||
<div class="tab bio" data-group="primary" data-tab="bio">
|
||||
{{> "systems/deltagreen/templates/actor/partials/cv-partial.html" }}
|
||||
</div>
|
||||
</section>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user