From e6487c9416709130a948b9b46deac39229b09b29 Mon Sep 17 00:00:00 2001 From: Thaum Date: Thu, 16 Apr 2015 11:52:17 +0000 Subject: [PATCH] Implemented item attack summaries --- rpg-docs/client/views/GeneralCSS/general.css | 12 ++++++++++++ .../attacks/attackView/attackView.html | 17 +++++++++++++++++ .../attacksViewList/attacksViewList.html | 10 +++++++++- .../attacks/attacksViewList/attacksViewList.js | 5 +++++ .../character/effects/effectView/effectView.css | 7 ------- .../character/effects/effectView/effectView.js | 3 ++- .../effectsViewList/effectsViewList.html | 4 ++-- .../effects/effectsViewList/effectsViewList.js | 7 +------ .../inventory/itemDialog/itemDialog.html | 2 +- 9 files changed, 49 insertions(+), 18 deletions(-) create mode 100644 rpg-docs/client/views/character/attacks/attackView/attackView.html create mode 100644 rpg-docs/client/views/character/attacks/attacksViewList/attacksViewList.js diff --git a/rpg-docs/client/views/GeneralCSS/general.css b/rpg-docs/client/views/GeneralCSS/general.css index c3a3efd2..b0f51b64 100644 --- a/rpg-docs/client/views/GeneralCSS/general.css +++ b/rpg-docs/client/views/GeneralCSS/general.css @@ -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; } diff --git a/rpg-docs/client/views/character/attacks/attackView/attackView.html b/rpg-docs/client/views/character/attacks/attackView/attackView.html new file mode 100644 index 00000000..cc8b5914 --- /dev/null +++ b/rpg-docs/client/views/character/attacks/attackView/attackView.html @@ -0,0 +1,17 @@ + diff --git a/rpg-docs/client/views/character/attacks/attacksViewList/attacksViewList.html b/rpg-docs/client/views/character/attacks/attacksViewList/attacksViewList.html index 55dd022a..141dac49 100644 --- a/rpg-docs/client/views/character/attacks/attacksViewList/attacksViewList.html +++ b/rpg-docs/client/views/character/attacks/attacksViewList/attacksViewList.html @@ -1,3 +1,11 @@ \ No newline at end of file diff --git a/rpg-docs/client/views/character/attacks/attacksViewList/attacksViewList.js b/rpg-docs/client/views/character/attacks/attacksViewList/attacksViewList.js new file mode 100644 index 00000000..5e38ce25 --- /dev/null +++ b/rpg-docs/client/views/character/attacks/attacksViewList/attacksViewList.js @@ -0,0 +1,5 @@ +Template.attacksViewList.helpers({ + attacks: function(){ + return Attacks.find({"parent.id": this.parentId, charId: this.charId}); + } +}); diff --git a/rpg-docs/client/views/character/effects/effectView/effectView.css b/rpg-docs/client/views/character/effects/effectView/effectView.css index b2f3eeb9..e69de29b 100644 --- a/rpg-docs/client/views/character/effects/effectView/effectView.css +++ b/rpg-docs/client/views/character/effects/effectView/effectView.css @@ -1,7 +0,0 @@ -.effects td { - padding: 4px 8px 4px 8px; -} - -.effects table { - padding: 8px; -} \ No newline at end of file diff --git a/rpg-docs/client/views/character/effects/effectView/effectView.js b/rpg-docs/client/views/character/effects/effectView/effectView.js index b83b3ce7..c0c4358c 100644 --- a/rpg-docs/client/views/character/effects/effectView/effectView.js +++ b/rpg-docs/client/views/character/effects/effectView/effectView.js @@ -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); } }); diff --git a/rpg-docs/client/views/character/effects/effectsViewList/effectsViewList.html b/rpg-docs/client/views/character/effects/effectsViewList/effectsViewList.html index 1bd0832a..0b9c26cd 100644 --- a/rpg-docs/client/views/character/effects/effectsViewList/effectsViewList.html +++ b/rpg-docs/client/views/character/effects/effectsViewList/effectsViewList.html @@ -3,8 +3,8 @@ {{#if effects.count}}
-

Effects

- +

Effects

+
{{#each effects}} {{>effectView}} {{/each}} diff --git a/rpg-docs/client/views/character/effects/effectsViewList/effectsViewList.js b/rpg-docs/client/views/character/effects/effectsViewList/effectsViewList.js index 01523efa..343944f3 100644 --- a/rpg-docs/client/views/character/effects/effectsViewList/effectsViewList.js +++ b/rpg-docs/client/views/character/effects/effectsViewList/effectsViewList.js @@ -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}}); } }); diff --git a/rpg-docs/client/views/character/inventory/itemDialog/itemDialog.html b/rpg-docs/client/views/character/inventory/itemDialog/itemDialog.html index f525156b..bfb45e22 100644 --- a/rpg-docs/client/views/character/inventory/itemDialog/itemDialog.html +++ b/rpg-docs/client/views/character/inventory/itemDialog/itemDialog.html @@ -24,7 +24,7 @@
{{description}}
{{/if}} {{> effectsViewList charId=charId parentId=_id}} - {{> attacksViewList}} + {{> attacksViewList charId=charId parentId=_id}}