winshow(src,"Inventory",0) //Hide the inventory window!
set hidden = 1
winshow(src,"Inventory",1) //Show the inventory window!
var/Position = winget(src, "default", "pos") // Get the position of the "default" window and assign it to a var called "Position"
winset(src,"Inventory","pos='[Position]'") // Set the position of the "Inventory" window to the same position as our main window.
src.client.screen = null
for(var/Column = 1 to 5) for(var/Row = 1 to 5) //Create a grid composed of 5 columns and 5 rows.
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) //Generate the items on slots.
for(var/Grid/G in src.client.screen)
I.screen_loc = G.screen_loc ; src.client.screen+=I
G.used =1 ; return
parent_type = /obj
icon = 'Inventory_slot.dmi'
icon_state = "Grid"
var/used = 0
winshow(src,"Description",1) // Show the description window
var/Position = winget(src, "Inventory", "pos") // Get the position of the "Inventory" window and assign it to a var called "Position"
winset(src,"Description","pos='[Position]'") // Set the position of the "Description" window to the same position as our inventory.
winset(src,"Description.Text","text='This is a [I]'") // Add some text to describe that item...
set hidden = 1
winshow(src,"Description",0) // Hide the description window
//dragging items and dropping in inventory
MouseDrag(src_object,over_object,src_location,over_location,src_control,over_control,params)// When we drag it...
if(!(src in usr.contents)) return // If its not in our inventory...just cancel ...
var/icon/I = new(src.icon,src.icon_state)//this is so the cursor icon transforms into the item itself...cool little effect.
mouse_drag_pointer = I // now lets set the mouse cursor to that.
MouseDrop(over_object=src,src_location,over_location, src_control,over_control,params) //When we drop it...
if(over_control =="Inventory.Inv") //If its inside the inventory window.
var/obj/O = over_object
src.screen_loc = O.screen_loc //Move the object on the new slot.
I am using Kidpaddles inventory library for my game and I'm trying to figure out how to fix the problem where even if the inventory is full, the item that you add in the inventory disappears and no longer usable. I have tried testing mouse procs but it was giving me runtime errors.