If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Multiple console commands in a menu

i used the scaleform video on youtube to create my menu but the problem is that i can only open one command. currently i have one clik button which opens a map, and the other click button is meant to exit the game. the only one which works at the moment is the map command. heres the code if anyone needs it:

//This is a switch statement, which means that it runs which ever bit of code matches the Widget name.
//If it doesnt find one that matches, it runs the default code;
switch(WidgetName)
{
case ('SecretBaseButton'):
SecretBaseButton = GFxClikWidget(Widget);
SecretBaseButton.AddEventListener('CLIK_press', OnSecretBasebuttonPress);
break;
default:
break;
}
// This line exits the function - THIS IS YOUR PROBLEM
return true;
//This is a switch statement, which means that it runs which ever bit of code matches the Widget name.
//If it doesnt find one that matches, it runs the default code;
switch(WidgetName)
{
case ('ExitButton'):
ExitButton = GFxClikWidget(Widget);
ExitButton.AddEventListener('CLIK_press', OnExitButtonPress);
break;
default:
break;
}
// This line exits the function
return true;

Hopefully you can see now that the reason your code only runs the map loading command (because you have a return true command after the first switch).
Removing it will make your code run correctly, but you've still missed the point of the switch statement. Heres how it should be written -