Showing 3 changed files with 11 additions and 8 deletions
+1 -1
Nasal/EIS/single-prop.nas
... ...
@@ -1,5 +1,5 @@
1 1
 displayClass.showEIS = func (groups) {
2
-    canvas.parsesvg(me.screen, "Aircraft/Instruments-3d/zkv1000/Systems/EIS/single-prop.svg");
2
+    canvas.parsesvg(me.screen, data.zkv1000_reldir ~ 'Systems/EIS/single-prop.svg');
3 3
     append(groups.show, 'EIS', 'POWER-pointer');
4 4
     append(groups.text,
5 5
             'RPM-text', 'EGT-text', 'CHT-text', 'FUEL-USED-text',
+3 -3
Nasal/display.nas
... ...
@@ -26,14 +26,14 @@ var displayClass = {
26 26
         if (device.role == 'MFD') {
27 27
             m.MFDMapTiles = MapTiles.new(m.display);
28 28
             m.MFDMapNavDisplay = MapNavDisplay.new(m.display);
29
-            var eis_dir = getprop('/sim/fg-aircraft') ~ '/Instruments-3d/zkv1000/Nasal/EIS/';
29
+            var eis_dir = data.zkv1000_dir ~ 'Nasal/EIS/';
30 30
             var eis_type = getprop('/instrumentation/zkv1000/eis/type');
31 31
             if (eis_type == nil or
32 32
                     (io.stat(eis_dir ~ eis_type ~ '.nas') == nil
33 33
                      and print(eis_type ~ ' not found')))
34 34
                 eis_type = 'none';
35 35
             io.load_nasal(eis_dir ~ eis_type ~ '.nas', 'zkv1000');
36
-            io.load_nasal(getprop('/sim/fg-aircraft') ~ '/Instruments-3d/zkv1000/Nasal/MFD.pages.nas', 'zkv1000');
36
+            io.load_nasal(data.zkv1000_dir ~ 'Nasal/MFD.pages.nas', 'zkv1000');
37 37
         }
38 38
 
39 39
         return m;
... ...
@@ -66,7 +66,7 @@ var displayClass = {
66 66
     loadsvg : func () {
67 67
         me.screen = me.display.createGroup();
68 68
         me.screen.hide();
69
-        canvas.parsesvg(me.screen, "Aircraft/Instruments-3d/zkv1000/Systems/screen.svg");
69
+        canvas.parsesvg(me.screen, data.zkv1000_reldir ~ 'Systems/screen.svg');
70 70
     },
71 71
 
72 72
     _showInitProgress : func (p,t) {
+7 -4
zkv1000.nas
... ...
@@ -171,18 +171,21 @@ var init_props = func {
171 171
     props.globals.getNode('/autopilot/locks/pitch',1).setValue('');
172 172
     props.globals.getNode('/autopilot/locks/roll',1).setValue('');
173 173
     props.globals.getNode('/autopilot/locks/passive-mode', 1).setIntValue(1);
174
+
175
+    data.zkv1000_dir = getprop('/sim/fg-aircraft') ~ '/Instruments-3d/zkv1000/';
176
+    data.zkv1000_reldir = 'Aircraft/Instruments-3d/zkv1000/';
174 177
 }
175 178
 
176 179
 var load_nasal = func {
177
-    var zkv1000_dir = getprop('/sim/fg-aircraft') ~ '/Instruments-3d/zkv1000/Nasal/';
180
+    var nasal_dir = data.zkv1000_dir ~ 'Nasal/';
178 181
     for (var i = 0; i < size(files_to_load); i += 1)
179
-        io.load_nasal(zkv1000_dir ~ files_to_load[i], 'zkv1000');
182
+        io.load_nasal(nasal_dir ~ files_to_load[i], 'zkv1000');
180 183
     files_to_load = nil;
181 184
 }
182 185
 
183 186
 var load_multikey = func {
184 187
     fgcommand('loadxml', props.Node.new({
185
-        'filename': getprop('/sim/fg-aircraft') ~ '/Instruments-3d/zkv1000/Systems/multikey.xml',
188
+        'filename': data.zkv1000_dir ~ 'Systems/multikey.xml',
186 189
         'targetnode': '/input/keyboard/'
187 190
     }));
188 191
     multikey.init();
... ...
@@ -190,8 +193,8 @@ var load_multikey = func {
190 193
 
191 194
 var zkv1000_init = func {
192 195
     removelistener(init);
193
-    load_multikey();
194 196
     init_props();
197
+    load_multikey();
195 198
     load_nasal();
196 199
     print('zkv1000 loaded');
197 200
 }