]> icculus.org git repositories - divverent/nexuiz.git/blob - scmenu/source/control/visual/switchbutton.qc
-Added maplist support
[divverent/nexuiz.git] / scmenu / source / control / visual / switchbutton.qc
1 // DP/Nex Menu
2 // control/visual/switchbutton.qc
3
4 bool( float pKey, float pAscii ) Item_SwitchButton_Key =
5 {
6         if( !self._target )
7                 return false;
8
9         if( pKey == K_SPACE || pKey == K_ENTER || pKey == K_MOUSE1 || pKey == K_RIGHTARROW ) {
10                 Sound_Play( self.soundPressed );
11                 self._presstime = Timer_Time;
12
13                 self._target._realValue = self._target._realValue + 1;
14                 Raise_DataEvent( self._target, ITEM_DATALINK_SET );
15
16                 CtCall_Action();
17                 return true;
18         } else if( pKey == K_BACKSPACE || pKey == K_MOUSE2 || pKey == K_LEFTARROW ) {
19                 Sound_Play( self.soundPressed );
20                 self._presstime = Timer_Time;
21
22                 self._target._realValue = self._target._realValue - 1;
23                 Raise_DataEvent( self._target, ITEM_DATALINK_SET );
24
25                 CtCall_Action();
26                 return true;
27         }
28
29         return false;
30 };
31
32 void() Item_SwitchButton_Spawn =
33 {
34         Item_ValueButton_Spawn();
35
36         self._key = Item_SwitchButton_Key;
37 };