1 // Property of Alientrap
4 // link is the name of the datalink
6 // text is the description text
14 // Embedded in a window with the following subitems: Action, Link1, Link2
15 void() Nex_Automation_Key =
17 local entity lAction, lLink1, lLink2;
19 if( !self._parent.target ) {
20 objerror( "Bad target '", self._parent.target, "'" );
25 lAction = Menu_GetItem( "Action" );
26 lLink1 = Menu_GetItem( "Link1" );
27 lLink2 = Menu_GetItem( "Link2" );
29 // Now set the properties
30 // (will be strzoned later by the Spawn functions)
31 lAction.text = self._parent.text;
33 lLink1.link = self._parent.target;
34 lLink2.link = self._parent.target;
37 // more specific functions
38 // Menu_KeyHook_Target points to Link1/2
39 void( float pKey, float pAscii ) Nex_Key_KeyHook =
42 if( pKey != K_ESCAPE ) {
43 String_EntitySet( Menu_KeyHook_Target, value, ftos( pKey ) );
44 Raise_DataEvent( Menu_KeyHook_Target, ITEM_DATALINK_SET );
45 Raise_DataEvent( Menu_KeyHook_Target, ITEM_DATA_TEST_START );
47 // hide the info window again
48 lItem = Menu_GetItemEx( Menu_KeyHook_Target, "InfoWindow", true );
49 lItem.flag = lItem.flag | FLAG_HIDDEN;
51 Menu_KeyHook = Util_NullFunction;
54 void() Nex_Action_KeyButton =
58 Menu_KeyHook_Target = self._target._link;
59 Menu_KeyHook = Nex_Key_KeyHook;
61 // show the info window
62 lItem = Menu_GetItem( "InfoWindow" );
63 lItem.flag = lItem.flag - (lItem.flag & FLAG_HIDDEN);