Renamed views>character>stats
This commit is contained in:
39
rpg-docs/client/views/character/stats/skillRow/skillRow.css
Normal file
39
rpg-docs/client/views/character/stats/skillRow/skillRow.css
Normal file
@@ -0,0 +1,39 @@
|
||||
.skillRow {
|
||||
height: 32px;
|
||||
margin: 0 -16px 0 -16px;
|
||||
}
|
||||
|
||||
.skillRow core-icon {
|
||||
color: rgba(0,0,0,0.54);
|
||||
}
|
||||
|
||||
.skillMod {
|
||||
width: 42px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.skillName, .skillMod{
|
||||
|
||||
}
|
||||
|
||||
.fail.skillMod {
|
||||
color: #D50000;
|
||||
}
|
||||
|
||||
.advantage{
|
||||
background-image: url(/png/advantage/greenUp.png);
|
||||
background-size: contain;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
}
|
||||
|
||||
.disadvantage{
|
||||
background-image: url(/png/advantage/redDown.png);
|
||||
background-size: contain;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
}
|
||||
|
||||
.hasConditionals::after{
|
||||
content: "*";
|
||||
}
|
||||
16
rpg-docs/client/views/character/stats/skillRow/skillRow.html
Normal file
16
rpg-docs/client/views/character/stats/skillRow/skillRow.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<template name="skillRow">
|
||||
<paper-item class="skillRow" layout horizontal>
|
||||
<core-icon icon="{{profIcon}}"></core-icon>
|
||||
{{#if failSkill}}
|
||||
<div class="fail skillMod">fail</div>
|
||||
{{else}}
|
||||
<div class="{{advantage}} skillMod">{{../skillMod skill}}</div>
|
||||
{{/if}}
|
||||
<div class="{{#if conditionalCount}}hasConditionals{{/if}} skillName">
|
||||
{{name}}
|
||||
{{#if showPassive}}
|
||||
({{../passiveSkill skill}})
|
||||
{{/if}}
|
||||
</div>
|
||||
</paper-item>
|
||||
</template>
|
||||
22
rpg-docs/client/views/character/stats/skillRow/skillRow.js
Normal file
22
rpg-docs/client/views/character/stats/skillRow/skillRow.js
Normal file
@@ -0,0 +1,22 @@
|
||||
Template.skillRow.helpers({
|
||||
profIcon: function(){
|
||||
var prof = Template.parentData(1).proficiency(this.skill);
|
||||
if(prof > 0 && prof < 1) return "image:brightness-2";
|
||||
if(prof === 1) return "image:brightness-1";
|
||||
if(prof > 1) return "av:album";
|
||||
return "radio-button-off";
|
||||
},
|
||||
failSkill: function(){
|
||||
var charId = Template.parentData(1)._id;
|
||||
return Effects.find({charId: charId, stat: this.skill, enabled: true, operation: "fail"}).count();
|
||||
},
|
||||
advantage: function(){
|
||||
var advantage = Template.parentData(1).advantage(this.skill);
|
||||
if(advantage > 0) return "advantage";
|
||||
if(advantage < 0) return "disadvantage";
|
||||
},
|
||||
conditionalCount: function(){
|
||||
var charId = Template.parentData(1)._id;
|
||||
return Effects.find({charId: charId, stat: this.skill, enabled: true, operation: "conditional"}).count();
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user