if(argv(0) == "skinselect")
{
- m_goto_skin_selector();
+ m_goto("skinselector");
return;
}
if(argv(0) == "languageselect")
{
- m_goto_language_selector();
+ m_goto("languageselector");
return;
}
if(argv(0) == "videosettings")
{
- m_goto_video_settings();
+ m_goto("videosettings");
return;
}
}
}
+string m_goto_buffer;
void m_init_delayed()
{
float fh, glob, n, i;
m_sync();
+ if(m_goto_buffer)
+ {
+ m_goto(m_goto_buffer);
+ strunzone(m_goto_buffer);
+ m_goto_buffer = string_null;
+ }
+
if(Menu_Active)
m_display(); // delayed menu display
}
{
entity e;
if(!menuInitialized)
+ {
+ if(m_goto_buffer)
+ strunzone(m_goto_buffer);
+ m_goto_buffer = strzone(itemname);
return;
+ }
if(itemname == "") // this can be called by GameCommand
{
if(gamestatus & (GAME_ISSERVER | GAME_CONNECTED))
+ {
m_hide();
+ }
else
{
m_activate_window(main.mainNexposee);
}
}
}
-
-void m_goto_skin_selector()
-{
- if(!menuInitialized)
- return;
- // TODO add code to switch back to the skin selector (no idea how to do it now)
- m_goto("skinselector");
-}
-
-void m_goto_language_selector()
-{
- if(!menuInitialized)
- return;
- // TODO add code to switch back to the language selector (no idea how to do it now)
- m_goto("languageselector");
-}
-
-void m_goto_video_settings()
-{
- if(!menuInitialized)
- return;
- // TODO add code to switch back to the video settings (no idea how to do it now)
- m_goto("videosettings");
-}
void m_hide();
void m_display();
void m_goto(string name);
-void m_goto_skin_selector();
-void m_goto_language_selector();
-void m_goto_video_settings();
.string name;
entity keyGrabber;
}
me.gotoRC(me, me.rows - 1, 0);
- me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "menu_cmd sync; vid_restart; menu_restart; defer 0.1 \"menu_cmd videosettings\"", COMMANDBUTTON_APPLY));
+ me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "menu_cmd sync; vid_restart; menu_restart; menu_cmd videosettings", COMMANDBUTTON_APPLY));
}
#endif
ATTRIB(XonoticLanguageList, name, string, "languageselector") // change this to make it noninteractive (for first run dialog)
- ATTRIB(XonoticLanguageList, doubleClickCommand, string, "prvm_language \"$_menu_prvm_language\"\nmenu_restart\ndefer 0.1 \"menu_cmd languageselect\"")
+ ATTRIB(XonoticLanguageList, doubleClickCommand, string, "prvm_language \"$_menu_prvm_language\"\nmenu_restart\nmenu_cmd languageselect")
ENDCLASS(XonoticLanguageList)
entity makeXonoticLanguageList();
void XonoticSkinList_setSkin(entity me)
{
me.saveCvars(me);
- localcmd("\nmenu_restart\ndefer 0.1 \"menu_cmd skinselect\"\n");
+ localcmd("\nmenu_restart\nmenu_cmd skinselect\n");
}
void SetSkin_Click(entity btn, entity me)