So Im trying to have the background image file change based on what nation they are in. right now Im using a if this nation then image=this file system and it works but I have to change a bunch of windows colors so I created an associate list and I got it to work for everything except the background image for the main window. Heres the code
Code:
//this is for the windows no real problem with this and the list
var/list/setup=list("Earth Kingdomb"="#7C581B","Earth Kingdom"="#2F4A13","Fire Nationb"="#D68B10","Fire Nation"="#4D1F13","Air Nomadb"="#BE541B","Air Nomad"="#E6B042","Water Tribeb"="#E9F3F5","Water Tribe"="#52628D")
winset(src,null,"chatoutput.background-color=[setup[src.Nation]];chatinput.background-color=[setup[src.Nation]];output1.background-color=[setup[src.Nation]]")
//using this currently for each nation but trying to figure out how to put a variable in the file lookup
if(src.Nation=="Earth Kingdom")
winset(src,"MainWindow","image=['backgroundearth.png']")
Im trying to do some can of entry for the file name in the list and have it load it that way so something like this
winset(src,"MainWindow","image=['[setup[[src.Nation]background]]']")
You'd have to handle it differently, for example by matching the identifier to the resource file reference.