]> icculus.org git repositories - divverent/nexuiz.git/blob - scmenu/source/control/data/data.qh
-Added a management window to creategame, which allows you to save and load
[divverent/nexuiz.git] / scmenu / source / control / data / data.qh
1 // DP/Nex Menu
2 // control/data/data.qh
3
4 enum {
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)
11         ITEM_DATALINK_SET,
12         ITEM_DATALINK_GET
13 };
14
15 void( entity pItem, float pEvent ) Raise_DataEvent;
16
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;
21
22 // [Item_Data]
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
26
27 .void( float pEvent ) _dataEvent;
28
29 void() Item_Data_Init;
30 void() Item_Data_Destroy;
31
32 // [Item_DataUser]
33 // In this case the target field points to a Item_Data* item
34 .string target;
35 .entity _target;
36
37 void() Item_DataUser_Update;
38 void() Item_DataUser_Init;
39 void() Item_DataUser_Destroy;
40
41 // [Item_DataLink]
42 // links to a [Item_Data] object
43 .string link;
44 .entity _link;
45 .string value;
46
47 .void( float pEvent ) _dataEvent;
48
49 void() Item_DataLink_Init;
50 void() Item_DataLink_Destroy;
51 void() Item_DataLink_Update;
52
53 // Item_DataContainer [Item_Container] [implements the DATA events]
54 void( float pEvent ) Item_DataContainer_DataEvent;
55 void() Item_DataContainer_Spawn;
56
57 // Item_Data_Container [Item_Data]
58 void() Item_Data_Container_Reinit;
59 void( float pEvent ) Item_Data_Container_DataEvent;
60
61 void() Item_Data_Container_Spawn;
62
63 // Item_Data_Cvar [Item_Data]
64 .string cvarName;
65
66 void( float pEvent ) Item_Data_Cvar_DataEvent;
67 void() Item_Data_Cvar_Spawn;
68
69 // Item_Data_CvarCreateSave Item_Data_Cvar
70 void() Item_Data_CvarCreateSave_Spawn;
71
72 // Item_DataLink_Text [Item_DataLink]
73 .float maxValue; // max length of the string (-1 for infinity)
74 .string value; // text
75
76 // Item_DataLink_Value [Item_DataLink]
77 // if maxValue <= minValue there is no max value clamping
78 .float minValue;
79 .float stepValue;
80 .float maxValue;
81 .float _realValue;
82
83 .string value; // read-only is most cases, but supplies are version of the data that can be displayed
84
85 void() Item_DataLink_Value_Clamp;
86 void() Item_DataLink_Value_Spawn;
87
88 // [Item_DataLink_Switch] Item_DataLink_Value
89 .string descList; // a altstring containing description strings
90
91 void() Item_DataLink_Switch_Init;
92 void() Item_DataLink_Switch_Destroy;
93
94 float( entity pDataLink, float pValue ) DataLink_Switch_GetOrdinal;
95
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
101
102 void() Item_DataLink_ValueSwitch_Spawn;
103
104 // Item_DataLink_TextSwitch [Item_DataLink_Switch]
105 // if you want a s
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
108
109 void( float pEvent ) Item_DataLink_TextSwitch_DataEvent;
110 void() Item_DataLink_TextSwitch_Destroy;
111 void() Item_DataLink_TextSwitch_Spawn;
112
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?
117
118 void() Item_DataLink_FastResync_Spawn;
119
120 // Item_DataLink_TextValue [Item_DataLink]
121 // self: [string] -> link: [float]
122 void() Item_DataLink_TextValue_Spawn;
123
124 // Item_DataLink_TextTime [Item_DataLink]
125 // self: [string] -> link: [float]
126 // hour:min:sec
127 void() Item_DataLink_TextTime_Spawn;
128
129 // Item_DataLink_AltString [Item_DataLink]
130 // self: [string] -> link: [altstring item]
131 .float stepValue; // contains the index into link.value
132
133 void() Item_DataLink_AltString_Spawn;
134
135 // Item_DataLink_Router [Item_DataLink]
136 // sets value and _realValue of all children to the float value of self._realValue
137 void() Item_DataLink_Router_Spawn;