2 // control/data/cvar.qc
6 Item_Data_CvarCreateSave
10 void() Item_Data_Cvar_Sync =
12 String_EntitySet( self, _syncValue, str_cvar( self.cvarName ) );
13 String_EntitySet( self, value, self._syncValue );
16 void() Item_Data_Cvar_Send =
18 cvar_set( self.cvarName, self.value );
19 Item_Data_Cvar_Sync();
22 void() Item_Data_Cvar_Reset =
24 String_EntitySet( self, value, self.defValue );
25 Item_Data_Cvar_Send();
28 void() Item_Data_Cvar_Test_Start =
30 cvar_set( self.cvarName, self.value );
33 void() Item_Data_Cvar_Test_End =
35 cvar_set( self.cvarName, self._syncValue );
38 void( float pEvent ) Item_Data_Cvar_DataEvent =
42 Item_Data_Cvar_Sync();
45 Item_Data_Cvar_Send();
48 Item_Data_Cvar_Reset();
50 case ITEM_DATA_TEST_START:
51 Item_Data_Cvar_Test_Start();
53 case ITEM_DATA_TEST_END:
54 Item_Data_Cvar_Test_End();
59 void() Item_Data_Cvar_Destroy =
62 String_EntityFree( self, cvarName );
65 void() Item_Data_Cvar_Spawn =
67 String_EntityZone( self, cvarName );
70 self.flag = self.flag | FLAG_HIDDEN;
72 self._dataEvent = Item_Data_Cvar_DataEvent;
73 self._reinit = Item_Data_Cvar_Sync;
74 self._destroy = Item_Data_Cvar_Destroy;
79 Item_Data_CvarCreateSave
83 void() Item_Data_CvarCreateSave_Spawn =
85 Item_Data_Cvar_Spawn();
87 registercvar( self.cvarName, self.defValue, CVAR_SAVE );