Small fixes for effects, health, permissions and formatting

This commit is contained in:
Thaum
2015-04-07 13:32:35 +00:00
parent 2fac76f702
commit 974c4fe706
8 changed files with 118 additions and 103 deletions

View File

@@ -57,6 +57,13 @@ Template.healthCard.events({
var value = event.currentTarget.value;
var adjustment = value - this.attributeBase("hitPoints");
Characters.update(this._id, {$set: {"hitPoints.adjustment": adjustment}});
//reset the death saves if we are gaining HP
if(value > 0)
Characters.update(this._id, { $set: {
"deathSave.pass": 0,
"deathSave.fail": 0,
"deathSave.stable": false
} });
},
"change .tempHitPointSlider": function(event){
var value = event.currentTarget.value;
@@ -68,9 +75,9 @@ Template.healthCard.events({
},
"tap #addTempHP": function(event){
GlobalUI.showDialog({
template: "addTHPDialog",
data: {charId: this._id}
});
template: "addTHPDialog",
data: {charId: this._id}
});
},
"tap .failBubble": function(event){
if(event.currentTarget.disabled) return;

View File

@@ -0,0 +1,3 @@
.summaryNumber{
width: 50px;
}

View File

@@ -15,46 +15,46 @@
<!--numerical value-->
<div>
<!--Ability Mod-->
<div>
<div>{{abilityName}}</div>
<div>{{char.abilityMod ability}}</div>
<div horizontal center-justified layout>
<div flex>{{abilityName}}</div>
<div class="summaryNumber">{{char.abilityMod ability}}</div>
</div>
<!--Prof bonus-->
{{#if char.proficiency skillName}}
<div>
<div>{{#with profSource}}{{statValue}}{{/with}}</div>
<div>+{{profBonus}}</div>
<div horizontal center-justified layout>
<div flex>{{#with profSource}}{{statValue}}{{/with}}</div>
<div class="summaryNumber">{{signedString profBonus}}</div>
</div>
{{/if}}
<!--numerical effects-->
{{#each addEffects}}
<div>
<div>{{sourceName}}</div>
<div>&plus;{{statValue}}</div>
<div horizontal center-justified layout>
<div flex>{{sourceName}}</div>
<div class="summaryNumber">{{signedString statValue}}</div>
</div>
{{/each}}
{{#each mulEffects}}
<div>
<div>{{sourceName}}</div>
<div>&times;{{statValue}}</div>
<div horizontal center-justified layout>
<div flex>{{sourceName}}</div>
<div class="summaryNumber">&times;{{statValue}}</div>
</div>
{{/each}}
{{#each minEffects}}
<div>
<div>{{sourceName}}</div>
<div>Min: {{statValue}}</div>
<div horizontal center-justified layout>
<div flex>{{sourceName}}</div>
<div class="summaryNumber">Min: {{statValue}}</div>
</div>
{{/each}}
{{#each maxEffects}}
<div>
<div>{{sourceName}}</div>
<div>Max: {{statValue}}</div>
<div horizontal center-justified layout>
<div flex>{{sourceName}}</div>
<div class="summaryNumber">Max: {{statValue}}</div>
</div>
{{/each}}
<!--Total-->
<div>
<div>Total</div>
<div>{{char.skillMod skillName}}</div>
<div horizontal center-justified layout>
<div flex>Total</div>
<div class="summaryNumber">{{char.skillMod skillName}}</div>
</div>
</div>
<!--Advantage effects-->
@@ -78,4 +78,4 @@
</div>
{{/each}}
{{/baseDialog}}
</template>
</template>