2 // control/visual/switchbutton.qc
4 bool( float pKey, float pAscii ) Item_SwitchButton_Key =
9 if( pKey == K_SPACE || pKey == K_ENTER || pKey == K_MOUSE1 || pKey == K_RIGHTARROW ) {
10 Sound_Play( self.soundPressed );
11 self._presstime = Timer_Time;
13 self._target._realValue = self._target._realValue + 1;
14 Raise_DataEvent( self._target, ITEM_DATALINK_SET );
18 } else if( pKey == K_BACKSPACE || pKey == K_MOUSE2 || pKey == K_LEFTARROW ) {
19 Sound_Play( self.soundPressed );
20 self._presstime = Timer_Time;
22 self._target._realValue = self._target._realValue - 1;
23 Raise_DataEvent( self._target, ITEM_DATALINK_SET );
32 void() Item_SwitchButton_Spawn =
34 Item_ValueButton_Spawn();
36 self._key = Item_SwitchButton_Key;