1 // Property of Alientrap/AK
4 void( float pEvent ) Item_Data_Nex_Key_DataEvent;
8 String_EntitySet( self, value, String_Normal( Key_GetBindList( self.target ) ) );
9 String_EntitySet( self, _syncValue, self.value );
14 local float lCount, lCounter;
16 lCount = Util_GetAltStringCount( self.value );
17 Key_LimitBinds( 0, self.target );
19 for( lCounter = 0 ; lCounter < lCount ; ++lCounter )
20 Key_Bind( Key_GetName( stof( String_Normal( Util_GetAltStringItem( self.value, lCounter ) ) ) ), self.target );
26 String_EntitySet( self, _syncValue, self.value );
31 local float lCount, lCounter;
33 // TODO: remove this - but we need this for testing purposes atm
34 // INFO: defValue should contain the key names used by DP not the key numbers!
38 String_EntitySet( self, value, "" );
40 lCount = Util_GetAltStringCount( self.defValue );
41 Key_LimitBinds( 0, self.target );
43 for( lCounter = 0 ; lCounter < lCount ; lCounter++ ) {
44 lKey = Util_GetAltStringItem( self.defValue, lCounter );
45 Key_Bind( lKey, self.target );
46 String_EntitySet( self, value, strcat( self.value, " '", Key_GetNum( lKey ), "'" ) );
50 String_EntitySet( self, _syncValue, self.value );
53 void() _IDNK_Test_Start =
58 void() _IDNK_Test_End =
60 String_EntitySet( self, value, self._syncValue );
64 void( float pEvent ) Item_Data_Nex_Key_DataEvent =
76 case ITEM_DATA_TEST_START:
79 case ITEM_DATA_TEST_END:
85 void() Item_Data_Nex_Key_Destroy =
87 String_EntityFree( self, target );
91 void() Item_Data_Nex_Key_Spawn =
95 String_EntityZone( self, target );
97 self._destroy = Item_Data_Nex_Key_Destroy;
98 self._reinit = _IDNK_Sync;
99 self._dataEvent = Item_Data_Nex_Key_DataEvent;
105 Item_Nex_KeyButton Item_Button
109 bool( float pKey, float pAscii ) Item_Nex_KeyButton_Key =
111 if( pKey == K_BACKSPACE ) {
114 Raise_DataEvent( self._target, ITEM_DATALINK_GET );
115 lNum = stof( self._target.value );
117 Key_Unbind( Key_GetName( lNum ) );
118 Raise_DataEvent( self._target, ITEM_DATALINK_SET );
121 } else if( pKey == K_UPARROW ) {
122 Menu_SelectPrev( false );
123 Menu_SelectPrev( true );
125 } else if( pKey == K_DOWNARROW ) {
126 Menu_SelectNext( false );
127 Menu_SelectNext( true );
130 return Item_Button_Key( pKey, pAscii );
133 void() Item_Nex_KeyButton_Update =
136 Item_DataUser_Update();
138 Raise_DataEvent( self._target, ITEM_DATALINK_GET );
139 lNum = stof( self._target.value );
141 String_EntitySet( self, normal, "-" );
143 String_EntitySet( self, normal, Key_GetName( lNum ) );
144 Item_Button_Update();
147 void() Item_Nex_KeyButton_Destroy =
149 Item_DataUser_Destroy();
150 Item_Button_Destroy();
153 void() Item_Nex_KeyButton_Spawn =
155 Item_DataUser_Init();
158 self._destroy = Item_Nex_KeyButton_Destroy;
159 self._update = Item_Nex_KeyButton_Update;
160 self._key = Item_Nex_KeyButton_Key;