loftar wrote:SacreDoom wrote:Honestly, they should just remove the extra inventory from the merchant's robe and add tiered "pocket" gildings instead. Would make it easier to not always end up with merch robes every world.
I agree that is what should be done. The problem is that inventory space, currently, can only be added in whole rows and columns, so there's no way to add little enough that would be fitting for singular gildings. I'd like to make that viable, but I'm just not entirely sure how to formulate the inventory rules in such a way that it makes it reasonable to add singular slots.
Could you possibly set it up that it adds "inactive" columns and rows? So that way when a new "pocket" gilding is added, where it would exceed the current rows/columns, it adds a bunch of blank spaces that can't be used, and one empty space that can be.
Basically 5 x 5 area of inventory would become a 5 x 6(-5).
Looking something like this:
o o o o o o
o o o o o x
o o o o o x
o o o o o x
o o o o o x
Admittedly I have no idea what the real limitation is here. Because if it's a visual and function marriage problem, meaning you tied your functionality(how many inventory spaces) into your looks(the need to add a new row/column visual) a possible solution would be separate them out. Possibly make each cell it's own object, and make the inventory window scalable and the rows/columns rearrange themselves based on the dimensions of the window.
Each cell would need a set of constants, that define it's predetermined size, and a vector2 variable to determine its location inside the window Then the window itself would need a set of floats to keep track of the window's dimensions, as for determining the columns and rows needed:
var columns = (int)(window.width/cell.width);
var rows = (int)(window.height/cell.height);
as for displaying the cells.
- Code: Select all
var cellCount = 0;
for(var r = 0; r < rows; r++)
{
for(var c = 0; c < columns; c++)
{
if(cellCount < cells.length())
//place cell
cellCount++;
else
continue;
}
}
edit: Thank you mod, I didn't know I could do this.
Bonus points on making the cells their own objects, is that you could also set them to only take in certain objects, color code them, and give more variability with type of inventory used.
Admittedly, this probs isn't all that helpful. Considering I have no idea how the code even looks, or what this could break, or the daunting refactor that may need to take place lol. God, I hate it when I need to refactor my code... always happier after I do though lol