private static void DoColorChooserFormDialog(IWin32Window parent, Gameboy.GambatteSettings s, bool fromMenu) { using var dlg = new ColorChooserForm(); var gb = Global.Emulator as Gameboy; if (fromMenu) { s = gb.GetSettings(); } dlg.SetAllColors(s.GBPalette); var result = dlg.ShowDialog(parent); if (result == DialogResult.OK) { int[] colors = new int[12]; for (int i = 0; i < 12; i++) { colors[i] = dlg._colors[i].ToArgb(); } s.GBPalette = colors; if (fromMenu) { gb.PutSettings(s); } } }
static void DoColorChooserFormDialog(IWin32Window parent, Gameboy.GambatteSettings s, bool fromemu) { using (var dlg = new ColorChooserForm()) { if (fromemu) { s = (Gameboy.GambatteSettings)Global.Emulator.GetSettings(); } dlg.SetAllColors(s.GBPalette); var result = dlg.ShowDialog(parent); if (result == DialogResult.OK) { int[] colorints = new int[12]; for (int i = 0; i < 12; i++) { colorints[i] = dlg.colors[i].ToArgb(); } s.GBPalette = colorints; if (fromemu) { Global.Emulator.PutSettings(s); } } } }
private void ButtonPalette_Click(object sender, EventArgs e) { if (ColorGameBoy) { CGBColorChooserForm.DoCGBColorChooserFormDialog(ParentForm, _s); } else { ColorChooserForm.DoColorChooserFormDialog(ParentForm, _s); } }
public static void DoColorChooserFormDialog(IDialogParent parent, Config config, IGameInfo game, Gameboy.GambatteSettings s) { using var dlg = new ColorChooserForm(parent.DialogController, config, game); dlg.SetAllColors(s.GBPalette); var result = parent.ShowDialogAsChild(dlg); if (result.IsOk()) { int[] colors = new int[12]; for (int i = 0; i < 12; i++) { colors[i] = dlg._colors[i].ToArgb(); } s.GBPalette = colors; } }
private void ButtonGbPalette_Click(object sender, EventArgs e) { ColorChooserForm.DoColorChooserFormDialog(DialogParent, _config, _game, _s); }
static void DoColorChooserFormDialog(IWin32Window parent, Gameboy.GambatteSettings s, bool fromemu) { using (var dlg = new ColorChooserForm()) { if (fromemu) s = (Gameboy.GambatteSettings)Global.Emulator.GetSettings(); dlg.SetAllColors(s.GBPalette); var result = dlg.ShowDialog(parent); if (result == DialogResult.OK) { int[] colorints = new int[12]; for (int i = 0; i < 12; i++) colorints[i] = dlg.colors[i].ToArgb(); s.GBPalette = colorints; if (fromemu) Global.Emulator.PutSettings(s); } } }