1
0
Fork 0

Make restore-defaults option also apply to aircraft-specific data

This commit is contained in:
ThorstenB 2012-07-15 11:07:23 +02:00
parent d01d7730d6
commit 121790f337
2 changed files with 7 additions and 4 deletions

View file

@ -1193,18 +1193,20 @@ _setlistener("/sim/signals/nasal-dir-initialized", func {
} }
#### end of temporary hack for /sim/auto-coordination #### end of temporary hack for /sim/auto-coordination
if (getprop("/sim/startup/save-on-exit")) { if (!getprop("/sim/startup/restore-defaults")) {
# load user-specific aircraft settings
data.load(); data.load();
var n = props.globals.getNode("/sim/aircraft-data"); var n = props.globals.getNode("/sim/aircraft-data");
if (n != nil) if (n != nil)
foreach (var c; n.getChildren("path")) foreach (var c; n.getChildren("path"))
if (c.getType() != "NONE") if (c.getType() != "NONE")
data.add(c.getValue()); data.add(c.getValue());
} else { }
if (!getprop("/sim/startup/save-on-exit"))
{
# prevent saving
data._save_ = func nil; data._save_ = func nil;
data._loop_ = func nil; data._loop_ = func nil;
} }
}); });

View file

@ -54,6 +54,7 @@ Started September 2000 by David Megginson, david@megginson.com
<fullscreen type="bool" preserve="y">false</fullscreen> <fullscreen type="bool" preserve="y">false</fullscreen>
<units>feet</units> <units>feet</units>
<save-on-exit type="bool" userarchive="y">true</save-on-exit> <save-on-exit type="bool" userarchive="y">true</save-on-exit>
<restore-defaults type="bool">false</restore-defaults>
<browser-app write="n">firefox -new-tab "%u"</browser-app> <browser-app write="n">firefox -new-tab "%u"</browser-app>
<!-- help viewer; only used under Unix --> <!-- help viewer; only used under Unix -->
<terminal-ansi-colors type="bool">true</terminal-ansi-colors> <terminal-ansi-colors type="bool">true</terminal-ansi-colors>