Big Bad Waffle 5 роки тому
джерело
коміт
9c32706f3a
2 змінених файлів з 12 додано та 2 видалено
  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 Переглянути файл

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


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


if (blueprint.getItems) { if (blueprint.getItems) {


+ 11
- 1
src/client/ui/templates/hud/hud.js Переглянути файл

@@ -19,7 +19,7 @@ define([
this.onEvent('onGetStats', this.events.onGetStats.bind(this)); this.onEvent('onGetStats', this.events.onGetStats.bind(this));
this.onEvent('onGetPortrait', this.events.onGetPortrait.bind(this)); this.onEvent('onGetPortrait', this.events.onGetPortrait.bind(this));
this.onEvent('onGetItems', this.events.onGetItems.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)); 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) { onGetItems: function (items) {
this.items = items; this.items = items;




Завантаження…
Відмінити
Зберегти