#pragma warning restore CS0649 #pragma warning restore IDE0044 public SwitchSettings(HLE.FileSystem.VirtualFileSystem virtualFileSystem, HLE.FileSystem.Content.ContentManager contentManager) : this(new Builder("Ryujinx.Ui.SwitchSettings.glade"), virtualFileSystem, contentManager) { }
private SwitchSettings(Builder builder, HLE.FileSystem.VirtualFileSystem virtualFileSystem, HLE.FileSystem.Content.ContentManager contentManager) : base(builder.GetObject("_settingsWin").Handle) { builder.Autoconnect(this); _settingsWin.Icon = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.Icon.png"); _controller1Image.Pixbuf = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.JoyCon.png", 500, 500); //Bind Events _lStickUp1.Clicked += (sender, args) => Button_Pressed(sender, args, _lStickUp1); _lStickDown1.Clicked += (sender, args) => Button_Pressed(sender, args, _lStickDown1); _lStickLeft1.Clicked += (sender, args) => Button_Pressed(sender, args, _lStickLeft1); _lStickRight1.Clicked += (sender, args) => Button_Pressed(sender, args, _lStickRight1); _lStickButton1.Clicked += (sender, args) => Button_Pressed(sender, args, _lStickButton1); _dpadUp1.Clicked += (sender, args) => Button_Pressed(sender, args, _dpadUp1); _dpadDown1.Clicked += (sender, args) => Button_Pressed(sender, args, _dpadDown1); _dpadLeft1.Clicked += (sender, args) => Button_Pressed(sender, args, _dpadLeft1); _dpadRight1.Clicked += (sender, args) => Button_Pressed(sender, args, _dpadRight1); _minus1.Clicked += (sender, args) => Button_Pressed(sender, args, _minus1); _l1.Clicked += (sender, args) => Button_Pressed(sender, args, _l1); _zL1.Clicked += (sender, args) => Button_Pressed(sender, args, _zL1); _rStickUp1.Clicked += (sender, args) => Button_Pressed(sender, args, _rStickUp1); _rStickDown1.Clicked += (sender, args) => Button_Pressed(sender, args, _rStickDown1); _rStickLeft1.Clicked += (sender, args) => Button_Pressed(sender, args, _rStickLeft1); _rStickRight1.Clicked += (sender, args) => Button_Pressed(sender, args, _rStickRight1); _rStickButton1.Clicked += (sender, args) => Button_Pressed(sender, args, _rStickButton1); _a1.Clicked += (sender, args) => Button_Pressed(sender, args, _a1); _b1.Clicked += (sender, args) => Button_Pressed(sender, args, _b1); _x1.Clicked += (sender, args) => Button_Pressed(sender, args, _x1); _y1.Clicked += (sender, args) => Button_Pressed(sender, args, _y1); _plus1.Clicked += (sender, args) => Button_Pressed(sender, args, _plus1); _r1.Clicked += (sender, args) => Button_Pressed(sender, args, _r1); _zR1.Clicked += (sender, args) => Button_Pressed(sender, args, _zR1); _controller1Type.Changed += (sender, args) => Controller_Changed(sender, args, _controller1Type.ActiveId, _controller1Image); //Setup Currents if (ConfigurationState.Instance.Logger.EnableFileLog) { _fileLogToggle.Click(); } if (ConfigurationState.Instance.Logger.EnableError) { _errorLogToggle.Click(); } if (ConfigurationState.Instance.Logger.EnableWarn) { _warningLogToggle.Click(); } if (ConfigurationState.Instance.Logger.EnableInfo) { _infoLogToggle.Click(); } if (ConfigurationState.Instance.Logger.EnableStub) { _stubLogToggle.Click(); } if (ConfigurationState.Instance.Logger.EnableDebug) { _debugLogToggle.Click(); } if (ConfigurationState.Instance.Logger.EnableGuest) { _guestLogToggle.Click(); } if (ConfigurationState.Instance.Logger.EnableFsAccessLog) { _fsAccessLogToggle.Click(); } if (ConfigurationState.Instance.System.EnableDockedMode) { _dockedModeToggle.Click(); } if (ConfigurationState.Instance.EnableDiscordIntegration) { _discordToggle.Click(); } if (ConfigurationState.Instance.Graphics.EnableVsync) { _vSyncToggle.Click(); } if (ConfigurationState.Instance.System.EnableMulticoreScheduling) { _multiSchedToggle.Click(); } if (ConfigurationState.Instance.System.EnableFsIntegrityChecks) { _fsicToggle.Click(); } if (ConfigurationState.Instance.System.IgnoreMissingServices) { _ignoreToggle.Click(); } if (ConfigurationState.Instance.Hid.EnableKeyboard) { _directKeyboardAccess.Click(); } if (ConfigurationState.Instance.Ui.EnableCustomTheme) { _custThemeToggle.Click(); } TimeZoneContentManager timeZoneContentManager = new TimeZoneContentManager(); timeZoneContentManager.InitializeInstance(virtualFileSystem, contentManager, LibHac.FsSystem.IntegrityCheckLevel.None); List <string> locationNames = timeZoneContentManager.LocationNameCache.ToList(); locationNames.Sort(); foreach (string locationName in locationNames) { _systemTimeZoneSelect.Append(locationName, locationName); } _systemLanguageSelect.SetActiveId(ConfigurationState.Instance.System.Language.Value.ToString()); _systemRegionSelect.SetActiveId(ConfigurationState.Instance.System.Region.Value.ToString()); _systemTimeZoneSelect.SetActiveId(timeZoneContentManager.SanityCheckDeviceLocationName()); _anisotropy.SetActiveId(ConfigurationState.Instance.Graphics.MaxAnisotropy.Value.ToString()); _controller1Type.SetActiveId(ConfigurationState.Instance.Hid.ControllerType.Value.ToString()); Controller_Changed(null, null, _controller1Type.ActiveId, _controller1Image); _lStickUp1.Label = ConfigurationState.Instance.Hid.KeyboardControls.Value.LeftJoycon.StickUp.ToString(); _lStickDown1.Label = ConfigurationState.Instance.Hid.KeyboardControls.Value.LeftJoycon.StickDown.ToString(); _lStickLeft1.Label = ConfigurationState.Instance.Hid.KeyboardControls.Value.LeftJoycon.StickLeft.ToString(); _lStickRight1.Label = ConfigurationState.Instance.Hid.KeyboardControls.Value.LeftJoycon.StickRight.ToString(); _lStickButton1.Label = ConfigurationState.Instance.Hid.KeyboardControls.Value.LeftJoycon.StickButton.ToString(); _dpadUp1.Label = ConfigurationState.Instance.Hid.KeyboardControls.Value.LeftJoycon.DPadUp.ToString(); _dpadDown1.Label = ConfigurationState.Instance.Hid.KeyboardControls.Value.LeftJoycon.DPadDown.ToString(); _dpadLeft1.Label = ConfigurationState.Instance.Hid.KeyboardControls.Value.LeftJoycon.DPadLeft.ToString(); _dpadRight1.Label = ConfigurationState.Instance.Hid.KeyboardControls.Value.LeftJoycon.DPadRight.ToString(); _minus1.Label = ConfigurationState.Instance.Hid.KeyboardControls.Value.LeftJoycon.ButtonMinus.ToString(); _l1.Label = ConfigurationState.Instance.Hid.KeyboardControls.Value.LeftJoycon.ButtonL.ToString(); _zL1.Label = ConfigurationState.Instance.Hid.KeyboardControls.Value.LeftJoycon.ButtonZl.ToString(); _rStickUp1.Label = ConfigurationState.Instance.Hid.KeyboardControls.Value.RightJoycon.StickUp.ToString(); _rStickDown1.Label = ConfigurationState.Instance.Hid.KeyboardControls.Value.RightJoycon.StickDown.ToString(); _rStickLeft1.Label = ConfigurationState.Instance.Hid.KeyboardControls.Value.RightJoycon.StickLeft.ToString(); _rStickRight1.Label = ConfigurationState.Instance.Hid.KeyboardControls.Value.RightJoycon.StickRight.ToString(); _rStickButton1.Label = ConfigurationState.Instance.Hid.KeyboardControls.Value.RightJoycon.StickButton.ToString(); _a1.Label = ConfigurationState.Instance.Hid.KeyboardControls.Value.RightJoycon.ButtonA.ToString(); _b1.Label = ConfigurationState.Instance.Hid.KeyboardControls.Value.RightJoycon.ButtonB.ToString(); _x1.Label = ConfigurationState.Instance.Hid.KeyboardControls.Value.RightJoycon.ButtonX.ToString(); _y1.Label = ConfigurationState.Instance.Hid.KeyboardControls.Value.RightJoycon.ButtonY.ToString(); _plus1.Label = ConfigurationState.Instance.Hid.KeyboardControls.Value.RightJoycon.ButtonPlus.ToString(); _r1.Label = ConfigurationState.Instance.Hid.KeyboardControls.Value.RightJoycon.ButtonR.ToString(); _zR1.Label = ConfigurationState.Instance.Hid.KeyboardControls.Value.RightJoycon.ButtonZr.ToString(); _custThemePath.Buffer.Text = ConfigurationState.Instance.Ui.CustomThemePath; _graphicsShadersDumpPath.Buffer.Text = ConfigurationState.Instance.Graphics.ShadersDumpPath; _fsLogSpinAdjustment.Value = ConfigurationState.Instance.System.FsGlobalAccessLogMode; _systemTimeOffset = ConfigurationState.Instance.System.SystemTimeOffset; _gameDirsBox.AppendColumn("", new CellRendererText(), "text", 0); _gameDirsBoxStore = new ListStore(typeof(string)); _gameDirsBox.Model = _gameDirsBoxStore; foreach (string gameDir in ConfigurationState.Instance.Ui.GameDirs.Value) { _gameDirsBoxStore.AppendValues(gameDir); } if (_custThemeToggle.Active == false) { _custThemePath.Sensitive = false; _custThemePathLabel.Sensitive = false; _browseThemePath.Sensitive = false; } _listeningForKeypress = false; //Setup system time spinners UpdateSystemTimeSpinners(); }