Sim: Attempt to fix error on first FG loadup
This commit is contained in:
parent
e0d9c90c81
commit
2d3159e3dc
9 changed files with 37 additions and 9 deletions
|
@ -5,7 +5,6 @@
|
||||||
<PropertyList>
|
<PropertyList>
|
||||||
|
|
||||||
<sim>
|
<sim>
|
||||||
|
|
||||||
<author>it0uchpods Design Group: Joshua Davidson (it0uchpods), Jonathan Redpath (legoboyvdlp), Thorsten Herrmann (TH-555)</author>
|
<author>it0uchpods Design Group: Joshua Davidson (it0uchpods), Jonathan Redpath (legoboyvdlp), Thorsten Herrmann (TH-555)</author>
|
||||||
|
|
||||||
<status>Pre V1.0</status>
|
<status>Pre V1.0</status>
|
||||||
|
@ -404,6 +403,10 @@
|
||||||
</current-view>
|
</current-view>
|
||||||
|
|
||||||
<minimum-fg-version>2018.1.0</minimum-fg-version>
|
<minimum-fg-version>2018.1.0</minimum-fg-version>
|
||||||
|
|
||||||
|
<signals n="0">
|
||||||
|
<hack-canvas type="bool">0</hack-canvas>
|
||||||
|
</signals>
|
||||||
</sim>
|
</sim>
|
||||||
|
|
||||||
<consumables>
|
<consumables>
|
||||||
|
|
|
@ -192,7 +192,7 @@ var canvas_IESI = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
setlistener("sim/signals/fdm-initialized", func {
|
setlistener("/sim/signals/hack-canvas", func {
|
||||||
IESI_display = canvas.new({
|
IESI_display = canvas.new({
|
||||||
"name": "IESI",
|
"name": "IESI",
|
||||||
"size": [1024, 1024],
|
"size": [1024, 1024],
|
||||||
|
|
|
@ -3072,7 +3072,7 @@ var canvas_lowerECAM_test = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
setlistener("sim/signals/fdm-initialized", func {
|
setlistener("/sim/signals/hack-canvas", func {
|
||||||
lowerECAM_display = canvas.new({
|
lowerECAM_display = canvas.new({
|
||||||
"name": "lowerECAM",
|
"name": "lowerECAM",
|
||||||
"size": [1024, 1024],
|
"size": [1024, 1024],
|
||||||
|
|
|
@ -1742,7 +1742,7 @@ var canvas_MCDU_2 = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
setlistener("sim/signals/fdm-initialized", func {
|
setlistener("/sim/signals/hack-canvas", func {
|
||||||
MCDU1_display = canvas.new({
|
MCDU1_display = canvas.new({
|
||||||
"name": "MCDU1",
|
"name": "MCDU1",
|
||||||
"size": [1024, 864],
|
"size": [1024, 864],
|
||||||
|
|
|
@ -287,7 +287,7 @@ var canvas_ND_2_test = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
setlistener("sim/signals/fdm-initialized", func {
|
setlistener("/sim/signals/hack-canvas", func {
|
||||||
setprop("instrumentation/efis[0]/inputs/plan-wpt-index", -1);
|
setprop("instrumentation/efis[0]/inputs/plan-wpt-index", -1);
|
||||||
setprop("instrumentation/efis[1]/inputs/plan-wpt-index", -1);
|
setprop("instrumentation/efis[1]/inputs/plan-wpt-index", -1);
|
||||||
|
|
||||||
|
|
|
@ -1283,7 +1283,7 @@ var canvas_PFD_2_mismatch = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
setlistener("sim/signals/fdm-initialized", func {
|
setlistener("/sim/signals/hack-canvas", func {
|
||||||
PFD1_display = canvas.new({
|
PFD1_display = canvas.new({
|
||||||
"name": "PFD1",
|
"name": "PFD1",
|
||||||
"size": [1024, 1024],
|
"size": [1024, 1024],
|
||||||
|
|
|
@ -1159,7 +1159,7 @@ var canvas_upperECAM_test = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
setlistener("sim/signals/fdm-initialized", func {
|
setlistener("/sim/signals/hack-canvas", func {
|
||||||
upperECAM_display = canvas.new({
|
upperECAM_display = canvas.new({
|
||||||
"name": "upperECAM",
|
"name": "upperECAM",
|
||||||
"size": [1024, 1024],
|
"size": [1024, 1024],
|
||||||
|
|
|
@ -206,6 +206,31 @@ var systemsInit = func {
|
||||||
|
|
||||||
setlistener("/sim/signals/fdm-initialized", func {
|
setlistener("/sim/signals/fdm-initialized", func {
|
||||||
systemsInit();
|
systemsInit();
|
||||||
|
|
||||||
|
canvas.Text._lastText = canvas.Text["_lastText"];
|
||||||
|
canvas.Text.setText = func(text) {
|
||||||
|
if (text == me._lastText and text != nil and size(text) == size(me._lastText)) {return me;}
|
||||||
|
me._lastText = text;
|
||||||
|
me.set("text", typeof(text) == 'scalar' ? text : "");
|
||||||
|
};
|
||||||
|
canvas.Element._lastVisible = nil;
|
||||||
|
canvas.Element.show = func {
|
||||||
|
if (1 == me._lastVisible) {return me;}
|
||||||
|
me._lastVisible = 1;
|
||||||
|
me.setBool("visible", 1);
|
||||||
|
};
|
||||||
|
canvas.Element.hide = func {
|
||||||
|
if (0 == me._lastVisible) {return me;}
|
||||||
|
me._lastVisible = 0;
|
||||||
|
me.setBool("visible", 0);
|
||||||
|
};
|
||||||
|
canvas.Element.setVisible = func(vis) {
|
||||||
|
if (vis == me._lastVisible) {return me;}
|
||||||
|
me._lastVisible = vis;
|
||||||
|
me.setBool("visible", vis);
|
||||||
|
};
|
||||||
|
|
||||||
|
setprop("/sim/signals/hack-canvas", 1);
|
||||||
});
|
});
|
||||||
|
|
||||||
var systemsLoop = maketimer(0.1, func {
|
var systemsLoop = maketimer(0.1, func {
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
4760
|
4761
|
Reference in a new issue