diff --git a/PuzzlePlayer/PuzzleForm.cs b/PuzzlePlayer/PuzzleForm.cs index b4e0f2a7cf3e3cb2db3288addf2164d26f1822f0..04842aaedff2b8b9a34a6c34b62f77c2821d1ff9 100644 --- a/PuzzlePlayer/PuzzleForm.cs +++ b/PuzzlePlayer/PuzzleForm.cs @@ -12,6 +12,7 @@ namespace PuzzlePlayer_Namespace { internal class PuzzleForm : Form { + public readonly string puzzleType; private readonly Button solvebutton; private readonly Button hintbutton; private readonly Button generatebutton; @@ -32,15 +33,11 @@ namespace PuzzlePlayer_Namespace } private readonly Button UPDATEBUTTON; - public string puzzleType { get { return "Binary"; } } - //public PuzzleForm(Board b) - //{ - // board = b; - // puzzleType = b.GetType().Name; - //} + public PuzzleForm(Board b, Size s = default) //takes Board and Size parameter and sets up the PuzzleForm window. { + puzzleType = b.GetType().Name; if (s == default) s = new Size(700, 420); this.Size = this.MinimumSize = s; this.WindowState = FormWindowState.Maximized; diff --git a/PuzzlePlayer/PuzzlePlayer.cs b/PuzzlePlayer/PuzzlePlayer.cs index c1261712eb5d524b1ac59f6cabe1e1f7bf23d5e8..b068169ca1fb5d0fcf7dfa5c1ea97dc113829b42 100644 --- a/PuzzlePlayer/PuzzlePlayer.cs +++ b/PuzzlePlayer/PuzzlePlayer.cs @@ -121,6 +121,24 @@ namespace PuzzlePlayer_Namespace button.Image = Image.FromFile(image + ".jpg"); }; + button.MouseClick += (object o, MouseEventArgs e) => + { + this.Hide(); + PuzzleForm puzzleForm = new PuzzleForm(new Binary(6)); + puzzleForm.FormClosed += (object o, FormClosedEventArgs fcea) => + { + this.BackColor = SettingForm.primaryColor; + this.ForeColor = SettingForm.tertiaryColor; + + foreach (Control control in this.Controls) + { + SettingForm.UpdateSettings(control); + } + + this.Show(); + }; + puzzleForm.Show(); + }; buttonsPanel.Controls.Add(button); // -- buttons.Add(button);