2 // control/data/base.qc
9 void( entity pItem, float pEvent ) Raise_DataEvent =
13 if( !pItem._dataEvent )
18 self._dataEvent( pEvent );
24 Data_ExecString_BeginUse
27 void() Data_ExecString_BeginUse =
29 Data_ExecString = String_Create();
34 Data_ExecString_EndUse
37 void() Data_ExecString_EndUse =
39 String_Free( Data_ExecString);
51 void() Item_Data_Destroy =
53 String_EntityFree( self, value );
54 String_EntityFree( self, defValue );
55 String_EntityFree( self, _syncValue );
63 void() Item_Data_Init =
65 String_EntityZone( self, value );
66 String_EntityZone( self, defValue );
67 String_EntityCreate( self, _syncValue );
69 self.flag = self.flag | FLAG_HIDDEN;
71 self._destroy = Item_Data_Destroy;
83 void() Item_DataLink_Update =
86 self._link = null_entity;
87 else if( self.link != self._link.name )
88 self._link = Menu_GetItem( self.link );
96 void() Item_DataLink_Destroy =
98 String_EntityFree( self, link );
99 String_EntityFree( self, value );
107 void() Item_DataLink_Init =
109 self.flag = self.flag | FLAG_HIDDEN;
111 String_EntityZone( self, link );
112 String_EntityZone( self, value );
113 Item_DataLink_Update();
115 self._destroy = Item_DataLink_Destroy;
119 // [Item_DataLink_Switch]
124 Item_DataLink_Switch_Destroy
127 void() Item_DataLink_Switch_Destroy =
129 Item_DataLink_Destroy();
130 String_EntityFree( self, descList );
135 Item_DataLink_Switch_Init
138 void() Item_DataLink_Switch_Init =
140 Item_DataLink_Value_Spawn();
141 String_EntityZone( self, descList );
143 self._destroy = Item_DataLink_Switch_Destroy;
151 float( entity pDataLink, float pValue ) DataLink_Switch_GetOrdinal =
153 if( pDataLink.stepValue == 0.0 )
155 return (pValue - pDataLink.minValue) / pDataLink.stepValue;
167 void() Item_DataUser_Update =
169 if( self.target == "" )
170 self._target = null_entity;
171 else if( self.target != self._target.name )
172 self._target = Menu_GetItem( self.target );
177 Item_DataUser_Destroy
180 void() Item_DataUser_Destroy =
182 String_EntityFree( self, target );
190 void() Item_DataUser_Init =
192 String_EntityZone( self, target );
194 Item_DataUser_Update();
196 self._destroy = Item_DataUser_Destroy;
201 Item_DataContainer_DataEvent
204 void( float pEvent ) Item_DataContainer_DataEvent =
206 // no support for embedded stuff yet (isnt needed imho anyway)
209 for( lItem = self._child ; lItem != null_entity ; lItem = lItem._next ) {
210 Raise_DataEvent( lItem, pEvent );
216 Item_DataContainer_Spawn
219 void() Item_DataContainer_Spawn =
221 Item_Container_Spawn();
223 self._dataEvent = Item_DataContainer_DataEvent;