mob
verb
InventoryWindow()
if(!Inventory_Window)
Inventory_Window=1
winset(usr,"Inventory","is-visible=true")
for(var/obj/Items/O in usr.client.screen)
client.screen-=O
var/Position = winget(src, "Main", "pos")
winset(src,"Inventory","pos='[Position]'")
for(var/Column = 1 to 3) for(var/Row = 1 to 7)
var/Grid/G = new
G.screen_loc = "Inv:[Row],[Column]"
src.client.screen += G
for(var/obj/Items/I in src.contents)
src.AddItems(I)
Update(src)
else
Inventory_Window=0
mob/proc/AddItems(obj/Items/I)
for(var/Grid/G in src.client.screen)
if(G.used) continue
I.screen_loc = G.screen_loc ; src.client.screen+=I
I.maptext="[I.Amount]"
G.used =1 ; return
Grid
parent_type = /obj
icon = 'Inv.png'
var/used = 0
obj/Items
MouseDrag(src_object,over_object,src_location,over_location,src_control,over_control,params)
if(!(src in usr.contents)) return
var/icon/I = new(src.icon,src.icon_state)
mouse_drag_pointer = I
MouseDrop(over_object=src,src_location,over_location, src_control,over_control,params)
if(over_control =="Inventory.Inv") .
var/obj/O = over_object
src.screen_loc = O.screen_loc
Problem description:
1. Every-time the inv is open the items move to the next cell until it hits the end and restarts.
2. if you move the items manually that works, BUT if you close and reopen after moving the items it will put all items back to where they were then move them 1 cell over.