Browse Source

fixes #787

tags/v0.2.1^2
Big Bad Waffle 5 years ago
parent
commit
9c32706f3a
2 changed files with 12 additions and 2 deletions
  1. +1
    -1
      src/client/js/components/inventory.js
  2. +11
    -1
      src/client/ui/templates/hud/hud.js

+ 1
- 1
src/client/js/components/inventory.js View File

@@ -16,7 +16,7 @@ define([

if (blueprint.destroyItems) {
rerender = true;
events.emit('onDestroyItems', blueprint.destroyItems);
events.emit('onDestroyItems', blueprint.destroyItems, this.items);
}

if (blueprint.getItems) {


+ 11
- 1
src/client/ui/templates/hud/hud.js View File

@@ -19,7 +19,7 @@ define([
this.onEvent('onGetStats', this.events.onGetStats.bind(this));
this.onEvent('onGetPortrait', this.events.onGetPortrait.bind(this));
this.onEvent('onGetItems', this.events.onGetItems.bind(this));
this.onEvent('onDestroyItems', this.events.onGetItems.bind(this));
this.onEvent('onDestroyItems', this.events.onDestroyItems.bind(this));
this.onEvent('onKeyDown', this.events.onKeyDown.bind(this));
},

@@ -74,6 +74,16 @@ define([
});
},

onDestroyItems: function (itemIds) {
const quickItem = this.items.find(f => f.has('quickSlot'));
if (!quickItem || itemIds.includes(quickItem.id)) {
this.find('.quickItem')
.hide()
.find('.icon')
.css('background', '');
}
},

onGetItems: function (items) {
this.items = items;



Loading…
Cancel
Save