ID:264834
 
Code:
mob
proc
Buyinterface(var/list/sale)
if(!winexists(src,"Shopping"))
winclone(src,"Buy","Shopping")
winshow(src, "Shopping",1)
src << output(null,"Shopping.totalvalue")
src << output(null,"Shopping.itembrowser")
winset(src,"Shopping.keeper","cells=null")
winset(src,"Shopping.cart","cells=null")
winset(src, "Shopping.buy", "text=Buy;command=Purchase")
winset(src,"Shopping.shoplabel","text=Shopkeep")
var/items = 0
for(var/obj/item/I in sale)
if(I)
var/obj/Buyitem/B = new()
B.icon = I.icon
B.icon_state = I.icon_state
B.name = I.name
B.Attack = I.Attack
B.Defense = I.Defense
B.Resist = I.Resist
B.Magic = I.Magic
B.Value = I.Value
B.checkdesc = I.checkdesc
B.itemtype = I.type
B.Acc = I.Acc
B.Evade = I.Evade
B.Equipped = I.Equipped
B.Required_Level = I.Required_Level
src.contents += B
for(var/obj/Buyitem/K in src.contents)
winset(src,"Shopping.keeper","current-cell=1,[++items]")
src << output(K,"Shopping.keeper")
winset(src, "Shopping.keeper","cells=2x[items]")

forsale = list(new /obj/item/potion/Healing_Potion, new /obj/item/potion/Mana_Potion, new/obj/item/potion/Antidote, new /obj/item/enhancer/World_Map, new /obj/item/potion/Stamina_Potion)

I'm unsure why, but from time to time when the interface is called, it won't populate the grids. I'm not getting any runtimes or anything though. I'm sure I've done something wrong here, but what could it be?

I've still had no luck with this. I'm not sure if it's on a timed basis or something, but it seems to work at first then stop working after awhile, as if the items existed for a bit then were deleted.....hmmm actually I may have just solved it. I'll post again if not.