diff --git a/rpg-docs/Model/Inventory/Items.js b/rpg-docs/Model/Inventory/Items.js index 9e6448e1..872d4eb0 100644 --- a/rpg-docs/Model/Inventory/Items.js +++ b/rpg-docs/Model/Inventory/Items.js @@ -10,6 +10,7 @@ Schemas.Item = new SimpleSchema({ value: {type: Number, min: 0, defaultValue: 0, decimal: true}, enabled: {type: Boolean, defaultValue: false}, requiresAttunement: {type: Boolean, defaultValue: false}, + "settings.showIncrement": {type: Boolean, defaultValue: false}, color: { type: String, allowedValues: _.pluck(colorOptions, "key"), diff --git a/rpg-docs/client/views/character/inventory/inventory.html b/rpg-docs/client/views/character/inventory/inventory.html index f16bd4bc..af154eea 100644 --- a/rpg-docs/client/views/character/inventory/inventory.html +++ b/rpg-docs/client/views/character/inventory/inventory.html @@ -121,11 +121,24 @@ diff --git a/rpg-docs/client/views/character/inventory/inventory.js b/rpg-docs/client/views/character/inventory/inventory.js index ae0a4ce0..a1c54cd3 100644 --- a/rpg-docs/client/views/character/inventory/inventory.js +++ b/rpg-docs/client/views/character/inventory/inventory.js @@ -145,6 +145,17 @@ Template.inventory.events({ heroId: itemId, }); }, + "tap .incrementButtons": function(event) { + event.stopPropagation(); + }, + "tap .addItemQuantity": function(event) { + var itemId = this._id; + Items.update(itemId, {$set: {quantity: this.quantity + 1}}); + }, + "tap .subItemQuantity": function(event) { + var itemId = this._id; + Items.update(itemId, {$set: {quantity: this.quantity - 1}}); + }, "tap .itemContainer .top": function(event){ GlobalUI.setDetail({ template: "containerDialog", @@ -167,6 +178,9 @@ Template.inventoryItem.helpers({ ne1: function(num){ return num !== 1; }, + lt1: function(num) { + return num < 1; + }, hidden: function(){ return Session.equals("inventory.dragItemId", this._id) ? "hidden" : null; }, diff --git a/rpg-docs/client/views/character/inventory/itemDialog/itemDialog.html b/rpg-docs/client/views/character/inventory/itemDialog/itemDialog.html index 9271fd25..3b67667d 100644 --- a/rpg-docs/client/views/character/inventory/itemDialog/itemDialog.html +++ b/rpg-docs/client/views/character/inventory/itemDialog/itemDialog.html @@ -19,7 +19,7 @@ {{#if description}}
-
{{description}}
+
{{evaluateString charId description}}
{{/if}} {{> effectsViewList charId=charId parentId=_id}} {{> attacksViewList charId=charId parentId=_id}} @@ -28,10 +28,25 @@