NOTE: NONE OF THIS HAS BEEN IMPLEMENTED, AND MAY NEVER BE. YES, I KNOW THAT IT WAS SAID THAT UI EDITS WILL LIKELY NOT BE DONE UNTIL AFTER THE PSN RELEASE. THESE ARE JUST MY IDEAS THAT I AM SUBMITTING FOR CRITIQUE.
Purple text is used for notes that are not necessary to the rest of the text, but explain my ideas more.
I was thinking how the UI/bar at the bottom of could be edited via LUA came up with this. I don't know how hard it would be for Alex and Rudolf, but for us, the basics are fairly simple, though the more advanced bits are *more advanced*. Here goes:
All user edits to the bar are contained in a single button (to stop massive overflows), which pops up a menu when clicked on (think dropdown/up list) with buttons for all of the user UI changes. These could be buttons that open popups, or just do something in-game. They are all added in LUA by something like AddToUI(name, text, enabled). NAME is the way in which the button is referenced in the LUA in text, so it's easier to work with. I didn't want ID because that would imply a number, as in GetAsteroid(ID), and they are more likely to cause problems. An example would be when two people each create a UI edit and use the number 1 as the ID. While they are using it themselves, they are fine, they know what to do. If another person was to use both edits, they could copy them into their level code, and the IDs would clash. If names are used, there is much less chance of this. TEXT is what is displayed on the button as a string (eg "Rally here"), possibly with variables added in it (eg "Rally here :" + TotalSeedlingCapacity ). ENABLED is, oddly enough, whether the button is enabled. THis would be done in LevelSetup()
Now, how does this all work when clicked on? Thanks to a function called OnUserUIClicked(name). This is simply a function that is called whenever a user UI button is clicked. For example, an option that, when clicked, sets the variable 'monkey' to equal 345776.9, and one to set 'cheese' to 123. The example below assumes that the buttons have been created previously.
OnUserUIClicked(name)
if name == "setMonkey" then
monkey = 345776.9
end
if name == "wheeee" then
cheese = 123
end
end
Note that while the example does not do anything other than change the value of variables, it could do anything, such as move seedlings around, set the camera's position, or open a popup, will be covered in an edit below when I have typed it, to break up the WOT.