MainForm - setter for Config property

This commit is contained in:
adelikat 2019-12-20 10:08:20 -06:00
parent 8f6f8f72cb
commit bfb39e79d0
2 changed files with 8 additions and 3 deletions

View File

@ -1335,7 +1335,7 @@ namespace BizHawk.Client.EmuHawk
private void LoadConfigMenuItem_Click(object sender, EventArgs e)
{
Global.Config = ConfigService.Load<Config>(PathManager.DefaultIniPath);
Config = ConfigService.Load<Config>(PathManager.DefaultIniPath);
Config.ResolveDefaults();
InitControls(); // rebind hotkeys
AddOnScreenMessage($"Config file loaded: {PathManager.DefaultIniPath}");
@ -1353,7 +1353,7 @@ namespace BizHawk.Client.EmuHawk
if (ofd.ShowHawkDialog().IsOk())
{
Global.Config = ConfigService.Load<Config>(ofd.FileName);
Config = ConfigService.Load<Config>(ofd.FileName);
Config.ResolveDefaults();
InitControls(); // rebind hotkeys
AddOnScreenMessage($"Config file loaded: {ofd.FileName}");

View File

@ -800,7 +800,12 @@ namespace BizHawk.Client.EmuHawk
private ISoundProvider _currentSoundProvider = new NullSound(44100 / 60); // Reasonable default until we have a core instance
private Config Config => Global.Config;
private Config Config
{
get => Global.Config;
set => Global.Config = value;
}
private ToolManager Tools => GlobalWin.Tools;
private DisplayManager DisplayManager => GlobalWin.DisplayManager;
private IMovieSession MovieSession => Global.MovieSession;