1 #ifndef COMMANDBUTTON_CLOSE
\r
2 # define COMMANDBUTTON_CLOSE 1
\r
3 # define COMMANDBUTTON_APPLY 2
\r
4 //# define COMMANDBUTTON_REVERT 4
\r
8 CLASS(VoretCommandButton) EXTENDS(VoretButton)
\r
9 METHOD(VoretCommandButton, configureVoretCommandButton, void(entity, string, vector, string, float))
\r
10 ATTRIB(VoretCommandButton, onClickCommand, string, string_null)
\r
11 ATTRIB(VoretCommandButton, flags, float, 0)
\r
12 ENDCLASS(VoretCommandButton)
\r
13 entity makeVoretCommandButton(string theText, vector theColor, string theCommand, float closesMenu);
\r
16 #ifdef IMPLEMENTATION
\r
17 entity makeVoretCommandButton(string theText, vector theColor, string theCommand, float theFlags)
\r
20 me = spawnVoretCommandButton();
\r
21 me.configureVoretCommandButton(me, theText, theColor, theCommand, theFlags);
\r
25 void VoretCommandButton_Click(entity me, entity other)
\r
27 //if(me.flags & COMMANDBUTTON_APPLY)
\r
28 // saveAllCvars(me.parent);
\r
29 cmd("\n", me.onClickCommand, "\n");
\r
30 //if(me.flags & COMMANDBUTTON_REVERT)
\r
31 // loadAllCvars(me.parent);
\r
32 if(me.flags & COMMANDBUTTON_CLOSE)
\r
33 m_goto(string_null);
\r
36 void configureVoretCommandButtonVoretCommandButton(entity me, string theText, vector theColor, string theCommand, float theFlags)
\r
38 me.configureVoretButton(me, theText, theColor);
\r
39 me.onClickCommand = theCommand;
\r
40 me.flags = theFlags;
\r
41 me.onClick = VoretCommandButton_Click;
\r
42 me.onClickEntity = me;
\r