diff --git a/BizHawk.Client.Common/config/Config.cs b/BizHawk.Client.Common/config/Config.cs index 4c4232f8ef..27d96254df 100644 --- a/BizHawk.Client.Common/config/Config.cs +++ b/BizHawk.Client.Common/config/Config.cs @@ -28,7 +28,7 @@ namespace BizHawk.Client.Common } // Core preference for generic file extension, key: file extension, value: a systemID or empty if no preference - public Dictionary PreferredPlatformsForExtensions = new Dictionary + public Dictionary PreferredPlatformsForExtensions { get; set; } = new Dictionary { [".bin"] = "", [".rom"] = "", @@ -38,150 +38,152 @@ namespace BizHawk.Client.Common }; // Path Settings ************************************/ - public bool UseRecentForRoms = false; - public string LastRomPath = "."; - public PathEntryCollection PathEntries = new PathEntryCollection(); + public bool UseRecentForRoms { get; set; } + public string LastRomPath { get; set; } = "."; + public PathEntryCollection PathEntries { get; set; } = new PathEntryCollection(); // BIOS Paths - public Dictionary FirmwareUserSpecifications = new Dictionary(); // key: sysid+firmwareId; value: absolute path + // key: sysId+firmwareId; value: absolute path + public Dictionary FirmwareUserSpecifications { get; set; } = new Dictionary(); // General Client Settings - public int InputHotkeyOverrideOptions = 0; - public bool StackOSDMessages = true; + public int InputHotkeyOverrideOptions { get; set; } + public bool StackOSDMessages { get; set; } = true; - public ZoomFactors TargetZoomFactors = new ZoomFactors(); + public ZoomFactors TargetZoomFactors { get; set; } = new ZoomFactors(); - public int TargetScanlineFilterIntensity = 128; // choose between 0 and 256 - public int TargetDisplayFilter = 0; - public int DispFinalFilter = 0; // None - public string DispUserFilterPath = ""; - public RecentFiles RecentRoms = new RecentFiles(10); - public bool PauseWhenMenuActivated = true; - public bool SaveWindowPosition = true; - public bool StartPaused = false; - public bool StartFullscreen = false; - public int MainWndx = -1; // Negative numbers will be ignored - public int MainWndy = -1; - public bool RunInBackground = true; - public bool AcceptBackgroundInput = false; - public bool AcceptBackgroundInputControllerOnly = false; - public bool HandleAlternateKeyboardLayouts = false; - public bool SingleInstanceMode = false; - public bool AllowUdlr = false; - public bool ForbidUdlr = false; - public bool ShowContextMenu = true; - public bool EnableBackupMovies = true; - public bool MoviesOnDisk = false; - public bool MoviesInAwe = false; - public bool HotkeyConfigAutoTab = true; - public bool InputConfigAutoTab = true; - public bool BackupSavestates = true; - public bool SaveScreenshotWithStates = true; - public int BigScreenshotSize = 128 * 1024; - public bool NoLowResLargeScreenshotWithStates = false; - public int AutofireOn = 1; - public int AutofireOff = 1; - public bool AutofireLagFrames = true; - public int SaveSlot = 0; // currently selected savestate slot - public bool AutoLoadLastSaveSlot = false; - public bool SkipLagFrame = false; - public bool SuppressAskSave = false; - public bool AviCaptureOsd = false; - public bool ScreenshotCaptureOsd = false; - public bool FirstBoot = true; - public bool UpdateAutoCheckEnabled = false; - public DateTime? UpdateLastCheckTimeUtc = null; - public string UpdateLatestVersion = ""; - public string UpdateIgnoreVersion = ""; - public bool SkipOutdatedOsCheck = false; + // choose between 0 and 256 + public int TargetScanlineFilterIntensity { get; set; } = 128; + public int TargetDisplayFilter { get; set; } + public int DispFinalFilter { get; set; } = 0; // None + public string DispUserFilterPath { get; set; } = ""; + public RecentFiles RecentRoms { get; set; } = new RecentFiles(10); + public bool PauseWhenMenuActivated { get; set; } = true; + public bool SaveWindowPosition { get; set; } = true; + public bool StartPaused { get; set; } + public bool StartFullscreen { get; set; } + public int MainWndx { get; set; } = -1; // Negative numbers will be ignored + public int MainWndy { get; set; } = -1; + public bool RunInBackground { get; set; } = true; + public bool AcceptBackgroundInput { get; set; } + public bool AcceptBackgroundInputControllerOnly { get; set; } + public bool HandleAlternateKeyboardLayouts { get; set; } + public bool SingleInstanceMode { get; set; } + public bool AllowUdlr { get; set; } + public bool ForbidUdlr { get; set; } + public bool ShowContextMenu { get; set; } = true; + public bool EnableBackupMovies { get; set; } = true; + public bool MoviesOnDisk { get; set; } + public bool MoviesInAwe { get; set; } + public bool HotkeyConfigAutoTab { get; set; } = true; + public bool InputConfigAutoTab { get; set; } = true; + public bool BackupSavestates { get; set; } = true; + public bool SaveScreenshotWithStates { get; set; } = true; + public int BigScreenshotSize { get; set; } = 128 * 1024; + public bool NoLowResLargeScreenshotWithStates { get; set; } + public int AutofireOn { get; set; } = 1; + public int AutofireOff { get; set; } = 1; + public bool AutofireLagFrames { get; set; } = true; + public int SaveSlot { get; set; } // currently selected savestate slot + public bool AutoLoadLastSaveSlot { get; set; } + public bool SkipLagFrame { get; set; } + public bool SuppressAskSave { get; set; } + public bool AviCaptureOsd { get; set; } + public bool ScreenshotCaptureOsd { get; set; } + public bool FirstBoot { get; set; } = true; + public bool UpdateAutoCheckEnabled { get; set; } + public DateTime? UpdateLastCheckTimeUtc { get; set; } + public string UpdateLatestVersion { get; set; } = ""; + public string UpdateIgnoreVersion { get; set; } = ""; + public bool SkipOutdatedOsCheck { get; set; } /// /// Makes a .bak file before any saveram-writing operation (could be extended to make timestamped backups) /// - public bool BackupSaveram = true; + public bool BackupSaveram { get; set; } = true; /// /// Whether to make AutoSave files at periodic intervals /// - public bool AutosaveSaveRAM; + public bool AutosaveSaveRAM { get; set; } /// /// Intervals at which to make AutoSave files /// - public int FlushSaveRamFrames; + public int FlushSaveRamFrames { get; set; } /// Don't rename this without changing BizHawk.Client.EmuHawk.Program.CurrentDomain_AssemblyResolve - public ELuaEngine LuaEngine = ELuaEngine.LuaPlusLuaInterface; + public ELuaEngine LuaEngine { get; set; } = ELuaEngine.LuaPlusLuaInterface; public bool TurboSeek { get; set; } - public MovieEndAction MovieEndAction = MovieEndAction.Finish; + public MovieEndAction MovieEndAction { get; set; } = MovieEndAction.Finish; - public ClientProfile SelectedProfile = ClientProfile.Unknown; + public ClientProfile SelectedProfile { get; set; } = ClientProfile.Unknown; // N64 - public bool N64UseCircularAnalogConstraint = true; + public bool N64UseCircularAnalogConstraint { get; set; } = true; // Run-Control settings - public int FrameProgressDelayMs = 500; // how long until a frame advance hold turns into a frame progress? - public int FrameSkip = 4; - public int SpeedPercent = 100; - public int SpeedPercentAlternate = 400; - public bool ClockThrottle = true; - public bool AutoMinimizeSkipping = true; - public bool VSyncThrottle = false; + public int FrameProgressDelayMs { get; set; } = 500; // how long until a frame advance hold turns into a frame progress? + public int FrameSkip { get; set; } = 4; + public int SpeedPercent { get; set; } = 100; + public int SpeedPercentAlternate { get; set; } = 400; + public bool ClockThrottle { get; set; }= true; + public bool AutoMinimizeSkipping { get; set; } = true; + public bool VSyncThrottle { get; set; } = false; public RewindConfig Rewind { get; set; } = new RewindConfig(); // Savestate settings - public SaveStateTypeE SaveStateType = SaveStateTypeE.Default; + public SaveStateTypeE SaveStateType { get; set; } = SaveStateTypeE.Default; public const int DefaultSaveStateCompressionLevelNormal = 1; - public int SaveStateCompressionLevelNormal = DefaultSaveStateCompressionLevelNormal; + public int SaveStateCompressionLevelNormal { get; set; } = DefaultSaveStateCompressionLevelNormal; public const int DefaultSaveStateCompressionLevelRewind = 0; // this isn't actually used yet - public int SaveStateCompressionLevelRewind = DefaultSaveStateCompressionLevelRewind; // this isn't actually used yet - public int MovieCompressionLevel = 2; + public int SaveStateCompressionLevelRewind { get; set; } = DefaultSaveStateCompressionLevelRewind; // this isn't actually used yet + public int MovieCompressionLevel { get; set; } = 2; /// /// Use vsync when presenting all 3d accelerated windows. /// For the main window, if VSyncThrottle = false, this will try to use vsync without throttling to it /// - public bool VSync = false; + public bool VSync { get; set; } /// /// Tries to use an alternate vsync mechanism, for video cards that just can't do it right /// - public bool DispAlternateVsync = false; + public bool DispAlternateVsync { get; set; } // Display options - public bool DisplayFps = false; - public bool DisplayFrameCounter = false; - public bool DisplayLagCounter = false; - public bool DisplayInput = false; - public bool DisplayRerecordCount = false; - public bool DisplayMessages = true; + public bool DisplayFps { get; set; } + public bool DisplayFrameCounter { get; set; } + public bool DisplayLagCounter { get; set; } + public bool DisplayInput { get; set; } + public bool DisplayRerecordCount { get; set; } + public bool DisplayMessages { get; set; } = true; - public bool DispFixAspectRatio = true; - public bool DispFixScaleInteger = false; - public bool DispFullscreenHacks = true; - public bool DispAutoPrescale = true; - public int DispSpeedupFeatures = 2; + public bool DispFixAspectRatio { get; set; } = true; + public bool DispFixScaleInteger { get; set; } + public bool DispFullscreenHacks { get; set; } + public bool DispAutoPrescale { get; set; } + public int DispSpeedupFeatures { get; set; } = 2; - public MessagePosition Fps = DefaultMessagePositions.Fps.Clone(); - public MessagePosition FrameCounter = DefaultMessagePositions.FrameCounter.Clone(); - public MessagePosition LagCounter = DefaultMessagePositions.LagCounter.Clone(); - public MessagePosition InputDisplay = DefaultMessagePositions.InputDisplay.Clone(); - public MessagePosition ReRecordCounter = DefaultMessagePositions.ReRecordCounter.Clone(); - public MessagePosition MultitrackRecorder = DefaultMessagePositions.MultitrackRecorder.Clone(); - public MessagePosition Messages = DefaultMessagePositions.Messages.Clone(); - public MessagePosition Autohold = DefaultMessagePositions.Autohold.Clone(); - public MessagePosition RamWatches = DefaultMessagePositions.RamWatches.Clone(); + public MessagePosition Fps { get; set; } = DefaultMessagePositions.Fps.Clone(); + public MessagePosition FrameCounter { get; set; } = DefaultMessagePositions.FrameCounter.Clone(); + public MessagePosition LagCounter { get; set; } = DefaultMessagePositions.LagCounter.Clone(); + public MessagePosition InputDisplay { get; set; } = DefaultMessagePositions.InputDisplay.Clone(); + public MessagePosition ReRecordCounter { get; set; } = DefaultMessagePositions.ReRecordCounter.Clone(); + public MessagePosition MultitrackRecorder { get; set; } = DefaultMessagePositions.MultitrackRecorder.Clone(); + public MessagePosition Messages { get; set; } = DefaultMessagePositions.Messages.Clone(); + public MessagePosition Autohold { get; set; } = DefaultMessagePositions.Autohold.Clone(); + public MessagePosition RamWatches { get; set; } = DefaultMessagePositions.RamWatches.Clone(); - public int MessagesColor = DefaultMessagePositions.MessagesColor; - public int AlertMessageColor = DefaultMessagePositions.AlertMessageColor; - public int LastInputColor = DefaultMessagePositions.LastInputColor; - public int MovieInput = DefaultMessagePositions.MovieInput; + public int MessagesColor { get; set; } = DefaultMessagePositions.MessagesColor; + public int AlertMessageColor { get; set; } = DefaultMessagePositions.AlertMessageColor; + public int LastInputColor { get; set; } = DefaultMessagePositions.LastInputColor; + public int MovieInput { get; set; } = DefaultMessagePositions.MovieInput; - public int DispPrescale = 1; + public int DispPrescale { get; set; } = 1; private static bool DetectDirectX() { @@ -193,129 +195,129 @@ namespace BizHawk.Client.Common } /// warning: we don't even want to deal with changing this at runtime. but we want it changed here for config purposes. so don't check this variable. check in GlobalWin or something like that. - public EDispMethod DispMethod = DetectDirectX() ? EDispMethod.SlimDX9 : EDispMethod.OpenGL; + public EDispMethod DispMethod { get; set; } = DetectDirectX() ? EDispMethod.SlimDX9 : EDispMethod.OpenGL; - public int DispChromeFrameWindowed = 2; - public bool DispChromeStatusBarWindowed = true; - public bool DispChromeCaptionWindowed = true; - public bool DispChromeMenuWindowed = true; - public bool DispChromeStatusBarFullscreen = false; - public bool DispChromeMenuFullscreen = false; - public bool DispChromeFullscreenAutohideMouse = true; - public bool DispChromeAllowDoubleClickFullscreen = true; + public int DispChromeFrameWindowed { get; set; } = 2; + public bool DispChromeStatusBarWindowed { get; set; } = true; + public bool DispChromeCaptionWindowed { get; set; } = true; + public bool DispChromeMenuWindowed { get; set; } = true; + public bool DispChromeStatusBarFullscreen { get; set; } + public bool DispChromeMenuFullscreen { get; set; } + public bool DispChromeFullscreenAutohideMouse { get; set; } = true; + public bool DispChromeAllowDoubleClickFullscreen { get; set; } = true; - public EDispManagerAR DispManagerAR = EDispManagerAR.System; + public EDispManagerAR DispManagerAR { get; set; } = EDispManagerAR.System; // these are misnomers. they're actually a fixed size (fixme on major release) - public int DispCustomUserARWidth = -1; - public int DispCustomUserARHeight = -1; + public int DispCustomUserARWidth { get; set; } = -1; + public int DispCustomUserARHeight { get; set; } = -1; // these are more like the actual AR ratio (i.e. 4:3) (fixme on major release) - public float DispCustomUserArx = -1; - public float DispCustomUserAry = -1; + public float DispCustomUserArx { get; set; } = -1; + public float DispCustomUserAry { get; set; } = -1; //these default to 0 because by default we crop nothing - public int DispCropLeft = 0; - public int DispCropTop = 0; - public int DispCropRight = 0; - public int DispCropBottom = 0; + public int DispCropLeft { get; set; } = 0; + public int DispCropTop { get; set; } = 0; + public int DispCropRight { get; set; } = 0; + public int DispCropBottom { get; set; } = 0; // Sound options - public ESoundOutputMethod SoundOutputMethod = DetectDirectX() ? ESoundOutputMethod.DirectSound : ESoundOutputMethod.OpenAL; - public bool SoundEnabled = true; - public bool SoundEnabledNormal = true; - public bool SoundEnabledRWFF = true; - public bool MuteFrameAdvance = true; - public int SoundVolume = 100; // Range 0-100 - public int SoundVolumeRWFF = 50; // Range 0-100 - public bool SoundThrottle = false; - public string SoundDevice = ""; - public int SoundBufferSizeMs = 100; + public ESoundOutputMethod SoundOutputMethod { get; set; } = DetectDirectX() ? ESoundOutputMethod.DirectSound : ESoundOutputMethod.OpenAL; + public bool SoundEnabled { get; set; } = true; + public bool SoundEnabledNormal { get; set; } = true; + public bool SoundEnabledRWFF { get; set; } = true; + public bool MuteFrameAdvance { get; set; } = true; + public int SoundVolume { get; set; } = 100; // Range 0-100 + public int SoundVolumeRWFF { get; set; } = 50; // Range 0-100 + public bool SoundThrottle { get; set; } + public string SoundDevice { get; set; } = ""; + public int SoundBufferSizeMs { get; set; } = 100; // Lua - public RecentFiles RecentLua = new RecentFiles(8); - public RecentFiles RecentLuaSession = new RecentFiles(8); - public bool DisableLuaScriptsOnLoad = false; - public bool RunLuaDuringTurbo = true; + public RecentFiles RecentLua { get; set; } = new RecentFiles(8); + public RecentFiles RecentLuaSession { get; set; } = new RecentFiles(8); + public bool DisableLuaScriptsOnLoad { get; set; } + public bool RunLuaDuringTurbo { get; set; } = true; // Watch Settings - public RecentFiles RecentWatches = new RecentFiles(8); - public PreviousType RamWatchDefinePrevious = PreviousType.LastFrame; - public bool DisplayRamWatch = false; + public RecentFiles RecentWatches { get; set; } = new RecentFiles(8); + public PreviousType RamWatchDefinePrevious { get; set; } = PreviousType.LastFrame; + public bool DisplayRamWatch { get; set; } // Video dumping settings - public string VideoWriter = ""; - public int JmdCompression = 3; - public int JmdThreads = 3; - public string FFmpegFormat = ""; - public string FFmpegCustomCommand = "-c:a foo -c:v bar -f baz"; - public string AviCodecToken = ""; - public int GifWriterFrameskip = 3; - public int GifWriterDelay = -1; - public bool VideoWriterAudioSync = true; + public string VideoWriter { get; set; } = ""; + public int JmdCompression { get; set; } = 3; + public int JmdThreads { get; set; } = 3; + public string FFmpegFormat { get; set; } = ""; + public string FFmpegCustomCommand { get; set; } = "-c:a foo -c:v bar -f baz"; + public string AviCodecToken { get; set; } = ""; + public int GifWriterFrameskip { get; set; } = 3; + public int GifWriterDelay { get; set; } = -1; + public bool VideoWriterAudioSync { get; set; } = true; // Emulation core settings - public Dictionary CoreSettings = new Dictionary(); - public Dictionary CoreSyncSettings = new Dictionary(); + public Dictionary CoreSettings { get; set; } = new Dictionary(); + public Dictionary CoreSyncSettings { get; set; } = new Dictionary(); - public Dictionary CommonToolSettings = new Dictionary(); - public Dictionary> CustomToolSettings = new Dictionary>(); + public Dictionary CommonToolSettings { get; set; } = new Dictionary(); + public Dictionary> CustomToolSettings { get; set; } = new Dictionary>(); // Cheats - public bool DisableCheatsOnLoad = false; - public bool LoadCheatFileByGame = true; - public bool CheatsAutoSaveOnClose = true; - public RecentFiles RecentCheats = new RecentFiles(8); + public bool DisableCheatsOnLoad { get; set; } + public bool LoadCheatFileByGame { get; set; } = true; + public bool CheatsAutoSaveOnClose { get; set; } = true; + public RecentFiles RecentCheats { get; set; } = new RecentFiles(8); // TAStudio - public TasStateManagerSettings DefaultTasStateManagerSettings = new TasStateManagerSettings(); + public TasStateManagerSettings DefaultTasStateManagerSettings { get; set; } = new TasStateManagerSettings(); // Macro Tool - public RecentFiles RecentMacros = new RecentFiles(8); + public RecentFiles RecentMacros { get; set; } = new RecentFiles(8); // Movie Settings - public RecentFiles RecentMovies = new RecentFiles(8); - public string DefaultAuthor = "default user"; - public bool UseDefaultAuthor = true; - public bool DisplaySubtitles = true; - public bool VBAStyleMovieLoadState = false; - public bool MoviePlaybackPokeMode = false; + public RecentFiles RecentMovies { get; set; } = new RecentFiles(8); + public string DefaultAuthor { get; set; } = "default user"; + public bool UseDefaultAuthor { get; set; } = true; + public bool DisplaySubtitles { get; set; } = true; + public bool VBAStyleMovieLoadState { get; set; } + public bool MoviePlaybackPokeMode { get; set; } // Play Movie Dialog - public bool PlayMovieIncludeSubDir = false; - public bool PlayMovieMatchHash = true; + public bool PlayMovieIncludeSubDir { get; set; } + public bool PlayMovieMatchHash { get; set; } = true; // TI83 - public bool Ti83AutoloadKeyPad = true; + public bool Ti83AutoloadKeyPad { get; set; } = true; - public BindingCollection HotkeyBindings = new BindingCollection(); + public BindingCollection HotkeyBindings { get; set; } = new BindingCollection(); // Analog Hotkey values - public int AnalogLargeChange = 10; - public int AnalogSmallChange = 1; + public int AnalogLargeChange { get; set; } = 10; + public int AnalogSmallChange { get; set; } = 1; // [ControllerType][ButtonName] => Physical Bind - public Dictionary> AllTrollers = new Dictionary>(); - public Dictionary> AllTrollersAutoFire = new Dictionary>(); - public Dictionary> AllTrollersAnalog = new Dictionary>(); + public Dictionary> AllTrollers { get; set; } = new Dictionary>(); + public Dictionary> AllTrollersAutoFire { get; set; } = new Dictionary>(); + public Dictionary> AllTrollersAnalog { get; set; } = new Dictionary>(); // Core Pick // as this setting spans multiple cores and doesn't actually affect the behavior of any core, // it hasn't been absorbed into the new system - public bool GbAsSgb = false; - public bool UseSubNESHawk = false; - public bool NesInQuickNes = true; - public bool SnesInSnes9x = true; - public bool GbaUsemGba = true; - public bool SgbUseBsnes = false; - public bool GbUseGbHawk = false; - public bool CoreForcingViaGameDb = true; - public string LibretroCore; + public bool GbAsSgb { get; set; } + public bool UseSubNESHawk { get; set; } + public bool NesInQuickNes { get; set; } = true; + public bool SnesInSnes9x { get; set; } = true; + public bool GbaUsemGba { get; set; } = true; + public bool SgbUseBsnes { get; set; } + public bool GbUseGbHawk { get; set; } + public bool CoreForcingViaGameDb { get; set; } = true; + public string LibretroCore { get; set; } // ReSharper disable once UnusedMember.Global - public string LastWrittenFrom = VersionInfo.Mainversion; + public string LastWrittenFrom { get; set; } = VersionInfo.Mainversion; // ReSharper disable once UnusedMember.Global - public string LastWrittenFromDetailed = VersionInfo.GetEmuVersion(); + public string LastWrittenFromDetailed { get; set; } = VersionInfo.GetEmuVersion(); } } \ No newline at end of file diff --git a/BizHawk.Client.EmuHawk/config/DisplayConfig.cs b/BizHawk.Client.EmuHawk/config/DisplayConfig.cs index deebc245b4..99e6f0e570 100644 --- a/BizHawk.Client.EmuHawk/config/DisplayConfig.cs +++ b/BizHawk.Client.EmuHawk/config/DisplayConfig.cs @@ -146,18 +146,53 @@ namespace BizHawk.Client.EmuHawk else if (rbUseCustomRatio.Checked) _config.DispManagerAR = EDispManagerAR.CustomRatio; - if (txtCustomARWidth.Text != "") - int.TryParse(txtCustomARWidth.Text, out _config.DispCustomUserARWidth); - else _config.DispCustomUserARWidth = -1; - if (txtCustomARHeight.Text != "") - int.TryParse(txtCustomARHeight.Text, out _config.DispCustomUserARHeight); - else _config.DispCustomUserARHeight = -1; - if (txtCustomARX.Text != "") - float.TryParse(txtCustomARX.Text, out _config.DispCustomUserArx); - else _config.DispCustomUserArx = -1; - if (txtCustomARY.Text != "") - float.TryParse(txtCustomARY.Text, out _config.DispCustomUserAry); - else _config.DispCustomUserAry = -1; + if (string.IsNullOrWhiteSpace(txtCustomARWidth.Text)) + { + if (int.TryParse(txtCustomARWidth.Text, out int dispCustomUserARWidth)) + { + _config.DispCustomUserARWidth = dispCustomUserARWidth; + } + } + else + { + _config.DispCustomUserARWidth = -1; + } + + if (string.IsNullOrWhiteSpace(txtCustomARHeight.Text)) + { + if (int.TryParse(txtCustomARHeight.Text, out int dispCustomUserARHeight)) + { + _config.DispCustomUserARHeight = dispCustomUserARHeight; + } + } + else + { + _config.DispCustomUserARHeight = -1; + } + + if (string.IsNullOrWhiteSpace(txtCustomARX.Text)) + { + if (float.TryParse(txtCustomARX.Text, out float dispCustomUserArx)) + { + _config.DispCustomUserArx = dispCustomUserArx; + } + } + else + { + _config.DispCustomUserArx = -1; + } + + if (string.IsNullOrWhiteSpace(txtCustomARY.Text)) + { + if (float.TryParse(txtCustomARY.Text, out float dispCustomUserAry)) + { + _config.DispCustomUserAry = dispCustomUserAry; + } + } + else + { + _config.DispCustomUserAry = -1; + } var oldDisplayMethod = _config.DispMethod; if(rbOpenGL.Checked) @@ -167,13 +202,30 @@ namespace BizHawk.Client.EmuHawk if(rbD3D9.Checked) _config.DispMethod = EDispMethod.SlimDX9; - int.TryParse(txtCropLeft.Text, out _config.DispCropLeft); - int.TryParse(txtCropTop.Text, out _config.DispCropTop); - int.TryParse(txtCropRight.Text, out _config.DispCropRight); - int.TryParse(txtCropBottom.Text, out _config.DispCropBottom); + if (int.TryParse(txtCropLeft.Text, out int dispCropLeft)) + { + _config.DispCropLeft = dispCropLeft; + } + + if (int.TryParse(txtCropTop.Text, out int dispCropTop)) + { + _config.DispCropTop = dispCropTop; + } + + if (int.TryParse(txtCropRight.Text, out int dispCropRight)) + { + _config.DispCropRight = dispCropRight; + } + + if (int.TryParse(txtCropBottom.Text, out int dispCropBottom)) + { + _config.DispCropBottom = dispCropBottom; + } if (oldDisplayMethod != _config.DispMethod) + { NeedReset = true; + } _config.DispUserFilterPath = _pathSelection; @@ -181,7 +233,7 @@ namespace BizHawk.Client.EmuHawk Close(); } - void RefreshState() + private void RefreshState() { lblUserFilterName.Text = Path.GetFileNameWithoutExtension(_pathSelection); } @@ -208,7 +260,7 @@ namespace BizHawk.Client.EmuHawk return; } - //try compiling it + // try compiling it bool ok = false; string errors = ""; try diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/DefaultGreenzoneSettings.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/DefaultGreenzoneSettings.cs index 513cbc5bcf..49be4de29b 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/DefaultGreenzoneSettings.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/DefaultGreenzoneSettings.cs @@ -13,14 +13,14 @@ namespace BizHawk.Client.EmuHawk { InitializeComponent(); - _settings = new TasStateManagerSettings(Global.Config.DefaultTasProjSettings); + _settings = new TasStateManagerSettings(Global.Config.DefaultTasStateManagerSettings); SettingsPropertyGrid.SelectedObject = _settings; } private void OkBtn_Click(object sender, EventArgs e) { - Global.Config.DefaultTasProjSettings = _settings; + Global.Config.DefaultTasStateManagerSettings = _settings; Close(); }