ID:165985
 
ive drawn an item named sunglasses but when i buy it it doesnt show up in my inventory panel how do i make it show up???
HH
Please show us a snippet of your Statpanel for the inventory >_>

- GhostAnime

mob/Stat()
statpanel("Inventory",src.contents)//test and see what happens
..()
In response to GhostAnime
statpanel("Inventory")
for(var/obj/Equipment/O in contents)
stat(O)
stat("--------","")
stat("Current Dragonballs")
for(var/obj/Dragonballs/O in contents)
stat(O)


this is what it says so i dont think i should add the src.contents in it right?
In response to HolyhaloIII
Than I guess the problem is that the path for the sunglasses is NOT under /obj/Equipment because only those types are added under inventory.


Solutions: i) Either make the glasses item path /obj/Equipment/ or ii) add another for() in the inventory stat() to look for

Example of Solution ii:
if(statpanel("Inventory"))//the if here is to check if the tab is currently selected. Meaning that the following will not happen if the person is not viewing that tab. Can help reduce some potential client lag
for(var/obj/Items/O in contents) stat(O)//This is what I meant in solution ii)
for(var/obj/Equipment/O in contents) stat(O)
stat("--------","")
Rest you know how it goes


- GhostAnime
In response to GhostAnime
obj/Equipment

Sunglasses
name = "Sunglasses"
density = 0

equiped = 0
value = 500

anti_decay = 0


var
sunglasses

Click()
if(src in usr:contents)
if(usr.sunglasses_eq == 0)
if(usr.sunglasses == 0)
usr.overlays += sunglasses
usr << "You have equiped the: <u>[src]</u>."
suffix = "(Worn)"
usr.sunglasses = 1
usr.sunglasses_eq = 1
src.equiped = 1
else
if(usr.sunglasses == 1)
if(src.equiped == 1)
usr.overlays -= sunglasses
usr << "You have unequiped the: <u>[src]</u>."
suffix = null
usr.sunglasses = 0
usr.sunglasses_eq = 0
src.equiped = 0

else

usr << "Error: </b>You may only have one of: <u>[src.name]</u> equiped."
return


verb

Examine()
set category = null
var/examine_sunglasses = "<body bgcolor=#000000 text=#FFFFFF><table border=0 cellspacing=1 width=250 id=AutoNumber1 height=210><tr><td width=273 colspan=2 height=18><font face=Verdana color=#FF0000>Sunglasses</font></b></td></tr><tr><td width=96 height=12><font size=1 color=red face=Verdana>Condition:</font></b></td><td width=170 height=12><font size=1><font face=Verdana>[condition]</font></b></font><font size=1 face=Verdana> / [condition_max]</font></b></td></tr><tr><td width=96 height=12><font face=Verdana size=1 color=#FF0000>Trait</font><font size=1 color=red face=Verdana>:</font></b></td><td width=174 height=12><font face=Verdana size=1>Clothing</font></b></td></tr><tr><td width=96 height=12><font face=Verdana size=1 color=#FF0000>Owner:</font></b></td><td width=174 height=12><font face=Verdana size=1>[usr]</font></b></td></tr><tr><td width=273 colspan=2 height=48 style=font-family: Verdana; font-size: 8pt; font-weight: bold><font face=Verdana size=1>A pair of Sunglasses.</font></b></td></tr></table>"
usr << browse(examine_sunglasses,"window=Sunglasses;size=300x275;border=0;can_resize=0; can_minimize=0;")

Pick_Up()
set src in oview(0)
set category = null
if(Move(usr))
usr << "You have picked up the: <u>[src]</u>."
usr.inven_min += 1
else
usr << "You are unable to pick up the: <u>[src]</u>."

Drop()
set category = null
if(src.equiped == 0)
src.loc = usr.loc
usr << "You have dropped the: <u>[src]</u>."
usr.inven_min -= 1
else
usr << "You are unable to drop: <u>[src.name]</u>, it's already equipped."


but it is... so i dont see why i should add the items variable