]> icculus.org git repositories - divverent/nexuiz.git/blob - data/source/custom/quit.qm
give menu source its own directory
[divverent/nexuiz.git] / data / source / custom / quit.qm
1 // Property of Alientrap/AK
2 // custom/quit.qm
3
4 void() Nex_Quit_Toggle =
5 {
6         local entity lEntity;
7
8         lEntity = Menu_GetItem( "QuitWnd" );
9         if( lEntity.flag & FLAG_HIDDEN ) {
10                 lEntity.flag = lEntity.flag - FLAG_HIDDEN;
11                 Menu_Select( Menu_GetItem( "QuitWnd::Layout::Buttons::No" ), false );
12         } else {
13                 lEntity.flag = lEntity.flag + FLAG_HIDDEN;
14                 Menu_Reselect( false );
15         }
16 }
17
18 void() Nex_Quit_Action =
19 {
20         local entity lEntity;
21
22         lEntity = Menu_GetItem( "QuitWnd" );
23         if( lEntity.flag & FLAG_HIDDEN )
24                 lEntity.flag = lEntity.flag - FLAG_HIDDEN;
25         Menu_Select( Menu_GetItem( "QuitWnd::Layout::Buttons::No" ), false );
26 }
27
28 bool( float pKey, float pAscii ) Nex_Quit_Key =
29 {
30         if( pKey == K_ESCAPE ) {
31                 Nex_Quit_Toggle();
32                 return true;
33         }
34         return false;
35 };
36
37 void() Nex_Quit_Yes =
38 {
39         cmd( "quit\n" );
40 };
41
42 void() Nex_Quit_No =
43 {
44         Nex_Quit_Toggle();
45 };