vid_width 1024
vid_height 768
vid_pixelheight 1
+set _menu_prvm_language ""
set _menu_vid_width "$vid_width"
set _menu_vid_height "$vid_height"
set _menu_vid_pixelheight "$vid_pixelheight"
{
cvar_set("_menu_alpha", "0");
prvm_language = strzone(cvar_string("prvm_language"));
+ cvar_set("_menu_prvm_language", prvm_language);
check_unacceptable_compiler_bugs();
me.TR(me);
me.TD(me, 6, 2, e = makeXonoticLanguageList());
e.name = "languageselector_firstrun";
- e.doubleClickCommand = "saveconfig; menu_restart; togglemenu";
+ e.doubleClickCommand = "prvm_language \"$_menu_prvm_language\"; saveconfig; menu_restart; togglemenu";
me.TR(me);
me.TR(me);
// because of the language selector, this is a menu_restart!
me.gotoRC(me, me.rows - 1, 0);
- me.TD(me, 1, me.columns, e = makeXonoticCommandButton(_("Save settings"), '0 0 0', "saveconfig; menu_restart; togglemenu", COMMANDBUTTON_APPLY));
+ me.TD(me, 1, me.columns, e = makeXonoticCommandButton(_("Save settings"), '0 0 0', "prvm_language \"$_menu_prvm_language\"; saveconfig; menu_restart; togglemenu", COMMANDBUTTON_APPLY));
setDependentWeird(e, CheckFirstRunButton);
}
#endif
ATTRIB(XonoticLanguageList, name, string, "languageselector") // change this to make it noninteractive (for first run dialog)
- ATTRIB(XonoticLanguageList, doubleClickCommand, string, "menu_restart\ntogglemenu\ndefer 0.1 \"menu_cmd languageselect\"")
+ ATTRIB(XonoticLanguageList, doubleClickCommand, string, "prvm_language \"$_menu_prvm_language\"\nmenu_restart\ntogglemenu\ndefer 0.1 \"menu_cmd languageselect\"")
ENDCLASS(XonoticLanguageList)
entity makeXonoticLanguageList();
{
string s;
float i, n;
- s = cvar_string("prvm_language");
+ s = cvar_string("_menu_prvm_language");
n = me.nItems;
// default to English
break;
}
}
+
+ // save it off (turning anything unknown into "en")
+ me.saveCvars(me);
}
void XonoticLanguageList_saveCvars(entity me)
{
- cvar_set("prvm_language", me.languageParameter(me, me.selectedItem, LANGPARM_ID));
+ cvar_set("_menu_prvm_language", me.languageParameter(me, me.selectedItem, LANGPARM_ID));
}
void XonoticLanguageList_clickListBoxItem(entity me, float i, vector where)