Browse Source

Merge branch '1704-inspect' into 'master'

Equipment UI: If onGetStats is received while inspecting, continue using inspected stats

Closes #1704

See merge request Isleward/isleward!556
merge-requests/556/merge
hazel 1 month ago
parent
commit
cb8e43cb06
1 changed files with 19 additions and 12 deletions
  1. +19
    -12
      src/client/ui/templates/equipment/equipment.js

+ 19
- 12
src/client/ui/templates/equipment/equipment.js View File

@@ -84,10 +84,14 @@ define([
},

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

if (!this.isInspecting)
if (!this.isInspecting && items)
this.items = items;
else if (!this.isInspecting)
items = this.items;
else if (!this.result)
return;
else
items = this.result.equipment;

if (!this.shown)
return;
@@ -187,13 +191,12 @@ define([

onInspectTarget: function (result) {
this.isInspecting = true;
this.result = result;

this.show();

this.result = result;

this.onGetStats(result.stats);
this.onGetItems(result.equipment);
this.onGetStats();
this.onGetItems();
},

buildSlot: function (el, e) {
@@ -367,12 +370,16 @@ define([
}
},

onGetStats: function (stats ) {
if (stats && !this.isInspecting)
onGetStats: function (stats) {
if (!this.isInspecting && stats)
this.stats = stats;

stats = stats || this.stats;

else if (!this.isInspecting)
stats = this.stats;
else if (!this.result)
return;
else
stats = this.result.stats;
if (!this.shown)
return;



Loading…
Cancel
Save