mob
proc
UpdateInvGrid()
var/x = 1
src << output ("Items","InvGrid:1,[x]")
for(var/obj/i in contents)
src << output(i,"InvGrid:1,[++x]")
src << output(i.Amount,"InvGrid:2,[++x]")
obj
Click()
if (src in oview(1,usr))
var/obj/Found //Var to tell if object is already in inventory
for(var/obj/O in usr.contents)
if(O.type == src.type)
Found = O
break
if(Found)
Found.Amount ++
del src
else
usr.contents += src
del src
usr << ("You picked up an [src.name]")
usr.UpdateInvGrid()
Problem description:
When I pick up an Item it's not showing into the inventory grid, and also is that the proper way to display amount in a grid? Or would you use a suffix anyways I am new to grids...
I use return [number] because I like to use procs in conditionals frequently, but it's not necessary.