convert Config.cs from fields to properties

This commit is contained in:
adelikat 2020-01-25 12:35:33 -06:00
parent 90e1a89516
commit 45e0abe39d
3 changed files with 250 additions and 196 deletions

View File

@ -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<string, string> PreferredPlatformsForExtensions = new Dictionary<string, string>
public Dictionary<string, string> PreferredPlatformsForExtensions { get; set; } = new Dictionary<string, string>
{
[".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<string, string> FirmwareUserSpecifications = new Dictionary<string, string>(); // key: sysid+firmwareId; value: absolute path
// key: sysId+firmwareId; value: absolute path
public Dictionary<string, string> FirmwareUserSpecifications { get; set; } = new Dictionary<string, string>();
// 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; }
/// <summary>
/// Makes a .bak file before any saveram-writing operation (could be extended to make timestamped backups)
/// </summary>
public bool BackupSaveram = true;
public bool BackupSaveram { get; set; } = true;
/// <summary>
/// Whether to make AutoSave files at periodic intervals
/// </summary>
public bool AutosaveSaveRAM;
public bool AutosaveSaveRAM { get; set; }
/// <summary>
/// Intervals at which to make AutoSave files
/// </summary>
public int FlushSaveRamFrames;
public int FlushSaveRamFrames { get; set; }
/// <remarks>Don't rename this without changing <c>BizHawk.Client.EmuHawk.Program.CurrentDomain_AssemblyResolve</c></remarks>
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;
/// <summary>
/// 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
/// </summary>
public bool VSync = false;
public bool VSync { get; set; }
/// <summary>
/// Tries to use an alternate vsync mechanism, for video cards that just can't do it right
/// </summary>
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
}
/// <remarks>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.</remarks>
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<string, object> CoreSettings = new Dictionary<string, object>();
public Dictionary<string, object> CoreSyncSettings = new Dictionary<string, object>();
public Dictionary<string, object> CoreSettings { get; set; } = new Dictionary<string, object>();
public Dictionary<string, object> CoreSyncSettings { get; set; } = new Dictionary<string, object>();
public Dictionary<string, ToolDialogSettings> CommonToolSettings = new Dictionary<string, ToolDialogSettings>();
public Dictionary<string, Dictionary<string, object>> CustomToolSettings = new Dictionary<string, Dictionary<string, object>>();
public Dictionary<string, ToolDialogSettings> CommonToolSettings { get; set; } = new Dictionary<string, ToolDialogSettings>();
public Dictionary<string, Dictionary<string, object>> CustomToolSettings { get; set; } = new Dictionary<string, Dictionary<string, object>>();
// 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<string, Dictionary<string, string>> AllTrollers = new Dictionary<string, Dictionary<string, string>>();
public Dictionary<string, Dictionary<string, string>> AllTrollersAutoFire = new Dictionary<string, Dictionary<string, string>>();
public Dictionary<string, Dictionary<string, AnalogBind>> AllTrollersAnalog = new Dictionary<string, Dictionary<string, AnalogBind>>();
public Dictionary<string, Dictionary<string, string>> AllTrollers { get; set; } = new Dictionary<string, Dictionary<string, string>>();
public Dictionary<string, Dictionary<string, string>> AllTrollersAutoFire { get; set; } = new Dictionary<string, Dictionary<string, string>>();
public Dictionary<string, Dictionary<string, AnalogBind>> AllTrollersAnalog { get; set; } = new Dictionary<string, Dictionary<string, AnalogBind>>();
// 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();
}
}

View File

@ -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

View File

@ -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();
}