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) {
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 Целия файл

@@ -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;



Зареждане…
Отказ
Запис