2 CLASS(XonoticModButton) EXTENDS(XonoticButton)
3 METHOD(XonoticModButton, configureXonoticModButton, void(entity, string))
4 ATTRIB(XonoticModButton, destination, string, string_null)
5 ENDCLASS(XonoticModButton)
6 entity makeXonoticModButton(string menu);
7 void XonoticModButton_Click(entity me, entity other);
11 entity makeXonoticModButton(string menu)
14 me = spawnXonoticModButton();
15 me.configureXonoticModButton(me, menu);
19 void XonoticModButton_Click(entity me, entity other)
22 thecmd = strcat("\ndisconnect\nmenu_restart");
24 if (me.destination != "")
25 thecmd = strcat(thecmd, "\ntogglemenu\ndefer 0.1 \"menu_cmd directmenu ", me.destination,"\"\n");
27 if (cvar_string("menu_slist_modfilter") == "havoc")
28 thecmd = strcat("\ngamedir data", thecmd);
30 thecmd = strcat("\ngamedir havoc", thecmd);
34 void configureXonoticModButtonXonoticModButton(entity me, string menu)
36 me.configureXonoticButton(me, "", '0 0 0');
37 me.onClick = XonoticModButton_Click;
38 me.onClickEntity = me;
39 me.destination = menu;
41 if (cvar_string("menu_slist_modfilter") == "havoc")
42 me.text = "Switch to Xonotic mode";
44 me.text = "Switch to Havoc mode";