I’ve written a new tool: the UI generation program. It lets you draw boxes, then generates a decent chunk of the LUA it takes to display them in game, leaving you to fill in the types, and any data specific to each type of element.
The controls: Left and right arrows switch the active element. You can move things around by clicking one corner of where you want it to be, then clicking the opposite corner. Enter switches to text entry mode, type in some letters and hit enter again to exit that mode and name whatever element you have selected. Note that the program will appear to freeze in this mode. I might do something about that later, but it’s not really a problem, just confusing if you hit enter by accident.
Hit the right arrow until nothing is red, then click in two different places to start dropping in new boxes.
Hit “i” to import. I’ve included a saved version of what I’m working on first- the trade window.
Hit “e” to export. This overwrites whatever was exported last, erasing it if you don’t import first or rename exportedUI.txt, which is where everything goes.
Up and down arrows switch between multiple “screens”. Useful for not overwriting old screens.
Hit “a” to align all elements with the same name, or names that are the same except for a number, like “icon1” and “icon2”. This is where a lot of the work went. It lines everything up, then searches for similar distances apart and makes all those uniform too. This will really mess you up if you don’t name ANY of your elements, but if the only things with matching names are things you want lined up, like in that trade window, it goes from really messy (since you’re just drawing boxes freehand,basically) to perfectly lined up in one button press. It was really satisfying to see it work for the first time. This function is basically why I even bothered writing this program- I really, really didn’t want to have to sit there typing in x and y coordinates by hand, then getting out a calculator figuring out what the next value needs to be to make it the same distance away as the last one. That’s what computers are for!
Lastly, check exportedUI.txt for the raw data, followed by some cut-and-paste LUA.
-
Recent Posts
Recent Comments
- Alex on Planet data: More flexibility
- Richard on Planet data: More flexibility
Archives
Categories
Meta