ID:264831
 
Code:
DblClick()
set
src in usr
var/items = 0
var/total = 0
if(src.carted)
src.count = 1
src.carted = 0
for(var/obj/Buyitem/B in usr.contents)
if(B.carted)
winset(usr,"Shopping.cart","current-cell=1,[++items]")
usr << output(B,"Shopping.cart")
winset(usr,"Shopping.cart","current-cell=2,[items]")
usr << output("[B.count]","Shopping.cart")
winset(usr,"Shopping.cart","cells=2x[items]")
return
var/amt = input("How many do you want?","Amount") as null | num
if(amt <= 0)
return
amt = round(amt)
src.count = amt
src.carted = 1
for(var/obj/Buyitem/B in usr.contents)
if(B.carted)
winset(usr,"Shopping.cart","current-cell=1,[++items]")
usr << output(B,"Shopping.cart")
winset(usr,"Shopping.cart","current-cell=2,[items]")
usr << output("[B.count]","Shopping.cart")
total += B.Value*B.count
winset(usr,"Shopping.cart","cells=2x[items]")
usr << output("[total]","Shopping.totalvalue")


Problem description:
Basically, I'm working on a shopping interface that lists the items the shop keep has for sale in a grid. Those items are invisibly added to the players contents (and removed after transaction is complete or the window is closed). When the player double clicks the obj, they are asked to input how many they want and then its added to the cart. But for some reason, the cart grid won't display the name or the number purchased, although the total counter registers it properly and the first grid does display the name. Can anyone help me figure out why?


Is your cart set to be a "flexible list of entries"?
In response to Garthor
No, that box is unchecked. I remembered when you told me last time.