Browse Source

Merge branch '130-no-sort-inventory' into 'staging'

Resolve "The player inventory should not be automatically sorted"

See merge request !81
tags/v0.1.3^2
Big Bad Waffle 7 years ago
parent
commit
4dec75cceb
3 changed files with 387 additions and 24 deletions
  1. +0
    -24
      src/client/ui/templates/inventory/inventory.js
  2. +387
    -0
      src/server/config/maps/fjolarok/map.json
  3. BIN
     

+ 0
- 24
src/client/ui/templates/inventory/inventory.js View File

@@ -370,30 +370,6 @@ define([
onGetItems: function(items) {
this.items = items;

this.items.forEach(function(item) {
var prefix = -1;
['quest', 'material', 'ability'].forEach(function(p, i) {
if (item[p])
prefix += 1 + i;
});
if (prefix == -1)
prefix = 3 + item.slot + item.type;

item.sortName = prefix + item.name + item.level + item.id;

if ((item == this.hoverItem))
this.onHover(null, item);
}, this);

this.items.sort(function(a, b) {
if (a.sortName < b.sortName)
return -1;
else if (a.sortName > b.sortName)
return 1;
else
return 0;
});

if (this.shown)
this.build();
},


+ 387
- 0
src/server/config/maps/fjolarok/map.json
File diff suppressed because it is too large
View File


BIN
View File


Loading…
Cancel
Save