From 4c71273af68ebf5bda651973134fe6ceda1bb23b Mon Sep 17 00:00:00 2001 From: Floris <f.k.h.vandezande@students.uu.nl> Date: Mon, 2 Dec 2024 12:52:40 +0100 Subject: [PATCH] fixed couple of merge problems --- PuzzlePlayer/PuzzleForm.cs | 9 +++------ PuzzlePlayer/PuzzlePlayer.cs | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/PuzzlePlayer/PuzzleForm.cs b/PuzzlePlayer/PuzzleForm.cs index b4e0f2a..04842aa 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 c126171..b068169 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); -- GitLab