I have been searching the forums for an answer, but no luck, so here's my question:
(Thank you in advance to anyone who reads this)
I am trying to make a tour with 3 languages, so I have made several information window popups in the three languages.
I want to get the url value of a plugin as a string and then subtract some letters off the string, and then add some letters.
I mean I want to get a url value like "image_e.png" (my english image) then take off the "e.png" part and add a "c.png" (my chinese image path)
If this would work, it would be easy to change values like
image1e.png to image1c.png
image2e.png to image2c.png
image3e.png to image3c.png
This is what I want to do.
I was not able to figure out how to do this, so I decided to use the name of the plugin instead and just add to it. I'm still not sure how to make this work.
So for example I have
<plugin name="info1" url="images/info1e.png" keep="true" visible="false" alpha="0" origin="center" width="342" height="290" selectable="false" onclick="set(plugin[i_hide1].visible,false); set(plugin[i_show1].visible,true); tween(plugin[info1].alpha,0); set(plugin[info1].enabled,false);" />
I want to use name="info1" and an action called show_chinese to calculate the correct url and then assign it.
<action name="show_chinese">
set(path,get(plugin[info1].name)); // should set the variable $path = info1
path = path + "c.png" // not correct syntax, but I want this line to add a c.png to $path
set(plugin[info1].url, path); // This line will set a new value for [info1].url
</action>
So in summary, I want to learn how to do this the easiest way for now (probably the second approach), but also want to learn all about how to manipulate strings in my xml. Any advice or links to other threads/documentation would be very appreciated.
Thank you!
P.S. Are nested if loops possible in xml?