// Returns true when file settings are active public bool Startup() { if (RawAccelSettings.Exists()) { try { RawAccelSettings = RawAccelSettings.Load(() => MakeGUISettingsFromFields()); UpdateFieldsFromGUISettings(); if (RawAccelSettings.GUISettings.AutoWriteToDriverOnStartup) { TryUpdateAccel(RawAccelSettings.AccelerationSettings); } return(RawAccelSettings.GUISettings.AutoWriteToDriverOnStartup); } catch (JsonException e) { Console.WriteLine($"bad settings: {e}"); } } RawAccelSettings = new RawAccelSettings( DriverInterop.GetActiveSettings(), MakeGUISettingsFromFields()); RawAccelSettings.Save(); return(true); }
public void Startup() { if (RawAccelSettings.Exists()) { try { RawAccelSettings = RawAccelSettings.Load(() => MakeGUISettingsFromFields()); UpdateFieldsFromGUISettings(); UpdateActiveAccelFromFileSettings(RawAccelSettings.AccelerationSettings); return; } catch (JsonException e) { Console.WriteLine($"bad settings: {e}"); } } RawAccelSettings = new RawAccelSettings( DriverInterop.GetActiveSettings(), MakeGUISettingsFromFields()); RawAccelSettings.Save(); }