]> icculus.org git repositories - divverent/nexuiz.git/blob - scmenu/source/custom/option.qm
Adding my current version of the scmenu to the nexuiz cvs.
[divverent/nexuiz.git] / scmenu / source / custom / option.qm
1 // Property of Alientrap
2 // custom/option.qm
3
4 // link is the name of the datalink
5 .string target;
6 // text is the description text
7 .string text;
8
9 /*
10 ===================
11 Nex_Automation_Option_Slider
12 ===================
13 */
14 // Embedded in a window with the following subitems: Description, Slider, Value
15 void() Nex_Automation_Option_Slider =
16 {
17         local entity lDescription, lSlider, lValue;
18
19         if( !self._parent.target ) {
20                 objerror( "Bad target '", self._parent.target, "'" );
21                 return;
22         }
23
24         // Get the children
25         lDescription = Menu_GetItem( "Description" );
26         lSlider = Menu_GetItem( "Slider" );
27         lValue = Menu_GetItem( "Value" );
28
29         // Now set the properties
30         // (will be strzoned later by the Spawn functions)
31         lDescription.normal = self._parent.text;
32         lDescription.link = lSlider.name;
33
34         lSlider.target = self._parent.target;
35
36         lValue.target = self._parent.target;
37         lValue.link = lSlider.name;
38 };
39
40 /*
41 ===================
42 Nex_Automation_Option_EditBox
43 ===================
44 */
45 // Embedded in a window with the following subitems: Description, EditBox
46 void() Nex_Automation_Option_EditBox =
47 {
48         local entity lDescription, lEditBox;
49
50         if( !self._parent.target ) {
51                 objerror( "Bad target '", self._parent.target, "'" );
52                 return;
53         }
54
55         // Get the children
56         lDescription = Menu_GetItem( "Description" );
57         lEditBox = Menu_GetItem( "EditBox" );
58
59         // Now set the properties
60         // (will be strzoned later by the Spawn functions)
61         lDescription.normal = self._parent.text;
62         lDescription.link = lEditBox.name;
63
64         lEditBox.target = self._parent.target;
65 };
66
67 /*
68 ===================
69 Nex_Automation_Option_Switch
70 ===================
71 */
72 // Embedded in a window with the following subitems: Description, Switch
73 void() Nex_Automation_Option_Switch =
74 {
75         local entity lDescription, lSwitch;
76
77         if( !self._parent.target ) {
78                 objerror( "Bad target '", self._parent.target, "'" );
79                 return;
80         }
81
82         // Get the children
83         lDescription = Menu_GetItem( "Description" );
84         lSwitch = Menu_GetItem( "Switch" );
85
86         // Now set the properties
87         // (will be strzoned later by the Spawn functions)
88         lDescription.normal = self._parent.text;
89         lDescription.link = lSwitch.name;
90
91         lSwitch.target = self._parent.target;
92 };