Esempio n. 1
0
        private void Save(object sender, RoutedEventArgs e)
        {
            Console.Info("Saving kernel settings");

            switch (Mode.SelectedIndex)
            {
            case 0:
                _configuration.Mode = Kernel.Configuration.ConfigurationMode.HCE;
                break;

            case 1:
                _configuration.Mode = Kernel.Configuration.ConfigurationMode.SPV31;
                break;

            case 2:
                _configuration.Mode = Kernel.Configuration.ConfigurationMode.SPV32;
                break;

            case 3:
                _configuration.Mode = Kernel.Configuration.ConfigurationMode.SPV33;
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            _configuration.Main.Reset          = MainReset.IsChecked == true;
            _configuration.Main.Patch          = MainPatch.IsChecked == true;
            _configuration.Main.Start          = MainStart.IsChecked == true;
            _configuration.Main.Resume         = MainResume.IsChecked == true;
            _configuration.Main.Elevated       = MainElevated.IsChecked == true;
            _configuration.Tweaks.CinemaBars   = TweaksCinemaBars.IsChecked == true;
            _configuration.Tweaks.Sensor       = TweaksSensor.IsChecked == true;
            _configuration.Tweaks.Magnetism    = TweaksMagnetism.IsChecked == true;
            _configuration.Tweaks.AutoAim      = TweaksAutoAim.IsChecked == true;
            _configuration.Tweaks.Acceleration = TweaksAcceleration.IsChecked == true;
            _configuration.Tweaks.Unload       = TweaksUnload.IsChecked == true;
            _configuration.Video.Resolution    = VideoResolution.IsChecked == true;
            _configuration.Video.Uncap         = VideoUncap.IsChecked == true;
            _configuration.Video.Quality       = VideoQuality.IsChecked == true;
            _configuration.Video.Bless         = VideoBless.IsChecked == true;
            _configuration.Video.UseGamma      = VideoUseGamma.IsChecked == true;
            _configuration.Audio.Quality       = AudioQuality.IsChecked == true;
            _configuration.Audio.Enhancements  = AudioEnhancements.IsChecked == true;
            _configuration.Input.Override      = InputOverride.IsChecked == true;

            try
            {
                _configuration.Video.Gamma = byte.Parse(VideoGamma.Text);
            }
            catch (Exception)
            {
                _configuration.Video.Gamma = 0;
            }

            _configuration.Save();
            _configuration.Load();

            PrintConfiguration();

            Exit.WithCode(Exit.Code.Success);
        }
Esempio n. 2
0
 private void Cancel(object sender, RoutedEventArgs e)
 {
     Exit.WithCode(Exit.Code.Success);
 }