]> icculus.org git repositories - divverent/nexuiz.git/blob - data/menuqc/control/data/text.qc
rename menu directories
[divverent/nexuiz.git] / data / menuqc / control / data / text.qc
1 // DP/Nex Menu
2 // control/data/text.qc
3
4 void( float pEvent ) Item_DataLink_Text_DataEvent =
5 {
6         Item_DataLink_Update();
7
8         if( pEvent == ITEM_DATALINK_SET ) {
9                 if( self.maxValue >= 0 )
10                         String_EntitySet( self, value, substring( self.value, 0, self.maxValue ) );
11                 if( self._link ) {
12                         String_EntitySet( self._link, value, self.value );
13                         Raise_DataEvent( self._link, ITEM_DATALINK_SET );
14                 }
15         } else if( !self._link )
16                 return;
17         else if( pEvent == ITEM_DATALINK_GET ) {
18                 String_EntitySet( self, value, self._link.value );
19                 if( self.maxValue >= 0 ) {
20                         Raise_DataEvent( self._link, ITEM_DATALINK_GET );
21                         String_EntitySet( self, value, substring( self.value, 0, self.maxValue ) );
22                 }
23         } else
24                 Raise_DataEvent( self._link, pEvent );
25 };
26
27 void() Item_DataLink_Text_Spawn =
28 {
29         Item_DataLink_Init();
30
31         self._dataEvent = Item_DataLink_Text_DataEvent;
32 };