From ee15a15c9e9b0956682b6d6c8e0253003d6dcaaf Mon Sep 17 00:00:00 2001 From: Kurt Date: Tue, 8 Feb 2022 21:46:16 -0800 Subject: [PATCH] Minor tweaks Lower contest stat row Lower IsNoble & IsAlpha Prevent closing Splash Screen when interrupted by plugin dialogs --- .../Controls/PKM Editor/PKMEditor.Designer.cs | 4 ++-- .../PKM Editor/StatEditor.Designer.cs | 6 +++--- PKHeX.WinForms/Misc/SplashScreen.Designer.cs | 1 + PKHeX.WinForms/Misc/SplashScreen.cs | 21 +++++++++++++++---- PKHeX.WinForms/Program.cs | 2 +- 5 files changed, 24 insertions(+), 10 deletions(-) diff --git a/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.Designer.cs b/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.Designer.cs index 5d491ae89..3828e2ef6 100644 --- a/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.Designer.cs +++ b/PKHeX.WinForms/Controls/PKM Editor/PKMEditor.Designer.cs @@ -2771,7 +2771,7 @@ private void InitializeComponent() this.Stats.EVsMaxed = System.Drawing.Color.Honeydew; this.Stats.Location = new System.Drawing.Point(0, 0); this.Stats.Name = "Stats"; - this.Stats.Size = new System.Drawing.Size(270, 264); + this.Stats.Size = new System.Drawing.Size(270, 280); this.Stats.StatDecreased = System.Drawing.Color.Blue; this.Stats.StatHyperTrained = System.Drawing.Color.LightGreen; this.Stats.StatIncreased = System.Drawing.Color.Red; @@ -2785,7 +2785,7 @@ private void InitializeComponent() this.Contest.CNT_Sheen = ((byte)(0)); this.Contest.CNT_Smart = ((byte)(0)); this.Contest.CNT_Tough = ((byte)(0)); - this.Contest.Location = new System.Drawing.Point(21, 265); + this.Contest.Location = new System.Drawing.Point(32, 290); this.Contest.Margin = new System.Windows.Forms.Padding(0); this.Contest.Name = "Contest"; this.Contest.Size = new System.Drawing.Size(230, 50); diff --git a/PKHeX.WinForms/Controls/PKM Editor/StatEditor.Designer.cs b/PKHeX.WinForms/Controls/PKM Editor/StatEditor.Designer.cs index 4a6f118d7..82aee49d8 100644 --- a/PKHeX.WinForms/Controls/PKM Editor/StatEditor.Designer.cs +++ b/PKHeX.WinForms/Controls/PKM Editor/StatEditor.Designer.cs @@ -1315,14 +1315,14 @@ private void InitializeComponent() this.FLP_AlphaNoble.Location = new System.Drawing.Point(0, 285); this.FLP_AlphaNoble.Margin = new System.Windows.Forms.Padding(0); this.FLP_AlphaNoble.Name = "FLP_AlphaNoble"; - this.FLP_AlphaNoble.Size = new System.Drawing.Size(270, 21); + this.FLP_AlphaNoble.Size = new System.Drawing.Size(270, 31); this.FLP_AlphaNoble.TabIndex = 134; // // CHK_IsAlpha // this.CHK_IsAlpha.AutoSize = true; this.CHK_IsAlpha.Location = new System.Drawing.Point(55, 3); - this.CHK_IsAlpha.Margin = new System.Windows.Forms.Padding(95, 2, 3, 3); + this.CHK_IsAlpha.Margin = new System.Windows.Forms.Padding(95, 8, 3, 3); this.CHK_IsAlpha.Name = "CHK_IsAlpha"; this.CHK_IsAlpha.Size = new System.Drawing.Size(64, 17); this.CHK_IsAlpha.TabIndex = 44; @@ -1334,7 +1334,7 @@ private void InitializeComponent() // this.CHK_IsNoble.AutoSize = true; this.CHK_IsNoble.Location = new System.Drawing.Point(55, 3); - this.CHK_IsNoble.Margin = new System.Windows.Forms.Padding(3, 2, 3, 3); + this.CHK_IsNoble.Margin = new System.Windows.Forms.Padding(3, 8, 3, 3); this.CHK_IsNoble.Name = "CHK_IsNoble"; this.CHK_IsNoble.Size = new System.Drawing.Size(64, 17); this.CHK_IsNoble.TabIndex = 44; diff --git a/PKHeX.WinForms/Misc/SplashScreen.Designer.cs b/PKHeX.WinForms/Misc/SplashScreen.Designer.cs index 38abb197d..16f0f107c 100644 --- a/PKHeX.WinForms/Misc/SplashScreen.Designer.cs +++ b/PKHeX.WinForms/Misc/SplashScreen.Designer.cs @@ -75,6 +75,7 @@ private void InitializeComponent() this.Name = "SplashScreen"; this.Opacity = 0.5D; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.SplashScreen_FormClosing); ((System.ComponentModel.ISupportInitialize)(this.PB_Icon)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); diff --git a/PKHeX.WinForms/Misc/SplashScreen.cs b/PKHeX.WinForms/Misc/SplashScreen.cs index 877829c50..1f290aa33 100644 --- a/PKHeX.WinForms/Misc/SplashScreen.cs +++ b/PKHeX.WinForms/Misc/SplashScreen.cs @@ -1,9 +1,22 @@ using System.Windows.Forms; -namespace PKHeX.WinForms +namespace PKHeX.WinForms; + +public partial class SplashScreen : Form { - public partial class SplashScreen : Form + public SplashScreen() => InitializeComponent(); + + private bool CanClose; + + private void SplashScreen_FormClosing(object sender, FormClosingEventArgs e) { - public SplashScreen() => InitializeComponent(); + if (!CanClose) + e.Cancel = true; } -} \ No newline at end of file + + public void ForceClose() + { + CanClose = true; + Close(); + } +} diff --git a/PKHeX.WinForms/Program.cs b/PKHeX.WinForms/Program.cs index 34114423b..86777bcd9 100644 --- a/PKHeX.WinForms/Program.cs +++ b/PKHeX.WinForms/Program.cs @@ -36,7 +36,7 @@ private static void Main() new Task(() => splash.ShowDialog()).Start(); new Task(() => EncounterEvent.RefreshMGDB(WinForms.Main.MGDatabasePath)).Start(); var main = new Main(); - splash.Invoke(() => splash.Close()); + splash.Invoke(() => splash.ForceClose()); Application.Run(main); }