Does anyone know if its possible to modify yanfly's plugin to allow the player to manually sort items in their inventory?
Yanfly Itemcore Sort?
● ARCHIVED · READ-ONLY
-
-
theoretically yes, practically that is not a simple modification but a big rewrite of the inventory screen.
-
My idea was more of a hack then a re-write.
I sort of got it working. This basically returns the regular sort if the item has no sort id, otherwise returns the sort id.
But I'm stuck basically moving items one slot at a time up or down... anyone have any better ideas?
Game_Party.prototype.independentItemSort = function(a, b) {
var aa = (a.baseItemId) ? a.baseItemId : a.id;
if (!(a._sortid === undefined)) aa = a._sortid;
var bb = (b.baseItemId) ? b.baseItemId : b.id;
if (!(b._sortid === undefined)) bb = b._sortid;
if (aa < bb) return -1;
if (aa >= bb) return 1;
return 0;
};
Scene_Item.prototype.onMoveSortD = function() {
if (!(this.item()._sortid === undefined)) this.item()._sortid -= 1;
else {
this.item()._sortid = this.item().id -1;
}
if (this.item()._sortid < 0) this.item()._sortid = 0;
this._itemActionWindow.hide();
this._itemActionWindow.deactivate();
this._itemWindow.activate();
};