(07-29-2011, 11:39)Puffiamo Wrote: I have created a menu like changeclass.menu, i have added:
Code:
menufile,menufile,ui_mp\scriptmenus\changeoffhand.menu
Now how I can open it by another menu? i use this:
Quote:open "menu name"
but it doesnt work, i have to precache menu?
PS: my menu is not like a quickmessage
If the menuDef struct there is a line that says:
name "yourMenuNameHere".
Somewhere in a GSC file, preachce the menu using:
precacheMenu("yourMenuNameHere");
and you open the menu using:
self openMenu("yourMenuNameHere");
Pretty straight forward...
Oh wait.... 'open it by another menu'. didn't see that.
-------
Can't you just handle the message through the onMenuResponse loop and then open it through there?
Example:
In the menu file somewhere, add this when you want the other menu to open.
scriptMenuResponse "open_other_menu";
In the onMenuRespose loop,
Code:
onMenuResponse()
{
self endon( "death" );
self endon( "disconnect" );
while( true )
{
self waittill( "menuresponse", menu, response );
if( response == "open_other_menu" )
{
self closeMenus();
self openMenu("other_menu_name_here");
}
}
}