Exemplo n.º 1
0
        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);
                }
            }
        }
Exemplo n.º 2
0
        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);
                    }
                }
            }
        }
Exemplo n.º 3
0
 private void ButtonPalette_Click(object sender, EventArgs e)
 {
     if (ColorGameBoy)
     {
         CGBColorChooserForm.DoCGBColorChooserFormDialog(ParentForm, _s);
     }
     else
     {
         ColorChooserForm.DoColorChooserFormDialog(ParentForm, _s);
     }
 }
Exemplo n.º 4
0
        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;
            }
        }
Exemplo n.º 5
0
 private void ButtonGbPalette_Click(object sender, EventArgs e)
 {
     ColorChooserForm.DoColorChooserFormDialog(DialogParent, _config, _game, _s);
 }
Exemplo n.º 6
0
		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);
				}
			}
		}