1 #ifndef COMMANDBUTTON_CLOSE
2 # define COMMANDBUTTON_CLOSE 1
3 # define COMMANDBUTTON_APPLY 2
4 //# define COMMANDBUTTON_REVERT 4
8 CLASS(XonoticCommandButton) EXTENDS(XonoticButton)
9 METHOD(XonoticCommandButton, configureXonoticCommandButton, void(entity, string, vector, string, float))
10 ATTRIB(XonoticCommandButton, onClickCommand, string, string_null)
11 ATTRIB(XonoticCommandButton, flags, float, 0)
12 ENDCLASS(XonoticCommandButton)
13 entity makeXonoticCommandButton(string theText, vector theColor, string theCommand, float closesMenu);
17 entity makeXonoticCommandButton(string theText, vector theColor, string theCommand, float theFlags)
20 me = spawnXonoticCommandButton();
21 me.configureXonoticCommandButton(me, theText, theColor, theCommand, theFlags);
25 void XonoticCommandButton_Click(entity me, entity other)
27 //if(me.flags & COMMANDBUTTON_APPLY)
28 // saveAllCvars(me.parent);
29 cmd("\n", me.onClickCommand, "\n");
30 //if(me.flags & COMMANDBUTTON_REVERT)
31 // loadAllCvars(me.parent);
32 if(me.flags & COMMANDBUTTON_CLOSE)
36 void XonoticCommandButton_configureXonoticCommandButton(entity me, string theText, vector theColor, string theCommand, float theFlags)
38 me.configureXonoticButton(me, theText, theColor);
39 me.onClickCommand = theCommand;
41 me.onClick = XonoticCommandButton_Click;
42 me.onClickEntity = me;