fixed reset button for sure this time...?

This commit is contained in:
Nick Eimers
2020-06-21 23:56:30 -07:00
parent 3c5e002f5b
commit eaad1b99b9
4 changed files with 57 additions and 11 deletions
+9 -1
View File
@@ -258,12 +258,20 @@
text-align: right;
}
button.btn-tiny{
a.btn-tiny{
height: 26px;
margin-left: 5px;
margin-right: 5px;
font-size: 13px;
padding: 0px;
text-decoration: none;
background-color: #EEEEEE;
color: #333333;
border-radius: 4px;
line-height: 25px;
border: 1px solid #333333;
}
span.breaking-point-label{
+16 -2
View File
@@ -122,9 +122,22 @@ export class DeltaGreenActorSheet extends ActorSheet {
}
// Custom Sheet Macros
html.find('#btnResetBreakingPoint').click((event) => {
this._resetBreakingPoint(this);
//html.find('.btn-reset-breaking-point').click(this._resetBreakingPoint.bind(this));
//html.find('.btn-reset-breaking-point').click((event) => {
// this._resetBreakingPoint(this);
//});
//html.find('.btn-reset-breaking-point').bind('click', this._resetBreakingPoint(this));
html.find('.btn-reset-breaking-point').click(event => {
event.preventDefault();
let currentBreakingPoint = 0;
currentBreakingPoint = this.actor.data.data.sanity.value - this.actor.data.data.statistics.pow.value;
let updatedData = duplicate(this.actor.data.data);
updatedData.sanity.currentBreakingPoint = currentBreakingPoint;
this.actor.update({"data": updatedData});
});
}
/**
@@ -193,6 +206,7 @@ export class DeltaGreenActorSheet extends ActorSheet {
}
_resetBreakingPoint(event){
event.preventDefault();
let currentBreakingPoint = 0;
currentBreakingPoint = this.actor.data.data.sanity.value - this.actor.data.data.statistics.pow.value;
+1 -1
View File
@@ -227,7 +227,7 @@
"types":[
{
"specialization": "Painting/Dance/Sculpture/Etc.",
"proficiency": 0,
"proficiency": 20,
"failure": false
}
]
+31 -7
View File
@@ -55,7 +55,7 @@
<span class="breaking-point-label"> Breaking Point: </span>
<!-- <span title="The current breaking point, resent when current sanity falls to or below this value." class="max-attribute-value-label">{{numberFormat data.sanity.currentBreakingPoint decimals=0 sign=false}}</span> -->
<input title="The current breaking point, reset when current sanity falls to or below this value." type="text" name="data.sanity.currentBreakingPoint" value="{{data.sanity.currentBreakingPoint}}" data-dtype="Number"/>
<button id="btnResetBreakingPoint" class="btn-tiny" title="Reset breaking point to be current SAN - WP.">Reset</button>
<a class="btn-tiny btn-reset-breaking-point" title="Reset breaking point to be current SAN - WP.">Reset</a>
</div>
</div>
</div>
@@ -95,12 +95,36 @@
{{!-- Skills Tab --}}
<div class="tab skills" data-group="primary" data-tab="skills">
<div class="statistics grid grid-3col">
{{#each data.skills as |skill key|}}
<div class="statistic flexrow flex-group-center">
<label class="rollable skill-label" data-roll="d100" data-target="{{skill.proficiency}}" data-label="{{skill.label}}" title="Click to roll a skill check." for="data.skills.{{key}}.value" class="resource-label">{{skill.label}}</label>
<input type="text" name="data.skills.{{key}}.proficiency" value="{{skill.proficiency}}" data-dtype="Number"/>
<input type="checkbox" name="data.skills.{{key}}.failure" {{checked skill.failure}} data-dtype="Boolean" {{#if skill.cannotBeImprovedByFailure}} disabled {{/if}} }} />
</div>
{{#each data.skills as |skill key|}}
<div class="statistic flexrow flex-group-center">
<label class="rollable skill-label" data-roll="d100" data-target="{{skill.proficiency}}" data-label="{{skill.label}}" title="Click to roll a skill check." for="data.skills.{{key}}.value" >{{skill.label}}</label>
<input type="text" name="data.skills.{{key}}.proficiency" value="{{skill.proficiency}}" data-dtype="Number"/>
<input type="checkbox" name="data.skills.{{key}}.failure" {{checked skill.failure}} data-dtype="Boolean" {{#if skill.cannotBeImprovedByFailure}} disabled {{/if}} />
</div>
{{/each}}
</div>
<div class="statistics grid grid-2col">
{{#each data.type_skills as |typeskill key|}}
<div class="statistic flexrow flex-group-center">
<label class="skill-label">{{typeskill.label}}</label>
{{#each typeskill.types}}
<div class="statistic flexrow flex-group-center">
<label class="skill-label">{{this.specialization}}</label>
<label class="skill-label">{{this}}</label>
<!-- <label class="skill-label">data.type_skills.{{key}}.types[{{@index}}].proficiency</label> -->
<!-- <label class="skill-label">{{actor.data.data.type_skills.art.label}}</label> -->
{{!-- Subtyped Skills take the form: data.type_skills.art.types[0].proficiency where 'types' is an array of object. --}}
<input type="text" name="data.type_skills.{{key}}.types[{{@index}}].proficiency" value="{{this.proficiency}}" data-dtype="Number"/>
</div>
{{/each}}
</div>
{{/each}}
</div>
</div>