Merge pull request #168 from Frogvall/master
Adding advantage/disadvantage arrows to initiative stat card
This commit is contained in:
@@ -14,3 +14,17 @@
|
|||||||
min-width: 72px;
|
min-width: 72px;
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.stat-card .advantage{
|
||||||
|
background-image: url(/png/advantage/greenUp.png);
|
||||||
|
background-size: contain;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-card .disadvantage{
|
||||||
|
background-image: url(/png/advantage/redDown.png);
|
||||||
|
background-size: contain;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: center;
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,7 +3,9 @@
|
|||||||
<paper-material class="stat-card layout horizontal {{#if bounce}}bounce{{/if}}">
|
<paper-material class="stat-card layout horizontal {{#if bounce}}bounce{{/if}}">
|
||||||
<div class="numbers paper-font-display1">
|
<div class="numbers paper-font-display1">
|
||||||
{{#if isSkill}}
|
{{#if isSkill}}
|
||||||
{{prefix}}{{skillMod}}
|
<div class="{{advantage}}">
|
||||||
|
{{prefix}}{{skillMod}}
|
||||||
|
</div>
|
||||||
{{else}}
|
{{else}}
|
||||||
{{prefix}}{{characterCalculate "attributeValue" ../_id stat}}
|
{{prefix}}{{characterCalculate "attributeValue" ../_id stat}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|||||||
@@ -6,4 +6,10 @@ Template.statCard.helpers({
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
advantage: function(){
|
||||||
|
var charId = Template.parentData()._id;
|
||||||
|
var advantage = Characters.calculate.advantage(charId, this.stat);
|
||||||
|
if (advantage > 0) return "advantage";
|
||||||
|
if (advantage < 0) return "disadvantage";
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user