From 1b93911ff0eddea0449ca87f2c4a541e157b0663 Mon Sep 17 00:00:00 2001 From: Joshua Davidson Date: Tue, 23 May 2017 19:38:16 -0400 Subject: [PATCH] consistant settings between sessions --- A320-main.xml | 3 ++- AircraftConfig/acconfig.nas | 11 ++++++----- AircraftConfig/main.xml | 14 +++++++++++++- AircraftConfig/settings.conf | 2 -- Nasal/ADIRS.nas | 2 -- 5 files changed, 21 insertions(+), 11 deletions(-) delete mode 100644 AircraftConfig/settings.conf diff --git a/A320-main.xml b/A320-main.xml index 1b0741f7..9a98eeba 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -391,6 +391,7 @@ false false + 0 0 @@ -520,7 +521,7 @@ - 0 + 0 diff --git a/AircraftConfig/acconfig.nas b/AircraftConfig/acconfig.nas index 644fc67b..6a5614f6 100644 --- a/AircraftConfig/acconfig.nas +++ b/AircraftConfig/acconfig.nas @@ -12,15 +12,16 @@ var fbw_dlg = gui.Dialog.new("sim/gui/dialogs/acconfig/fbw/dialog", "Aircraft/A3 init_dlg.open(); setlistener("/sim/signals/fdm-initialized", func { -# loadSettings(); init_dlg.close(); welcome_dlg.open(); }); -#var loadSettings = func { -# var file = io.open(getprop("/sim/aircraft-dir")~"/AircraftConfig/settings.conf","r+"); -# print(file); -#} +var saveSettings = func { + aircraft.data.add("/options/pfd/sidestick-pos", "/controls/adirs/skip"); + aircraft.data.save(); +} + +saveSettings(); var systemsReset = func { systems.elec_init(); diff --git a/AircraftConfig/main.xml b/AircraftConfig/main.xml index 0b9763e8..70b84101 100644 --- a/AircraftConfig/main.xml +++ b/AircraftConfig/main.xml @@ -288,7 +288,7 @@ - + left /controls/adirs/skip @@ -298,6 +298,12 @@ dialog-apply + + nasal + + true @@ -312,6 +318,12 @@ dialog-apply + + nasal + + true diff --git a/AircraftConfig/settings.conf b/AircraftConfig/settings.conf deleted file mode 100644 index d80701fb..00000000 --- a/AircraftConfig/settings.conf +++ /dev/null @@ -1,2 +0,0 @@ -skipADIRS=0 -showPFDSideStick=0 \ No newline at end of file diff --git a/Nasal/ADIRS.nas b/Nasal/ADIRS.nas index 4738bd50..c3f4d981 100644 --- a/Nasal/ADIRS.nas +++ b/Nasal/ADIRS.nas @@ -15,7 +15,6 @@ setprop("/systems/electrical/bus/ac2", 0); setprop("/systems/electrical/bus/ac-ess", 0); var adirs_init = func { - setprop("controls/adirs/skip",0); #define this here, as we want this to be off on startup setprop("/controls/adirs/mcducbtn",0); adirs_timer.start(); } @@ -50,7 +49,6 @@ var ADIRSreset = func { setprop("/controls/adirs/ir[1]/fault",0); setprop("/controls/adirs/ir[2]/fault",0); setprop("/controls/adirs/onbat",0); - setprop("/controls/adirs/skip",0); setprop("/controls/adirs/mcducbtn",0); adirs_init(); }