public Settings() { ExtraFolders = new List <string>(); ProgramsToLaunchPrior = new List <ProgramLaunchInfo>(); Subscriptions = new List <Subscription>(); Options = new List <GeneralOptions>(); AutoUpdateSource = "#F!yBlHTYiJ!SFpmT2xII7iXcgXAmNYLJg"; DateTimeStringFormat = "MM/dd/yyyy"; IsFirstStart = false; GameLaunchSettings = LaunchSettings.DefaultSettings(); UserColumnSettings = new ColumnSettings(); }
private void LoadSettings(LaunchSettings launchSettings) { HasLoaded = false; if (Sys.Settings.GameLaunchSettings == null) { Logger.Warn("No game launcher settings found, initializing to defaults."); Sys.Settings.GameLaunchSettings = LaunchSettings.DefaultSettings(); launchSettings = Sys.Settings.GameLaunchSettings; } ProgramList = new ObservableCollection <ProgramToRunViewModel>(Sys.Settings.ProgramsToLaunchPrior.Select(s => new ProgramToRunViewModel(s.PathToProgram, s.ProgramArgs))); AutoUpdatePathChecked = launchSettings.AutoUpdateDiscPath; DoWorkaroundErrorCode5 = launchSettings.WorkaroundErrorCode5; IsShowLauncherChecked = launchSettings.ShowLauncherWindow; IsAutoMountSupported = GameDiscMounter.OSHasBuiltInMountSupport(); AutoMountChecked = launchSettings.AutoMountGameDisc; AutoUnmountChecked = launchSettings.AutoUnmountGameDisc; // options to select mount method is disabled if user OS does not support and forced to use wincdemu (i.e. does not support PowerShell Mount-DiskImage) if (IsAutoMountSupported) { SelectedMountOption = MountOptions[(int)launchSettings.MountingOption]; } else { SelectedMountOption = MountOptions[(int)MountDiscOption.MountWithWinCDEmu]; } SetSelectedSoundDeviceFromSettings(launchSettings); SelectedMidiData = MidiDataFormats.Where(s => s.Value == launchSettings.SelectedMidiData) .Select(s => s.Key) .FirstOrDefault(); GetVolumesFromRegistry(); SetSelectedMidiDeviceFromSettings(); IsReverseSpeakersChecked = launchSettings.ReverseSpeakers; IsLogVolumeChecked = launchSettings.LogarithmicVolumeControl; HasLoaded = true; }
internal void ResetToDefaults() { Logger.Info("Resetting game launcher settings to defaults."); LoadSettings(LaunchSettings.DefaultSettings()); }
private void LoadSettings(LaunchSettings launchSettings) { HasLoaded = false; if (Sys.Settings.GameLaunchSettings == null) { Logger.Warn("No game launcher settings found, initializing to defaults."); Sys.Settings.GameLaunchSettings = LaunchSettings.DefaultSettings(); launchSettings = Sys.Settings.GameLaunchSettings; } ProgramList = new ObservableCollection <ProgramToRunViewModel>(Sys.Settings.ProgramsToLaunchPrior.Select(s => new ProgramToRunViewModel(s.PathToProgram, s.ProgramArgs))); AutoUpdatePathChecked = launchSettings.AutoUpdateDiscPath; Code5FixChecked = launchSettings.Code5Fix; HighDpiFixChecked = launchSettings.HighDpiFix; IsShowLauncherChecked = launchSettings.ShowLauncherWindow; SelectedGameConfigOption = InGameConfigurationMap.Where(s => s.Value == launchSettings.InGameConfigOption) .Select(c => c.Key) .FirstOrDefault(); if (string.IsNullOrWhiteSpace(SelectedGameConfigOption)) { // default to first option if their previous option is missing SelectedGameConfigOption = InGameConfigOptions[0]; } // disable options to auto-mount if user OS does not support it IsAutoMountSupported = GameLauncher.OSHasAutoMountSupport(); if (IsAutoMountSupported) { AutoMountChecked = launchSettings.AutoMountGameDisc; AutoUnmountChecked = launchSettings.AutoUnmountGameDisc; } else { AutoMountChecked = false; AutoUnmountChecked = false; } // Have option look unchecked and disabled when user does not have The Reunion installed IsReunionInstalled = GameLauncher.IsReunionModInstalled(); if (IsReunionInstalled) { DisableReunionChecked = launchSettings.DisableReunionOnLaunch; } else { DisableReunionChecked = false; IsReunionInstalled = false; } SelectedSoundDevice = SoundDeviceGuids.Where(s => s.Value == launchSettings.SelectedSoundDevice) .Select(s => s.Key) .FirstOrDefault(); // switch back to 'Auto' if device not found if (SelectedSoundDevice == null) { SelectedSoundDevice = SoundDeviceGuids.Where(s => s.Value == Guid.Empty) .Select(s => s.Key) .FirstOrDefault(); } SelectedMidiDevice = MidiDeviceMap.Where(s => s.Value == launchSettings.SelectedMidiDevice) .Select(s => s.Key) .FirstOrDefault(); MusicVolumeValue = launchSettings.MusicVolume; SfxVolumeValue = launchSettings.SfxVolume; IsReverseSpeakersChecked = launchSettings.ReverseSpeakers; IsLogVolumeChecked = launchSettings.LogarithmicVolumeControl; SelectedRenderer = RendererMap.Where(s => s.Value == launchSettings.SelectedRenderer) .Select(s => s.Key) .FirstOrDefault(); IsRivaOptionChecked = launchSettings.UseRiva128GraphicsOption; IsTntOptionChecked = launchSettings.UseTntGraphicsOption; IsQuarterScreenChecked = launchSettings.QuarterScreenMode; IsFullScreenChecked = launchSettings.FullScreenMode; HasLoaded = true; }