1
0
Fork 0

Use acconfig option

This commit is contained in:
legoboyvdlp R 2021-01-21 12:56:22 +00:00
parent d5c4f80c64
commit 40213dab44
4 changed files with 33 additions and 2 deletions

View file

@ -80,6 +80,7 @@ setprop("/systems/acconfig/options/wxr-server", "noaa");
setprop("/systems/acconfig/options/welcome-skip", 0);
setprop("/systems/acconfig/options/no-rendering-warn", 0);
setprop("/systems/acconfig/options/save-state", 0);
setprop("/systems/acconfig/options/hide-canvas-outside", 0);
setprop("/systems/acconfig/options/seperate-tiller-axis", 0);
setprop("/systems/acconfig/options/pfd-rate", 1);
setprop("/systems/acconfig/options/nd-rate", 1);
@ -235,6 +236,7 @@ var readSettings = func {
setprop("/FMGC/simbrief-username", getprop("/systems/acconfig/options/simbrief-username"));
setprop("/systems/atsu/atis-server", getprop("/systems/acconfig/options/atis-server"));
setprop("/systems/atsu/wxr-server", getprop("/systems/acconfig/options/wxr-server"));
setprop("/options/hide-canvas-outside", getprop("/systems/acconfig/options/hide-canvas-outside"));
}
var writeSettings = func {
@ -249,6 +251,7 @@ var writeSettings = func {
setprop("/systems/acconfig/options/simbrief-username", getprop("/FMGC/simbrief-username"));
setprop("/systems/acconfig/options/atis-server", getprop("/systems/atsu/atis-server"));
setprop("/systems/acconfig/options/wxr-server", getprop("/systems/atsu/wxr-server"));
setprop("/systems/acconfig/options/hide-canvas-outside", getprop("/options/hide-canvas-outside"));
io.write_properties(getprop("/sim/fg-home") ~ "/Export/A320-family-config.xml", "/systems/acconfig/options");
}

View file

@ -343,6 +343,26 @@
<live>true</live>
</checkbox>
<checkbox>
<label>Disable Canvas in External Views</label>
<halign>left</halign>
<property>/systems/acconfig/options/hide-canvas-outside</property>
<binding>
<command>property-toggle</command>
<property>options/hide-canvas-outside</property>
</binding>
<binding>
<command>dialog-apply</command>
</binding>
<binding>
<command>nasal</command>
<script>
acconfig.writeSettings();
</script>
</binding>
<live>true</live>
</checkbox>
<checkbox>
<!-- TODO there might be a better way to formulate this. -->
<label>Save States Between Sessions</label>

View file

@ -981,7 +981,10 @@
<object-name>dcduScreenL</object-name>
<object-name>dcduScreenR</object-name>
<condition>
<property>sim/current-view/internal</property>
<or>
<not><property>options/hide-canvas-outside</property></not>
<property>sim/current-view/internal</property>
</or>
</condition>
</animation>

View file

@ -378,9 +378,10 @@ foreach (var name; keys(input)) {
emesary.GlobalTransmitter.NotifyAll(notifications.FrameNotificationAddProperty.new("A320 Libraries", name, input[name]));
}
var hideCanvas = props.globals.getNode("/options/hide-canvas-outside");
var internal = props.globals.getNode("/sim/current-view/internal");
var toggleScreen = func() {
if (!internal.getValue()) {
if (!internal.getValue() and hideCanvas.getValue()) {
canvas_pfd.PFD_update.stop();
canvas_ecam.lowerECAM_update.stop();
canvas_nd.nd_update.stop();
@ -395,6 +396,10 @@ var toggleScreen = func() {
}
};
setlistener("/options/hide-canvas-outside", func() {
toggleScreen();
}, 0, 0);
setlistener("/sim/current-view/internal", func() {
toggleScreen();
}, 0, 0);