Author Topic: UI edits  (Read 4067 times)

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
UI edits
« on: October 09, 2010, 03:07:21 AM »
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.
« Last Edit: November 29, 2010, 12:33:19 AM by Pilchard123 »

AWS

  • Achiever
  • Arboreal Being
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 275
Re: UI edits
« Reply #1 on: October 23, 2010, 11:52:46 PM »
i think its fair to say that you pilchard, are a veritable idea machine!! :o

where do your ideas and suggestions come from?! so many, and all technical and generally very astute.

tbh, ive been wanting a better UI and general menu screen since day 1. (sorry Alex :)  It's always seemd a little... rough, or basic, or something.

:)

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: UI edits
« Reply #2 on: October 24, 2010, 01:35:35 AM »
i think its fair to say that you pilchard, are a veritable idea machine!! :o

Thanks!

where do your ideas and suggestions come from?! so many, and all technical and generally very astute.

I have no idea. Really all I do is think "What do I/other people think could be improved/added here? How would I do it?"

I really should get on with writing the next bit...
« Last Edit: October 24, 2010, 01:38:52 AM by Pilchard123 »