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_DataLink_Text [Item_DataLink]
73 .float maxValue; // max length of the string (-1 for infinity)
74 .string value; // text
76 // Item_DataLink_Value [Item_DataLink]
77 // if maxValue <= minValue there is no max value clamping
83 .string value; // read-only is most cases, but supplies are version of the data that can be displayed
85 void() Item_DataLink_Value_Clamp;
86 void() Item_DataLink_Value_Spawn;
88 // [Item_DataLink_Switch] Item_DataLink_Value
89 .string descList; // a altstring containing description strings
91 void() Item_DataLink_Switch_Init;
92 void() Item_DataLink_Switch_Destroy;
94 float( entity pDataLink, float pValue ) DataLink_Switch_GetOrdinal;
96 // Item_DataLink_ValueSwitch [Item_DataLink_Switch]
97 // to add support for a case when there is no value list match, add one more entry to desc list
98 // describing the case (i.g. 'Custom'), if you dont it will set the first desc/value entry as default
99 // the default value for stepValue is 1
100 // maxValue is calculated if it is 0
102 void() Item_DataLink_ValueSwitch_Spawn;
104 // Item_DataLink_TextSwitch [Item_DataLink_Switch]
106 // minValue is 0, stepValue is 1, maxValue is the number of items in descList/valueList
107 .string valueList; // contains the values for the different
109 void( float pEvent ) Item_DataLink_TextSwitch_DataEvent;
110 void() Item_DataLink_TextSwitch_Destroy;
111 void() Item_DataLink_TextSwitch_Spawn;
113 // Item_DataLink_FastResync [Item_DataLink]
114 // "Fast" in the sense of total performance - the data is resynced
115 // at most once per frame
116 .float _presstime; // no more than once a frame?
118 void() Item_DataLink_FastResync_Spawn;
120 // Item_DataLink_TextValue [Item_DataLink]
121 // self: [string] -> link: [float]
122 void() Item_DataLink_TextValue_Spawn;
124 // Item_DataLink_TextTime [Item_DataLink]
125 // self: [string] -> link: [float]
127 void() Item_DataLink_TextTime_Spawn;
129 // Item_DataLink_AltString [Item_DataLink]
130 // self: [string] -> link: [altstring item]
131 .float stepValue; // contains the index into link.value
133 void() Item_DataLink_AltString_Spawn;
135 // Item_DataLink_Splitter [Item_DataLink]
136 // sets value and _realValue of all children to the float value of self._realValue
137 void() Item_DataLink_Splitter_Spawn;