Back to main menu function

More
20 years 2 days ago #18060 by Second Chance
Does anyone know the name of the function and package that is used to send the player all the way back to the main menu from any other menu? You know the one I mean, the one attached to the lower of the two back buttons. Or will I have to write my own?

mailto:second_chance@cox.net
The Ultimate Guide To Modding: I-War 2 - Edge Of Chaos (on hold during SW MP mod)
cartoons.sev.com.au/index.php?catid=4
.

Please Log in or Create an account to join the conversation.

More
20 years 1 day ago #9838 by MajorTom
Replied by MajorTom on topic Back to main menu function
It depends :D
Gui doesn't track the number of screen overlays for you

if you use something like:
iGUI.AddBackButtons( hwindow parent, string back_function, string back_to_main_menu_function );
You'll have to write your own "back_to_main_menu_function" .
That will typically contain nothing more than a GUI.PopScreen (); (or several)

That is of course assuming you don't have/need to destroy any globals you set somewhere in the gui function blocks when you leave the GUI.

If you are working with focused buttons and set focus you might also want to take a look at:
GUI.SetControlFocusCancelFunction( string function );
The function called there would typically be your "back_to_main_menu_function" or your "back_function"

Iwar2 Multiplayer Fan Site

Please Log in or Create an account to join the conversation.

More
20 years 1 day ago #9842 by Second Chance
Thanks MajorTom. I'm currently using iGUI.AddBackButtons(), but both back functions use the same function and just remove the last overlay (a really, really wide shady bar). This is the first time I've even looked at the GUI functions (I hate doing GUI stuff) and still have plenty to figure out. You wouldn't happen to have a list of screen classes would you? I'd like to make a new screen instead of just a shady bar, but I don't have the name of a valid FiScreen derived class to use. Or should I just call GUI.CurrentScreenClassname() into a string and use that? Is there even more than one valid screen class?

If I can make a new screen, then GUI.PopScreen() twice (my screen, the Extras screen) should do the trick, right?

Thanks again.

mailto:second_chance@cox.net
The Ultimate Guide To Modding: I-War 2 - Edge Of Chaos (on hold during SW MP mod)
cartoons.sev.com.au/index.php?catid=4
.

Please Log in or Create an account to join the conversation.

More
20 years 1 day ago #9844 by MajorTom
Replied by MajorTom on topic Back to main menu function
Sorry I don't have a list of screen classes. You can sometimes guess at them by looking at the screen stack at the bottom left when in debug mode. I really don't care for GUI stuff either and have mostly just worked with overlays on top of existing screens, or replacements for them.

As you probably noted, there is also a call for PopScreensTo, but I haven't used it or seen it used much in the stuff I've looked at. I have seen GUI.PopScreen() used twice, one call right after another, very often


Iwar2 Multiplayer Fan Site

Please Log in or Create an account to join the conversation.