]> icculus.org git repositories - divverent/nexuiz.git/blob - data/menuqc/custom/option.qm
rename menu directories
[divverent/nexuiz.git] / data / menuqc / custom / option.qm
1 // Property of Alientrap
2 // custom/option.qm
3
4 // uses .target to determine the target data item (or container)
5
6 void() Nex_Action_ResetData_Destroy =
7 {
8         String_EntityFree( self, target );
9 };
10
11 void() Nex_Action_ResetData_Action =
12 {
13         Raise_DataEvent( Menu_GetItem( self.target ), ITEM_DATA_RESET );
14 };
15
16 void() Nex_Action_ResetData =
17 {
18         String_EntityZone( self, target );
19
20         self.destroy = Nex_Action_ResetData_Destroy;
21         self.action = Nex_Action_ResetData_Action;
22 };
23
24
25 // link is the name of the datalink
26 .string target;
27 // text is the description text
28 .string text;
29
30 /*
31 ===================
32 Nex_Automation_Option_Slider
33 ===================
34 */
35 // Embedded in a window with the following subitems: Description, Slider, Value
36 void() Nex_Automation_Option_Slider =
37 {
38         local entity lDescription, lSlider, lValue;
39
40         if( !self._parent.target ) {
41                 objerror( "Bad target '", self._parent.target, "'" );
42                 return;
43         }
44
45         // Get the children
46         lDescription = Menu_GetItem( "Description" );
47         lSlider = Menu_GetItem( "Slider" );
48         lValue = Menu_GetItem( "Value" );
49
50         // Now set the properties
51         // (will be strzoned later by the Spawn functions)
52         lDescription.normal = self._parent.text;
53         lDescription.link = lSlider.name;
54
55         lSlider.target = self._parent.target;
56
57         lValue.target = self._parent.target;
58         lValue.link = lSlider.name;
59 };
60
61 /*
62 ===================
63 Nex_Automation_Option_EditBox
64 ===================
65 */
66 // Embedded in a window with the following subitems: Description, EditBox
67 void() Nex_Automation_Option_EditBox =
68 {
69         local entity lDescription, lEditBox;
70
71         if( !self._parent.target ) {
72                 objerror( "Bad target '", self._parent.target, "'" );
73                 return;
74         }
75
76         // Get the children
77         lDescription = Menu_GetItem( "Description" );
78         lEditBox = Menu_GetItem( "EditBox" );
79
80         // Now set the properties
81         // (will be strzoned later by the Spawn functions)
82         lDescription.normal = self._parent.text;
83         lDescription.link = lEditBox.name;
84
85         lEditBox.target = self._parent.target;
86 };
87
88 /*
89 ===================
90 Nex_Automation_Option_Switch
91 ===================
92 */
93 // Embedded in a window with the following subitems: Description, Switch
94 void() Nex_Automation_Option_Switch =
95 {
96         local entity lDescription, lSwitch;
97
98         if( !self._parent.target ) {
99                 objerror( "Bad target '", self._parent.target, "'" );
100                 return;
101         }
102
103         // Get the children
104         lDescription = Menu_GetItem( "Description" );
105         lSwitch = Menu_GetItem( "Switch" );
106
107         // Now set the properties
108         // (will be strzoned later by the Spawn functions)
109         lDescription.normal = self._parent.text;
110         lDescription.link = lSwitch.name;
111
112         lSwitch.target = self._parent.target;
113 };