From 253a24edd60bd34f85f0db9096aec17e2086eb50 Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Mon, 18 Jan 2021 14:49:31 +1000 Subject: [PATCH] Pass tool.Config.PathEntryCollection instead of the whole tool --- .../tools/MultiDiskBundler/MultiDiskBundler.cs | 2 +- .../tools/MultiDiskBundler/MultiDiskFileSelector.cs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskBundler.cs b/src/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskBundler.cs index 7eaa832b06..19251d426a 100644 --- a/src/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskBundler.cs +++ b/src/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskBundler.cs @@ -127,7 +127,7 @@ namespace BizHawk.Client.EmuHawk Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top }; - var mdf = new MultiDiskFileSelector(this, MainForm, () => MainForm.CurrentlyOpenRom) + var mdf = new MultiDiskFileSelector(MainForm, Config.PathEntries, () => MainForm.CurrentlyOpenRom) { Location = UIHelper.Scale(new Point(7, 12)), Width = groupBox.ClientSize.Width - UIHelper.ScaleX(13), diff --git a/src/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskFileSelector.cs b/src/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskFileSelector.cs index bb5030e52f..7438f547cd 100644 --- a/src/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskFileSelector.cs +++ b/src/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskFileSelector.cs @@ -11,7 +11,7 @@ namespace BizHawk.Client.EmuHawk { private readonly Func _getLoadedRomNameCallback; - private readonly ToolFormBase _parent; + private readonly PathEntryCollection _pathEntries; public IDialogController DialogController { get; } @@ -32,11 +32,11 @@ namespace BizHawk.Client.EmuHawk OnNameChanged(EventArgs.Empty); } - public MultiDiskFileSelector(ToolFormBase parent, IDialogController dialogController, Func getLoadedRomNameCallback) + public MultiDiskFileSelector(IDialogController dialogController, PathEntryCollection pathEntries, Func getLoadedRomNameCallback) { DialogController = dialogController; + _pathEntries = pathEntries; _getLoadedRomNameCallback = getLoadedRomNameCallback; - _parent = parent; InitializeComponent(); PathBox.TextChanged += HandleLabelTextChanged; } @@ -75,7 +75,7 @@ namespace BizHawk.Client.EmuHawk { using var ofd = new OpenFileDialog { - InitialDirectory = _parent.Config.PathEntries.RomAbsolutePath(), + InitialDirectory = _pathEntries.RomAbsolutePath(), Filter = RomLoader.RomFilter, RestoreDirectory = true };