I noticed the herb sorting was bugged - namely, if there are more than maxstackcount (default 15) herbs in a row, they are invisible.
I investigated and found that the algorithm that makes the y offset when the row is full is totally bugged and is setting the y value of the herb to infinity.
I also found other random cruft that appeared either to have no effect or to do something strange that I didn't understand.
I rewrote the code locally so I could use it. But I thought it might be nice to share with the devs/other users so here it is.
In HerbToolConfig.cs you change this block ("..." is a placeholder for the old code)
- Code: Select all
function InventoryOrganizer::sortHerb(%this, %herbId, %invItem, %stackCount){...}
with this one:
- Code: Select all
function InventoryOrganizer::sortHerb(%this, %herbId, %invItem, %stackCount){
%usedcount = %stackCount;
%yoffset = 0;
%xoffset = 0;
for (; %usedcount>=InventoryOrganizer.maxstackcount; %i++){
%usedcount-=InventoryOrganizer.maxstackcount;
%yoffset+=InventoryOrganizer.stackSpace;
}
%row = %herbId;
%x = InventoryOrganizer.startX + (InventoryOrganizer.stackSpace*%usedcount)+%xoffset;
%y = InventoryOrganizer.startY + (%row*InventoryOrganizer.spaceY) + %yoffset;
%pos = %x @ " " @ %y;
%invItem.position = %pos;
}
Side effect:
1. The variable "rows" is no longer used. There will automatically be the same number of rows as the highest number you use for herbId (default 6). Changing this variable will no longer have any effect.
Note to devs:
InventoryOrganizer.factorY and InventoryOrganizer.factorX were returning nothing, so dividing by them was resulting in infinite coordinates. This might be because of how I set up my main config but I could not find a place to set these values. Either way the way I set it up in the code above is cleaner and more sensible imo.
for anyone that is curious, the settings I use to keep as many herbs in the window as possible while not covering any of the count/quality indicators are:
- Code: Select all
startX = 2;
startY = 32;
stackSpace = 25;
maxstackcount = 13;
spaceY = 64;