1 #ifndef COMMANDBUTTON_CLOSE
2 # define COMMANDBUTTON_CLOSE 1
3 # define COMMANDBUTTON_APPLY 2
4 //# define COMMANDBUTTON_REVERT 4
8 CLASS(NexuizCommandButton) EXTENDS(NexuizButton)
9 METHOD(NexuizCommandButton, configureNexuizCommandButton, void(entity, string, vector, string, float))
10 ATTRIB(NexuizCommandButton, onClickCommand, string, string_null)
11 ATTRIB(NexuizCommandButton, flags, float, 0)
12 ENDCLASS(NexuizCommandButton)
13 entity makeNexuizCommandButton(string theText, vector theColor, string theCommand, float closesMenu);
17 entity makeNexuizCommandButton(string theText, vector theColor, string theCommand, float theFlags)
20 me = spawnNexuizCommandButton();
21 me.configureNexuizCommandButton(me, theText, theColor, theCommand, theFlags);
25 void NexuizCommandButton_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 configureNexuizCommandButtonNexuizCommandButton(entity me, string theText, vector theColor, string theCommand, float theFlags)
38 me.configureNexuizButton(me, theText, theColor);
39 me.onClickCommand = theCommand;
41 me.onClick = NexuizCommandButton_Click;
42 me.onClickEntity = me;