I've begun writing a Python script that converts xml to galaxy code that creates dialogs. The purpose of this tool is to be able to quickly and easily layout the initial state of a dialog. This is how it works:
The first thing you do is create a Record in your triggers. Add a variable called "dialog" and set it to the Dialog type. Then add a variable for each dialog item you placed in the xml, and use the "name" value of your xml items as the variable names. For the xml I posted as an example, your trigger window should look something like this:
To use this script, you either need Python installed on your system (tested with 2.6, will probably work with older versions), or you could use the exe version (I do not recommend using exe's from random people on the internet). You must run it from command line with the xml file containing the dialog as the first argument. For example:
I put xml2galaxy.py and my test.xml file in a folder at c:\sc2
I open the folder in explorer, hold shift while right clicking on the explorer area, and click "Open command window here". (This will only work if no file is selected).
I then type the command: xml2galaxy.py test.xml
The galaxy code is now in output.galaxy
If you receive errors it might be a bug (let me know) or a typo in your xml file.
Right now it only does buttons, labels, progress bars, images, listboxs, pulldowns, and checkboxes. They also only take a few options. You can set more options from triggers in the editor for now. It is easy to change any of the items because they are in the record variable you create. So if you want to change the dialog, you just use the dialog functions in the trigger editor to modify the testDialog.dialog. You also create event responses the normal way. Just use the variables in the record for the events.
If anyone has problems or questions, let me know. Thanks!
I've begun writing a Python script that converts xml to galaxy code that creates dialogs. The purpose of this tool is to be able to quickly and easily layout the initial state of a dialog. This is how it works:
You give this xml to the script, and it returns something like this:
The first thing you do is create a Record in your triggers. Add a variable called "dialog" and set it to the Dialog type. Then add a variable for each dialog item you placed in the xml, and use the "name" value of your xml items as the variable names. For the xml I posted as an example, your trigger window should look something like this:
To use this script, you either need Python installed on your system (tested with 2.6, will probably work with older versions), or you could use the exe version (I do not recommend using exe's from random people on the internet). You must run it from command line with the xml file containing the dialog as the first argument. For example:
Right now it only does buttons, labels, progress bars, images, listboxs, pulldowns, and checkboxes. They also only take a few options. You can set more options from triggers in the editor for now. It is easy to change any of the items because they are in the record variable you create. So if you want to change the dialog, you just use the dialog functions in the trigger editor to modify the testDialog.dialog. You also create event responses the normal way. Just use the variables in the record for the events.
If anyone has problems or questions, let me know. Thanks!
DOWNLOAD (v0.1):
Hey man, this looks really cool. If I may, I'd like to suggest you to make a plugin for it in Moonlite: http://www.thehelper.net/forums/showthread.php/166237-Moonlite-Map-Studio-last-open-beta-release-date-announcement
It'd be really cool to have something like this, with its own file type, and then have the code generated at compile time.
Even if you decide not to do so, I'm definitely gonna use it. Just a heads up.