Renamed old "Temporary HP" to "Extra HP" (THP is now the actual attribute)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<!-- data just needs charId -->
|
||||
<template name="addTHPDialog">
|
||||
<template name="addEHPDialog">
|
||||
<div class="fit layout vertical">
|
||||
<app-header-layout has-scrolling-region class="new-character-dialog flex">
|
||||
<app-header fixed effects="waterfall">
|
||||
@@ -1,8 +1,8 @@
|
||||
Template.addTHPDialog.onRendered(function(){
|
||||
Template.addEHPDialog.onRendered(function(){
|
||||
this.find("#quantityInput").focus();
|
||||
});
|
||||
|
||||
Template.addTHPDialog.events({
|
||||
Template.addEHPDialog.events({
|
||||
"tap .addButton": function(event, instance){
|
||||
popDialogStack();
|
||||
var max = +instance.find("#quantityInput").value;
|
||||
@@ -5,7 +5,7 @@
|
||||
Hit Points
|
||||
</div>
|
||||
<paper-icon-button class="white54"
|
||||
id="addTempHP"
|
||||
id="addExtraHP"
|
||||
icon="add"
|
||||
disabled={{#unless canEditCharacter _id}}true{{/unless}}>
|
||||
</paper-icon-button>
|
||||
@@ -20,7 +20,7 @@
|
||||
</div>
|
||||
{{#if characterCalculate "attributeBase" _id "tempHP"}}
|
||||
<!-- main THP slider -->
|
||||
<div class="layout horizontal center {{#if tempHitPoints.count}}bottom-border{{/if}}">
|
||||
<div class="layout horizontal center {{#if extraHitPoints.count}}bottom-border{{/if}}">
|
||||
<div class="self-center">
|
||||
Temporary Hit Points
|
||||
</div>
|
||||
@@ -35,17 +35,17 @@
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{#each tempHitPoints}}
|
||||
{{#each extraHitPoints}}
|
||||
<div class="layout horizontal center">
|
||||
<div class="self-center">
|
||||
{{name}}
|
||||
</div>
|
||||
<div style="height: 40px; width: 40px;">
|
||||
{{#unless left}}
|
||||
<paper-icon-button class="deleteTHP" icon="delete"></paper-icon-button>
|
||||
<paper-icon-button class="deleteEHP" icon="delete"></paper-icon-button>
|
||||
{{/unless}}
|
||||
</div>
|
||||
<paper-diff-slider class="tempHitPointSlider flex"
|
||||
<paper-diff-slider class="extraHitPointSlider flex"
|
||||
max={{maximum}}
|
||||
value={{left}}
|
||||
editable pin
|
||||
|
||||
@@ -23,7 +23,7 @@ Template.healthCard.onRendered(function(){
|
||||
});
|
||||
|
||||
Template.healthCard.helpers({
|
||||
tempHitPoints: function(){
|
||||
extraHitPoints: function(){
|
||||
return TemporaryHitPoints.find({charId: this._id});
|
||||
},
|
||||
showDeathSave: function(){
|
||||
@@ -100,17 +100,17 @@ Template.healthCard.events({
|
||||
var adjustment = value - base;
|
||||
Characters.update(this._id, {$set: {"tempHP.adjustment": adjustment}});
|
||||
},
|
||||
"change .tempHitPointSlider": function(event){ //this is the extra bars
|
||||
"change .extraHitPointSlider": function(event){ //this is the extra bars
|
||||
var value = event.currentTarget.value;
|
||||
var used = this.maximum - value;
|
||||
TemporaryHitPoints.update(this._id, {$set: {"used": used}});
|
||||
},
|
||||
"click .deleteTHP": function(event){
|
||||
"click .deleteEHP": function(event){
|
||||
TemporaryHitPoints.remove(this._id);
|
||||
},
|
||||
"click #addTempHP": function(event){
|
||||
"click #addExtraHP": function(event){
|
||||
pushDialogStack({
|
||||
template: "addTHPDialog",
|
||||
template: "addEHPDialog",
|
||||
data: {charId: this._id},
|
||||
element: event.currentTarget.parentElement,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user