MultidiskBundler - add a RequiredService of IEmulator and use that property instead of Global.Emulator
This commit is contained in:
parent
5258f9385c
commit
b11a76f739
|
@ -1,7 +1,5 @@
|
||||||
using BizHawk.Client.Common;
|
using System;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
@ -10,8 +8,10 @@ using System.Text;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
using BizHawk.Client.EmuHawk.WinFormExtensions;
|
|
||||||
using BizHawk.Emulation.Common;
|
using BizHawk.Emulation.Common;
|
||||||
|
using BizHawk.Client.Common;
|
||||||
|
using BizHawk.Client.EmuHawk.WinFormExtensions;
|
||||||
|
|
||||||
namespace BizHawk.Client.EmuHawk
|
namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
|
@ -19,6 +19,9 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
private XElement _currentXml = null;
|
private XElement _currentXml = null;
|
||||||
|
|
||||||
|
[RequiredService]
|
||||||
|
public IEmulator Emulator { get; set; }
|
||||||
|
|
||||||
public MultiDiskBundler()
|
public MultiDiskBundler()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
@ -46,9 +49,9 @@ namespace BizHawk.Client.EmuHawk
|
||||||
NameBox.Text = Path.ChangeExtension(GlobalWin.MainForm.CurrentlyOpenRom, ".xml");
|
NameBox.Text = Path.ChangeExtension(GlobalWin.MainForm.CurrentlyOpenRom, ".xml");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SystemDropDown.Items.Contains(Global.Emulator.SystemId))
|
if (SystemDropDown.Items.Contains(Emulator.SystemId))
|
||||||
{
|
{
|
||||||
SystemDropDown.SelectedItem = Global.Emulator.SystemId;
|
SystemDropDown.SelectedItem = Emulator.SystemId;
|
||||||
}
|
}
|
||||||
|
|
||||||
FileSelectors.First().SetName(GlobalWin.MainForm.CurrentlyOpenRom);
|
FileSelectors.First().SetName(GlobalWin.MainForm.CurrentlyOpenRom);
|
||||||
|
|
|
@ -104,8 +104,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
public void UpdateValues()
|
public void UpdateValues()
|
||||||
{
|
{
|
||||||
UseCurrentRomButton.Enabled = Global.Emulator != null // For the designer
|
UseCurrentRomButton.Enabled =
|
||||||
&& !string.IsNullOrEmpty(GlobalWin.MainForm.CurrentlyOpenRom)
|
!string.IsNullOrEmpty(GlobalWin.MainForm.CurrentlyOpenRom)
|
||||||
&& !GlobalWin.MainForm.CurrentlyOpenRom.Contains(".xml"); // Can't already be an xml
|
&& !GlobalWin.MainForm.CurrentlyOpenRom.Contains(".xml"); // Can't already be an xml
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue