Hello guys, I just checked out KidPaddle45's Inventory library and I decided to use the knowledge gained from it and create my own Inventory system. Anyway, I have it somewhat working properly, and by that I mean it displays what its supposed to display and whatnot.
Now, on to the real problem:
I can't figure out how to arrange the items to appear in the proper order, I want it to display starting from the Top-Left of the screen, going horizontally from there on and continue its way all the way to the Bottom-Right.
The way I have it now it displays from the Bottom Left , going up towards the Top Left.
This is the code I'm currently using:
parent_type = /obj
icon = 'Inventory.dmi'
icon_state = "Slot"
var x_Slots = 5
var y_Slots = 5
var isUsed = FALSE
Visibility = visible
if(Visibility == "Show")
usr.client.screen = null
else if(Visibility == "Hide")
for(var/X = 1 to x_Slots) for(var/Y = 1 to y_Slots)
var/Inventory/Slots = new
Slots.screen_loc = "Slots:[X],[Y]"
for(var/obj/Items/Stuff in usr.contents)
for(var/Inventory/Slots in usr.client.screen)
Stuff.screen_loc = Slots.screen_loc
usr.client.screen += Stuff
Slots.isUsed = TRUE ; return
And this is a screen shot of what's currently happening:
Obviously point out anything that looks wrong or could use improvement.