var/list/posterypes = list()
var/list/icon_states = list(icon_states('icons/obj/machinery/holoposter.dmi'))
for(var/key = 1 to length(icon_states))
postertypes.Add(list(
"poster_name" = icon_states[key];
"poster_icon" = ))
Problem description:
So, what I am trying to achieve here is a list that contains the names of all icon states with their associated icon. How would I go about doing that?
The byond ref says that the icon_states() proc only returns a string with the names.
Per the ref, icon_states just returns a list of strings that are the names of the states. You can then use the icon() proc, passing the file and key, to get an icon.
Please know that icon_states() is expensive due to being a file operation, so this should be cached. Additionally, this pattern as a whole is odd, why don't you just make datums to contain this information?