Implemented item attack summaries
This commit is contained in:
@@ -161,6 +161,14 @@ paper-button {
|
||||
right: 24px;
|
||||
}
|
||||
|
||||
.wideTable td {
|
||||
padding: 4px 8px 4px 8px;
|
||||
}
|
||||
|
||||
.wideTable table {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
paper-fab-menu /deep/ .container {
|
||||
padding: 24px !important;
|
||||
}
|
||||
@@ -219,6 +227,10 @@ paper-slider {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.spaceAfter {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.s {
|
||||
padding: 0 0 16px 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
<template name="attackView">
|
||||
<div class="attackView" layout horizontal>
|
||||
<div class="headline rightPadded" layout horizontal center>
|
||||
{{evaluateSigned charId attackBonus}}
|
||||
</div>
|
||||
<div layout vertical>
|
||||
<div>
|
||||
{{damageDice}} {{{evaluateSignedSpaced charId damageBonus}}} {{damageType}}
|
||||
</div>
|
||||
{{#if details}}
|
||||
<div class="caption">
|
||||
{{details}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -1,3 +1,11 @@
|
||||
<template name="attacksViewList">
|
||||
Attacks view list goes here
|
||||
{{#if attacks.count}}
|
||||
<hr style="margin: 16px 0 16px 0;">
|
||||
<div class="attacks">
|
||||
<h2 class="spaceAfter">Attacks</h2>
|
||||
{{#each attacks}}
|
||||
{{> attackView}}
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</template>
|
||||
@@ -0,0 +1,5 @@
|
||||
Template.attacksViewList.helpers({
|
||||
attacks: function(){
|
||||
return Attacks.find({"parent.id": this.parentId, charId: this.charId});
|
||||
}
|
||||
});
|
||||
@@ -1,7 +0,0 @@
|
||||
.effects td {
|
||||
padding: 4px 8px 4px 8px;
|
||||
}
|
||||
|
||||
.effects table {
|
||||
padding: 8px;
|
||||
}
|
||||
@@ -109,6 +109,7 @@ Template.effectView.helpers({
|
||||
operationName: function(){
|
||||
if(this.operation === "proficiency") return null;
|
||||
if(stats[this.stat].group === "Weakness/Resistance") return null;
|
||||
if(this.operation === "add" && evaluateEffect(this.charId, this) < 0) return null;
|
||||
return operations[this.operation] && operations[this.operation].name || "No Operation";
|
||||
},
|
||||
statValue: function(){
|
||||
@@ -128,6 +129,6 @@ Template.effectView.helpers({
|
||||
if(this.value == 2 || this.calculation == 2) return "Vulnerability";
|
||||
if(this.value == 0 || this.calculation == 0) return "Immunity";
|
||||
}
|
||||
return this.calculation || this.value;
|
||||
return evaluateEffect(this.charId, this);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
{{#if effects.count}}
|
||||
<hr style="margin: 16px 0 16px 0;">
|
||||
<div class="effects">
|
||||
<h2>Effects</h2>
|
||||
<table>
|
||||
<h2 class="spaceAfter">Effects</h2>
|
||||
<table class="wideTable">
|
||||
{{#each effects}}
|
||||
{{>effectView}}
|
||||
{{/each}}
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
Template.effectsViewList.helpers({
|
||||
effects: function(){
|
||||
if(this.parentId){
|
||||
return Effects.find({"parent.id": this.parentId, charId: this.charId}, {fields: {parent: 0}});
|
||||
} else if(this.stat){
|
||||
return Effects.find({charId: this.charId, stat: this.stat});
|
||||
}
|
||||
|
||||
return Effects.find({"parent.id": this.parentId, charId: this.charId}, {fields: {parent: 0}});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<div class="prewrap">{{description}}</div>
|
||||
{{/if}}
|
||||
{{> effectsViewList charId=charId parentId=_id}}
|
||||
{{> attacksViewList}}
|
||||
{{> attacksViewList charId=charId parentId=_id}}
|
||||
</template>
|
||||
|
||||
<template name="itemEdit">
|
||||
|
||||
Reference in New Issue
Block a user