added 'limited' character sheet

This commit is contained in:
The Last Scrub
2020-11-19 21:06:19 -08:00
parent 24879b5b4a
commit 5220ca5ec8
2 changed files with 101 additions and 0 deletions
+40
View File
@@ -18,6 +18,18 @@ export class DeltaGreenActorSheet extends ActorSheet {
/* -------------------------------------------- */
/** @override */
get template() {
if ( !game.user.isGM && this.actor.limited ) {
return "systems/deltagreen/templates/actor/limited-sheet.html";
}
else{
//return `systems/deltagreen/templates/actor/${this.actor.data.type}-sheet.html`;
return `systems/deltagreen/templates/actor/actor-sheet.html`;
}
}
/** @override */
getData() {
const data = super.getData();
@@ -84,9 +96,37 @@ export class DeltaGreenActorSheet extends ActorSheet {
onclick: (ev) => sendPercentileTestToChat(this.actor, "Luck", 50)
}].concat(buttons);
//buttons = [
// {
// label: "Active Effect",
// class: "test-extra-icon",
// icon: "fas fa-bolt",
// onclick: (ev) => this.activeEffectTest(this)
// }].concat(buttons);
return buttons;
}
activeEffectTest(sheet){
console.log(sheet.actor.uuid);
let owner = sheet.actor;
let effect = ActiveEffect.create({
label: "Custom Effect",
tint: "#008000",
icon: "icons/svg/aura.svg",
origin: owner.uuid,
//duration: {"rounds": 1, "seconds": null, "startTime": null, "turns": null, "startRound": null, "startTurn": null},
disabled: false,
changes: [{
"key": "data.skills.firearms.proficiency", //"data.statistics.str.value", //"data.health.max",
"mode": 2, // 0 = custom, 1 = multiply, 2 = add, 3 = upgrade, 4 = downgrade, 5 = override
"value": -20,
"priority": "20"
}]
}, owner).create();
}
/* -------------------------------------------- */
/** @override */
+61
View File
@@ -0,0 +1,61 @@
<form class="{{cssClass}} 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="data.biography.profession" type="text" value="{{data.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">
<div class="bio-grid-5col">
<span>{{localize 'DG.CV.Sex'}}</span>
<input class="fill-remaining-space" type="text" name="data.biography.sex" value="{{data.biography.sex}}" data-dtype="String" placeholder="{{localize 'DG.CV.SexPlaceholder'}}" />
<span></span>
<span class="bio-grid-label">{{localize 'DG.CV.AgeAndDoB'}}</span>
<input class="fill-remaining-space" type="text" name="data.biography.age" value="{{data.biography.age}}" data-dtype="String" placeholder="{{localize 'DG.CV.AgeAndDoBPlaceholder'}}" />
</div>
<div class="bio-grid-2col">
<span>{{localize 'DG.CV.Employer'}}</span>
<input class="fill-remaining-space" type="text" name="data.biography.employer" value="{{data.biography.employer}}" data-dtype="String" placeholder="{{localize 'DG.CV.EmployerPlaceholder'}}" />
<span>{{localize 'DG.CV.Nationality'}}</span>
<input class="fill-remaining-space" type="text" name="data.biography.nationality" value="{{data.biography.nationality}}" data-dtype="String" placeholder="{{localize 'DG.CV.NationalityPlaceholder'}}" />
</div>
<div class="bio-grid-2col">
<span>{{localize 'DG.CV.Education'}}</span>
<input class="fill-remaining-space" type="text" name="data.biography.education" value="{{data.biography.education}}" data-dtype="String" placeholder="{{localize 'DG.CV.EducationPlaceholder'}}" />
</div>
<div>
<span style="font-weight: bold;">{{localize 'DG.CV.PhysicalDescriptionLabel'}}</span>
</div>
{{editor content=data.physicalDescription target="data.physicalDescription" button=true owner=owner editable=editable}}
</div>
</section>
</form>