1 #include "commandbutton.qh"
4 entity makeXonoticCommandButton_T(string theText, vector theColor, string theCommand, int theFlags, string theTooltip)
7 me = NEW(XonoticCommandButton);
8 me.configureXonoticCommandButton(me, theText, theColor, theCommand, theFlags, theTooltip);
11 entity makeXonoticCommandButton(string theText, vector theColor, string theCommand, int theFlags)
13 return makeXonoticCommandButton_T(theText, theColor, theCommand, theFlags, string_null);
16 void XonoticCommandButton_Click(entity me, entity other)
18 //if(me.flags & COMMANDBUTTON_APPLY)
19 // saveAllCvars(me.parent);
20 cmd("\n", me.onClickCommand, "\n");
21 //if(me.flags & COMMANDBUTTON_REVERT)
22 // loadAllCvars(me.parent);
23 if(me.flags & COMMANDBUTTON_CLOSE)
24 me.parent.close(me.parent);
27 void XonoticCommandButton_configureXonoticCommandButton(entity me, string theText, vector theColor, string theCommand, int theFlags, string theTooltip)
29 me.configureXonoticButton(me, theText, theColor, theTooltip);
30 me.onClickCommand = theCommand;
32 me.onClick = XonoticCommandButton_Click;
33 me.onClickEntity = me;