GB ColorChooserForm - simplify code, remove a GlobalWin usage for free
This commit is contained in:
parent
2c7b2a530c
commit
a87f08379c
|
@ -230,19 +230,14 @@ namespace BizHawk.Client.EmuHawk
|
||||||
RefreshAllBackdrops();
|
RefreshAllBackdrops();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void DoColorChooserFormDialog(IWin32Window parent, Gameboy.GambatteSettings s, bool fromMenu)
|
public static void DoColorChooserFormDialog(IWin32Window parent, Gameboy.GambatteSettings s)
|
||||||
{
|
{
|
||||||
using var dlg = new ColorChooserForm();
|
using var dlg = new ColorChooserForm();
|
||||||
var gb = GlobalWin.Emulator as Gameboy;
|
|
||||||
if (fromMenu)
|
|
||||||
{
|
|
||||||
s = gb.GetSettings();
|
|
||||||
}
|
|
||||||
|
|
||||||
dlg.SetAllColors(s.GBPalette);
|
dlg.SetAllColors(s.GBPalette);
|
||||||
|
|
||||||
var result = dlg.ShowDialog(parent);
|
var result = dlg.ShowDialog(parent);
|
||||||
if (result == DialogResult.OK)
|
if (result.IsOk())
|
||||||
{
|
{
|
||||||
int[] colors = new int[12];
|
int[] colors = new int[12];
|
||||||
for (int i = 0; i < 12; i++)
|
for (int i = 0; i < 12; i++)
|
||||||
|
@ -251,18 +246,9 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
|
|
||||||
s.GBPalette = colors;
|
s.GBPalette = colors;
|
||||||
if (fromMenu)
|
|
||||||
{
|
|
||||||
gb.PutSettings(s);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void DoColorChooserFormDialog(IWin32Window parent, Gameboy.GambatteSettings s)
|
|
||||||
{
|
|
||||||
DoColorChooserFormDialog(parent, s, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void LoadColorFile(string filename, bool alert)
|
private void LoadColorFile(string filename, bool alert)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
Loading…
Reference in New Issue