From 53c324389d48afd5b5d8d19c058bded4633a3d59 Mon Sep 17 00:00:00 2001 From: Taiizor <41683699+Taiizor@users.noreply.github.com> Date: Sat, 14 Dec 2024 18:59:34 +0300 Subject: [PATCH] Minor Changes --- demo/ReaLTaiizor.UI/ReaLTaiizor.UI/Form22.cs | 8 +- .../ReaLTaiizor.UI/Forms/FormManager.cs | 86 +++++++++++++++++++ .../ReaLTaiizor.UI/Helpers/FormHelper.cs | 7 +- .../Controls/ControlBox/DungeonControlBox.cs | 3 +- .../Controls/ControlBox/NightControlBox.cs | 2 +- .../Controls/ControlBox/ThunderControlBox.cs | 1 - src/ReaLTaiizor/ReaLTaiizor.cs | 2 +- 7 files changed, 100 insertions(+), 9 deletions(-) create mode 100644 demo/ReaLTaiizor.UI/ReaLTaiizor.UI/Forms/FormManager.cs diff --git a/demo/ReaLTaiizor.UI/ReaLTaiizor.UI/Form22.cs b/demo/ReaLTaiizor.UI/ReaLTaiizor.UI/Form22.cs index 7c0c8460..c967cded 100644 --- a/demo/ReaLTaiizor.UI/ReaLTaiizor.UI/Form22.cs +++ b/demo/ReaLTaiizor.UI/ReaLTaiizor.UI/Form22.cs @@ -5,10 +5,14 @@ namespace ReaLTaiizor.UI { public partial class Form22 : Form { - public Form22() + public Form22(bool State = false) { InitializeComponent(); - parrotSplashScreen1.InitializeLoader(this); + + if (!State) + { + parrotSplashScreen1.InitializeLoader(this); + } } private void ParrotColorPicker1_SelectedColorChanged(object sender, EventArgs e) diff --git a/demo/ReaLTaiizor.UI/ReaLTaiizor.UI/Forms/FormManager.cs b/demo/ReaLTaiizor.UI/ReaLTaiizor.UI/Forms/FormManager.cs new file mode 100644 index 00000000..8626f0c5 --- /dev/null +++ b/demo/ReaLTaiizor.UI/ReaLTaiizor.UI/Forms/FormManager.cs @@ -0,0 +1,86 @@ +using ReaLTaiizor.Controls; +using ReaLTaiizor.UI.Helpers; +using System; +using System.Drawing; +using System.Windows.Forms; +using Panel = ReaLTaiizor.Controls.Panel; + +namespace ReaLTaiizor.UI.Forms +{ + public partial class FormManager : Form + { + public FormManager() + { + InitializeComponent(); + + MaximizeBox = false; + Text = "Form Manager"; + Size = new Size(616, 520); + BackColor = Color.FromArgb(42, 42, 42); + FormBorderStyle = FormBorderStyle.FixedSingle; + StartPosition = FormStartPosition.CenterScreen; + + Panel buttonPanel = new() + { + AutoScroll = false, + Dock = DockStyle.Fill, + Padding = new Padding(0) + }; + + FlowLayoutPanel flowLayout = new() + { + AutoScroll = false, + WrapContents = true, + Dock = DockStyle.Fill, + Padding = new Padding(0) + }; + + string[] formNames = { + "Air", "Dungeon", "Dream", "Ribbon", + "Space", "Thunder", "Sky", "Moon", + "Alone", "Fox", "Forever", "Hope", + "Lost", "Royal", "Material", "Night", + "Metro", "Poison", "Crown", "Parrot", + "Cyber", "Form1", "Form2" + }; + + for (int i = 0; i < formNames.Length; i++) + { + ForeverButton btn = new() + { + Tag = formNames[i], + Text = formNames[i], + TextColor = Color.White, + Margin = new Padding(10), + Size = new Size(180, 40), + BaseColor = Color.FromArgb(60, 60, 60) + }; + + btn.Click += Button_Click; + flowLayout.Controls.Add(btn); + } + + buttonPanel.Controls.Add(flowLayout); + Controls.Add(buttonPanel); + } + + private void Button_Click(object sender, EventArgs e) + { + if (sender is ForeverButton btn) + { + Form newForm = FormHelper.Open(new[] { btn.Tag.ToString(), "Manager" }); + newForm.ShowDialog(); + } + } + + private void InitializeComponent() + { + this.SuspendLayout(); + this.Name = "FormManager"; + this.ClientSize = new Size(800, 600); + this.AutoScaleMode = AutoScaleMode.Font; + this.AutoScaleDimensions = new SizeF(7F, 15F); + this.ResumeLayout(false); + } + } +} \ No newline at end of file diff --git a/demo/ReaLTaiizor.UI/ReaLTaiizor.UI/Helpers/FormHelper.cs b/demo/ReaLTaiizor.UI/ReaLTaiizor.UI/Helpers/FormHelper.cs index a75f3569..f728b540 100644 --- a/demo/ReaLTaiizor.UI/ReaLTaiizor.UI/Helpers/FormHelper.cs +++ b/demo/ReaLTaiizor.UI/ReaLTaiizor.UI/Helpers/FormHelper.cs @@ -1,4 +1,5 @@ -using System.Linq; +using ReaLTaiizor.UI.Forms; +using System.Linq; using System.Windows.Forms; namespace ReaLTaiizor.UI.Helpers @@ -30,9 +31,9 @@ public static Form Open(string[] Arg) "19" or "form19" or "metro" => new Form19(), "20" or "form20" or "poison" => new Form20(), "21" or "form21" or "crown" => new Form21(), - "22" or "form22" or "parrot" => new Form22(), + "22" or "form22" or "parrot" => new Form22(Arg.Count() > 1), "23" or "form23" or "cyber" => new Form23(), - _ => new Form17(), + _ => new FormManager(), }; } } diff --git a/src/ReaLTaiizor/Controls/ControlBox/DungeonControlBox.cs b/src/ReaLTaiizor/Controls/ControlBox/DungeonControlBox.cs index 14069910..415a8f4a 100644 --- a/src/ReaLTaiizor/Controls/ControlBox/DungeonControlBox.cs +++ b/src/ReaLTaiizor/Controls/ControlBox/DungeonControlBox.cs @@ -13,7 +13,6 @@ namespace ReaLTaiizor.Controls public class DungeonControlBox : Control { - #region Enums public enum MouseState @@ -24,6 +23,7 @@ public enum MouseState } #endregion + #region MouseStates private MouseState State = MouseState.None; private int X; @@ -103,6 +103,7 @@ protected override void OnMouseMove(MouseEventArgs e) Invalidate(); } #endregion + #region Properties private bool _DefaultLocation = true; diff --git a/src/ReaLTaiizor/Controls/ControlBox/NightControlBox.cs b/src/ReaLTaiizor/Controls/ControlBox/NightControlBox.cs index 0c153fc9..b5e439de 100644 --- a/src/ReaLTaiizor/Controls/ControlBox/NightControlBox.cs +++ b/src/ReaLTaiizor/Controls/ControlBox/NightControlBox.cs @@ -346,7 +346,7 @@ protected override void OnMouseUp(MouseEventArgs e) if (hover_close & e.Button == MouseButtons.Left) { - Application.Exit(); + pf.Close(); } } diff --git a/src/ReaLTaiizor/Controls/ControlBox/ThunderControlBox.cs b/src/ReaLTaiizor/Controls/ControlBox/ThunderControlBox.cs index 8877ac25..5179728e 100644 --- a/src/ReaLTaiizor/Controls/ControlBox/ThunderControlBox.cs +++ b/src/ReaLTaiizor/Controls/ControlBox/ThunderControlBox.cs @@ -14,7 +14,6 @@ namespace ReaLTaiizor.Controls public class ThunderControlBox : Control { - #region Properties private bool _DefaultLocation = true; diff --git a/src/ReaLTaiizor/ReaLTaiizor.cs b/src/ReaLTaiizor/ReaLTaiizor.cs index 68dcd643..ee9d6755 100644 --- a/src/ReaLTaiizor/ReaLTaiizor.cs +++ b/src/ReaLTaiizor/ReaLTaiizor.cs @@ -13,7 +13,7 @@ // Creator: Taiizor // Website: www.vegalya.com // Created: 15.May.2019 -// Changed: 13.Dec.2024 +// Changed: 14.Dec.2024 // Version: 3.8.1.2 // // |---------DO-NOT-REMOVE---------|