ID:2206756
 
so one grid works perfectly fine and adds the items with icons fine but the 2nd one uses the same exact stuff expect i changed a few things to make it different and now the icon wont add to the grid just the name of the item to the list

this doesn't work v
mob
var
list/ShopInventory = list()



obj
Items
icon='hud.dmi'
var
itemdes


proc
IDescription()
winset(usr,"iteminfo","text='[itemdes]'")

Click()
IDescription()

Weapons
icon_state="bag"
Kunai
name="Kunai"
itemdes="Price:$500"


mob
verb
Getitems()
usr.ShopInventory+=new/obj/Items/Weapons/Kunai

Showitems()
usr << output(null,"Shop.shopgrid") // clear the grid.
for(var/obj/z in usr.ShopInventory)
usr << output(z,"Shop.shopgrid:1,[usr.ShopInventory.Find(z)]")


yet this does

mob
var
list/CraftPassives = list()



obj
Jutsus
icon='hud.dmi'
var
jutsudes
hands



proc
Description()
winset(usr,"passiveinfo","text='[jutsudes]'")
winset(usr,"hands","text='[hands]'")

Click()
Description()

Fire
icon_state="Fire"
Great_Fireball
name="Great Fireball"
jutsudes="A big fireball"
hands="Dragon,Ox,Snake"
mob
verb
Learnpassives()

usr.CraftPassives+=new/obj/Jutsus/Fire/Great_Fireball


ShowPassives()
usr << output(null,"passives.paslist") // clear the grid.
for(var/obj/O in usr.CraftPassives)
usr << output(O,"passives.paslist:1,[usr.CraftPassives.Find(O)]")


i checked the interface files everything is exactly the same settings and i made sure the path for the icon is right so what is wrong? is this a grid bug?
http://imgur.com/a/NHVk4

is what is happening i checked both grids they have the exact same settings
check if it still happens in the stable build
if it does then somethings wrong with ur code/interface


edit: nvm i thought u were talking about a diff issue
I deleted the bug report on this because, just like last time, there was nowhere near enough substantive information and you have not yet ruled out a code problem.

More concerning, you're still using code that was corrected for you in another thread several weeks ago. The ShowPassives() verb should not be a verb at all, but a proc; that Find() call is very bad and should be replaced with a simple counter var; things like that are cluttering up your code--and make it all the more likely that a code problem is in play.

I'm willing to take a look at your code and see what's wrong, if you want to send me a link via the pager. I'll also need explicit instructions on how to get to a point where the bug appears and what to look for, and those instructions should include any info on how to get through a character creation screen (if any) as quickly as possible.
i know its suppose to be a proc but its just basic code for the time being to test things out. and how would i code this counter var exactly?

var/counter

counter++
usr << output(O,"passives.paslist:1,[counter]")

something like that?
Something like that. It'd actually be more like this:

src << output(O,"passives.paslist:1,[++counter]")

That's src instead of usr because this shouldn't be a verb; and in this case, src is correct for both.

What concerns me here is that you had advice a couple of weeks ago as to how you could redo this system properly, but you didn't take it. Bad code is cluttering up your work environment, which means it's going to be really hard to debug any issues that come along because it's impossible to tell if they're related to the code you should have fixed already but haven't.

Getting the design right closer to the beginning is better than waiting to make changes far down the road. The longer you live with a simple placeholder system, the easier it is to get stuck with it.

Also, back when I gave you that advice as to how to change that code, I told you point blank that the line you think is clearing the grid does not do that; it clears the current cell only. So it's not just that you're carrying inefficient code forward; you're carrying forward some code that's actually broken.

I'm going to give you a proc here that you can use for all list-style grids. Use it for all of those situations.

proc/RefreshGridList(mob/M, gridname, list/L)
var/i, len = L ? L.len : 0
winset(M, gridname, "cells=[len]")
for(i=1, i<=len, ++i)
M << output(L[i], "[gridname]:[i]")

As you can see, the first thing it does is set the number of cells, which will shorten the grid if the list has gotten shorter since last time; that part is important. Then each item is output in turn, into the correct cell.

The list L is type-agnostic. It doesn't care what the type is because it's not doing a loop like for(var/obj/thing/O in L); it's simply going through by index. That means L could be text, or objs, or even a mix of items for all the grid cares.

This will not solve the problem of names not appearing. What it will do is give you the means to clear out some bad code you appear to be reusing in multiple places, and therefore make it easier to diagnose the problem.
so where it says gridname i put the name of the grid element but what do i do about the list of skills do i change the list/L part to the list of passives?