コード例 #1
0
        internal bool SaveSettings()
        {
            try
            {
                Sys.Settings.ProgramsToLaunchPrior = GetUpdatedProgramsToRun();

                Sys.Settings.GameLaunchSettings.AutoMountGameDisc   = AutoMountChecked;
                Sys.Settings.GameLaunchSettings.AutoUnmountGameDisc = AutoUnmountChecked;
                Sys.Settings.GameLaunchSettings.AutoUpdateDiscPath  = AutoUpdatePathChecked;
                Sys.Settings.GameLaunchSettings.ShowLauncherWindow  = IsShowLauncherChecked;

                Sys.Settings.GameLaunchSettings.InGameConfigOption = InGameConfigurationMap[SelectedGameConfigOption];

                Sys.Settings.GameLaunchSettings.Code5Fix   = Code5FixChecked;
                Sys.Settings.GameLaunchSettings.HighDpiFix = HighDpiFixChecked;


                IsReunionInstalled = GameLauncher.IsReunionModInstalled();
                if (IsReunionInstalled)
                {
                    Sys.Settings.GameLaunchSettings.DisableReunionOnLaunch = DisableReunionChecked;
                }
                else
                {
                    Sys.Settings.GameLaunchSettings.DisableReunionOnLaunch = true; // always have this set to true when Reunion is not installed in case user later installs it
                }


                Sys.Settings.GameLaunchSettings.SelectedSoundDevice      = SoundDeviceGuids[SelectedSoundDevice];
                Sys.Settings.GameLaunchSettings.SelectedMidiDevice       = MidiDeviceMap[SelectedMidiDevice];
                Sys.Settings.GameLaunchSettings.MusicVolume              = MusicVolumeValue;
                Sys.Settings.GameLaunchSettings.SfxVolume                = SfxVolumeValue;
                Sys.Settings.GameLaunchSettings.ReverseSpeakers          = IsReverseSpeakersChecked;
                Sys.Settings.GameLaunchSettings.LogarithmicVolumeControl = IsLogVolumeChecked;

                Sys.Settings.GameLaunchSettings.SelectedRenderer         = RendererMap[SelectedRenderer];
                Sys.Settings.GameLaunchSettings.UseRiva128GraphicsOption = IsRivaOptionChecked;
                Sys.Settings.GameLaunchSettings.UseTntGraphicsOption     = IsTntOptionChecked;
                Sys.Settings.GameLaunchSettings.QuarterScreenMode        = IsQuarterScreenChecked;
                Sys.Settings.GameLaunchSettings.FullScreenMode           = IsFullScreenChecked;

                Sys.Save();

                Sys.Message(new WMessage("Game Launcher settings updated!"));
                return(true);
            }
            catch (Exception e)
            {
                StatusMessage = $"Failed to save launch settings: {e.Message}";
                Logger.Error(e);
                return(false);
            }
        }
コード例 #2
0
        private void ShowWarningMessageAbouReunion()
        {
            if (!HasLoaded)
            {
                // prevent warning from showing when loading settings
                return;
            }

            if (GameLauncher.IsReunionModInstalled() && !DisableReunionChecked)
            {
                string warningMsg = "Reunion R06 and newer, even when disabled in Options.ini, forces a custom game driver to load when you run FF7. This conflicts with 7th Heaven's game driver, breaks your graphics settings, and you will experience problems.\n\nIf you wish to play Reunion, do so using a compatible modded version built for 7th Heaven.\n\nAre you sure?";
                var    result     = MessageDialogWindow.Show(warningMsg, "You should leave this setting ON!", MessageBoxButton.YesNo, MessageBoxImage.Warning);

                if (result.Result == MessageBoxResult.No)
                {
                    // re-enable option as user selected 'No' in warning message so reverting option
                    DisableReunionChecked = true;
                }
            }
        }
コード例 #3
0
        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;
        }