Showing 7 changed files with 61 additions and 9 deletions
+50
Nasal/buttons.nas
... ...
@@ -151,6 +151,56 @@ var buttonsClass = {
151 151
         }
152 152
     },
153 153
 
154
+    GlobalParams: func (a) {
155
+        if (a == 1)
156
+            return;
157
+        var windowId = 'GLOBAL SETTINGS';
158
+        var obj_infos = [
159
+            {text: 'DISPLAY', type: 'title'},
160
+            {type: 'separator'},
161
+            {text: 'Brightness: ', type: 'normal'},
162
+            {text: sprintf('% 3u %%', zkv.getValue('display-brightness-norm') * 100 / 0.7),
163
+                type: 'selected immediate end-of-line',
164
+                format: '% 3u %%',
165
+                range: {max: 100, min: 0},
166
+                callback: func (id, selected) {
167
+                    var b = num(string.trim(me.device.windows.state[id].objects[selected].text, 0, func (c) c == `%` or c == ` `));
168
+                    zkv.setDoubleValue('display-brightness-norm', b * 0.7 / 100);
169
+                },
170
+            },
171
+            {text: 'Light: ', type: 'normal'},
172
+            {text: '  0 >',
173
+                type: 'editable|immediate|end-of-line',
174
+                choices: ['  0 >', '<  1 >', '< 2 >', '< 3  '],
175
+                callback: func (id, selected) {
176
+                    var l = me.device.windows.state[id].objects[selected].text;
177
+                    foreach (var c; [' ', '<', '>'])
178
+                        l = string.replace(l, c, '');
179
+                    zkv.setDoubleValue('lightmap', num(l) * 3);
180
+                }
181
+            }
182
+        ];
183
+        var lines = size(obj_infos);
184
+        var name_max_length = 20;
185
+        me.device.windows.draw(
186
+            windowId,
187
+            {x: 1014 - (name_max_length * 10), y: 758 - ((lines + 3) * 24), w: name_max_length * 10, l: lines, sep: 1},
188
+            obj_infos
189
+        );
190
+        me.device.knobs.FmsOuter = me.device.knobs.NavigateMenu;
191
+        me.device.knobs.FmsInner = me.device.knobs.MenuSettings;
192
+        me.device.buttons.CLR = func {
193
+            me.device.windows.del(windowId);
194
+            me.device.knobs.FmsOuter = func;
195
+            me.device.knobs.FmsInner = func;
196
+            foreach (var b; ['ENT', 'CLR'])
197
+                me.device.buttons[b] = func;
198
+            me.device.buttons.MENU = me.device.buttons.GlobalParams;
199
+        }
200
+        me.device.buttons.ENT  = me.device.buttons.CLR;
201
+        me.device.buttons.MENU = me.device.buttons.CLR;
202
+    },
203
+
154 204
     DirectTo : void,
155 205
     MENU : void,
156 206
     FPL : void,
+1
Nasal/display.nas
... ...
@@ -253,6 +253,7 @@ var displayClass = {
253 253
             me.updateOMI();
254 254
             me.timerTrigger();
255 255
             me.screen.show();
256
+            me.device.buttons.MENU = me.device.buttons.GlobalParams;
256 257
         }
257 258
         else {
258 259
             me.updateEIS();
+2 -2
mfd.xml
... ...
@@ -22,7 +22,7 @@
22 22
     <inherits-from>Effects/model-combined-deferred</inherits-from>
23 23
     <parameters>
24 24
       <lightmap-enabled type="int">1</lightmap-enabled>
25
-      <lightmap-factor><use>instrumentation/zkv1000/Lightmap</use></lightmap-factor>
25
+      <lightmap-factor><use>instrumentation/zkv1000/lightmap</use></lightmap-factor>
26 26
       <texture n="3">
27 27
         <image>Textures/GDU-104X.lightmap.png</image>
28 28
       </texture>
... ...
@@ -88,7 +88,7 @@
88 88
     <inherits-from>Effects/model-combined-deferred</inherits-from>
89 89
     <parameters>
90 90
       <lightmap-enabled type="int">1</lightmap-enabled>
91
-      <lightmap-factor><use>instrumentation/zkv1000/Lightmap</use></lightmap-factor>
91
+      <lightmap-factor><use>instrumentation/zkv1000/lightmap</use></lightmap-factor>
92 92
       <texture n="3">
93 93
         <image>Textures/GDU-104X.lightmap.png</image>
94 94
       </texture>
+2 -2
pfd-copilot.xml
... ...
@@ -22,7 +22,7 @@
22 22
     <inherits-from>Effects/model-combined-deferred</inherits-from>
23 23
     <parameters>
24 24
       <lightmap-enabled type="int">1</lightmap-enabled>
25
-      <lightmap-factor><use>instrumentation/zkv1000/Lightmap</use></lightmap-factor>
25
+      <lightmap-factor><use>instrumentation/zkv1000/lightmap</use></lightmap-factor>
26 26
       <texture n="3">
27 27
         <image>Textures/GDU-104X.lightmap.png</image>
28 28
       </texture>
... ...
@@ -76,7 +76,7 @@
76 76
     <inherits-from>Effects/model-combined-deferred</inherits-from>
77 77
     <parameters>
78 78
       <lightmap-enabled type="int">1</lightmap-enabled>
79
-      <lightmap-factor><use>instrumentation/zkv1000/Lightmap</use></lightmap-factor>
79
+      <lightmap-factor><use>instrumentation/zkv1000/lightmap</use></lightmap-factor>
80 80
       <texture n="3">
81 81
         <image>Textures/GDU-104X.lightmap.png</image>
82 82
       </texture>
+2 -2
pfd-pilot.xml
... ...
@@ -22,7 +22,7 @@
22 22
     <inherits-from>Effects/model-combined-deferred</inherits-from>
23 23
     <parameters>
24 24
       <lightmap-enabled type="int">1</lightmap-enabled>
25
-      <lightmap-factor><use>instrumentation/zkv1000/Lightmap</use></lightmap-factor>
25
+      <lightmap-factor><use>instrumentation/zkv1000/lightmap</use></lightmap-factor>
26 26
       <texture n="3">
27 27
         <image>Textures/GDU-104X.lightmap.png</image>
28 28
       </texture>
... ...
@@ -76,7 +76,7 @@
76 76
     <inherits-from>Effects/model-combined-deferred</inherits-from>
77 77
     <parameters>
78 78
       <lightmap-enabled type="int">1</lightmap-enabled>
79
-      <lightmap-factor><use>instrumentation/zkv1000/Lightmap</use></lightmap-factor>
79
+      <lightmap-factor><use>instrumentation/zkv1000/lightmap</use></lightmap-factor>
80 80
       <texture n="3">
81 81
         <image>Textures/GDU-104X.lightmap.png</image>
82 82
       </texture>
+2 -2
pfd.xml
... ...
@@ -22,7 +22,7 @@
22 22
     <inherits-from>Effects/model-combined-deferred</inherits-from>
23 23
     <parameters>
24 24
       <lightmap-enabled type="int">1</lightmap-enabled>
25
-      <lightmap-factor><use>instrumentation/zkv1000/Lightmap</use></lightmap-factor>
25
+      <lightmap-factor><use>instrumentation/zkv1000/lightmap</use></lightmap-factor>
26 26
       <texture n="3">
27 27
         <image>Textures/GDU-104X.lightmap.png</image>
28 28
       </texture>
... ...
@@ -76,7 +76,7 @@
76 76
     <inherits-from>Effects/model-combined-deferred</inherits-from>
77 77
     <parameters>
78 78
       <lightmap-enabled type="int">1</lightmap-enabled>
79
-      <lightmap-factor><use>instrumentation/zkv1000/Lightmap</use></lightmap-factor>
79
+      <lightmap-factor><use>instrumentation/zkv1000/lightmap</use></lightmap-factor>
80 80
       <texture n="3">
81 81
         <image>Textures/GDU-104X.lightmap.png</image>
82 82
       </texture>
+2 -1
zkv1000.nas
... ...
@@ -71,7 +71,8 @@ var init_props = func {
71 71
     zkv.getNode('emission',1).setDoubleValue(0.5);
72 72
     zkv.getNode('body-emission',1).setDoubleValue(0.0);
73 73
     zkv.getNode('body-texture',1).setValue('');
74
-    zkv.getNode('display-brightness-norm',1).setValue(0.5);
74
+    zkv.getNode('display-brightness-norm',1).setDoubleValue(0.5);
75
+    zkv.getNode('lightmap',1).setIntValue(0);
75 76
 
76 77
     radios = zkv.getNode('radios', 1);
77 78
     radios.getNode('nav1-selected',1).setIntValue(0);