2 // control/data/data.qh
5 ITEM_DATA_SYNC, // sync with the engine or whatever else this is linked to
6 ITEM_DATA_SEND, // set it
7 ITEM_DATA_RESET, // use the default value
8 ITEM_DATA_TEST_START, // set it but dont sync our backup
9 ITEM_DATA_TEST_END, // set our backup
10 ITEM_DATA_SAVE_EXECSTRING, // stroes the value and the name in such a way in a string that executing it will restore the value and the state (if possible)
15 void( entity pItem, float pEvent ) Raise_DataEvent;
17 // ExecString used to store the data for the ITEM_DATA_SAVE_EXECSTRING event
18 string Data_ExecString;
19 void() Data_ExecString_BeginUse;
20 void() Data_ExecString_EndUse;
23 .string value; // current value in the menu
24 .string defValue; // default value (set for the menu)
25 .string _syncValue; // last value that is known from the real source
27 .void( float pEvent ) _dataEvent;
29 void() Item_Data_Init;
30 void() Item_Data_Destroy;
33 // In this case the target field points to a Item_Data* item
37 void() Item_DataUser_Update;
38 void() Item_DataUser_Init;
39 void() Item_DataUser_Destroy;
42 // links to a [Item_Data] object
47 .void( float pEvent ) _dataEvent;
49 void() Item_DataLink_Init;
50 void() Item_DataLink_Destroy;
51 void() Item_DataLink_Update;
53 // Item_DataContainer [Item_Container] [implements the DATA events]
54 void( float pEvent ) Item_DataContainer_DataEvent;
55 void() Item_DataContainer_Spawn;
57 // Item_Data_Container [Item_Data]
58 void() Item_Data_Container_Reinit;
59 void( float pEvent ) Item_Data_Container_DataEvent;
61 void() Item_Data_Container_Spawn;
63 // Item_Data_Cvar [Item_Data]
66 void( float pEvent ) Item_Data_Cvar_DataEvent;
67 void() Item_Data_Cvar_Spawn;
69 // Item_Data_CvarCreateSave Item_Data_Cvar
70 void() Item_Data_CvarCreateSave_Spawn;
72 // Item_Data_ServerCvar Item_Data_Cvar
75 void( float pEvent ) Item_Data_ServerCvar_DataEvent;
76 void() Item_Data_ServerCvar_Spawn;
78 // Item_DataLink_Text [Item_DataLink]
79 .float maxValue; // max length of the string (-1 for infinity)
80 .string value; // text
82 // Item_DataLink_Value [Item_DataLink]
83 // if maxValue <= minValue there is no max value clamping
89 .string value; // read-only is most cases, but supplies are version of the data that can be displayed
91 void() Item_DataLink_Value_Clamp;
92 string() Item_DataLink_Value_ClampedText;
93 void() Item_DataLink_Value_Spawn;
95 // [Item_DataLink_Switch] Item_DataLink_Value
96 .string descList; // a altstring containing description strings
98 void() Item_DataLink_Switch_Init;
99 void() Item_DataLink_Switch_Destroy;
101 float( entity pDataLink, float pValue ) DataLink_Switch_GetOrdinal;
103 // Item_DataLink_ValueSwitch [Item_DataLink_Switch]
104 // to add support for a case when there is no value list match, add one more entry to desc list
105 // describing the case (i.g. 'Custom'), if you dont it will set the first desc/value entry as default
106 // the default value for stepValue is 1
107 // maxValue is calculated if it is 0
109 void() Item_DataLink_ValueSwitch_Spawn;
111 // Item_DataLink_TextSwitch [Item_DataLink_Switch]
113 // minValue is 0, stepValue is 1, maxValue is the number of items in descList/valueList
114 .string valueList; // contains the values for the different
116 void( float pEvent ) Item_DataLink_TextSwitch_DataEvent;
117 void() Item_DataLink_TextSwitch_Destroy;
118 void() Item_DataLink_TextSwitch_Spawn;
120 // Item_DataLink_FastResync [Item_DataLink]
121 // "Fast" in the sense of total performance - the data is resynced
122 // at most once per frame
123 .float _presstime; // no more than once a frame?
125 void() Item_DataLink_FastResync_Spawn;
127 // Item_DataLink_TextValue [Item_DataLink]
128 // self: [string] -> link: [float]
129 void() Item_DataLink_TextValue_Spawn;
131 // Item_DataLink_TextTime [Item_DataLink]
132 // self: [string] -> link: [float]
134 void() Item_DataLink_TextTime_Spawn;
136 // Item_DataLink_AltString [Item_DataLink]
137 // self: [string] -> link: [altstring item]
138 .float stepValue; // contains the index into link.value
140 void() Item_DataLink_AltString_Spawn;
142 // Item_DataLink_Splitter [Item_DataLink]
143 // sets value and _realValue of all children to the float value of self._realValue
144 void() Item_DataLink_Splitter_Spawn;