diff --git a/PKHeX.Drawing.Misc/Properties/Resources.Designer.cs b/PKHeX.Drawing.Misc/Properties/Resources.Designer.cs index 61a98aefc..388aa685e 100644 --- a/PKHeX.Drawing.Misc/Properties/Resources.Designer.cs +++ b/PKHeX.Drawing.Misc/Properties/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace PKHeX.Drawing.Misc.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "18.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] public class Resources { @@ -4400,6 +4400,16 @@ public class Resources { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap star { + get { + object obj = ResourceManager.GetObject("star", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/PKHeX.Drawing.Misc/Properties/Resources.resx b/PKHeX.Drawing.Misc/Properties/Resources.resx index d522c4a72..c7ac9ceed 100644 --- a/PKHeX.Drawing.Misc/Properties/Resources.resx +++ b/PKHeX.Drawing.Misc/Properties/Resources.resx @@ -1819,4 +1819,7 @@ ..\Resources\img\donut\donut_bitter03.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\img\misc\star.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/PKHeX.Drawing.Misc/Resources/img/misc/star.png b/PKHeX.Drawing.Misc/Resources/img/misc/star.png new file mode 100644 index 000000000..8005d67ce Binary files /dev/null and b/PKHeX.Drawing.Misc/Resources/img/misc/star.png differ diff --git a/PKHeX.Drawing.Misc/Util/DonutSpriteUtil.cs b/PKHeX.Drawing.Misc/Util/DonutSpriteUtil.cs index a1ff7d69c..7fb99105c 100644 --- a/PKHeX.Drawing.Misc/Util/DonutSpriteUtil.cs +++ b/PKHeX.Drawing.Misc/Util/DonutSpriteUtil.cs @@ -18,6 +18,7 @@ public static class DonutSpriteUtil /// The donut to get the sprite for. /// A representing the sprite image. public static Bitmap? Sprite(this Donut9a donut) => GetDonutImage(donut); + public static Bitmap? StarSprite => (Bitmap?)Resources.ResourceManager.GetObject("star"); private static Bitmap? GetDonutImage(Donut9a donut) { diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen9/DonutEditor9a.Designer.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen9/DonutEditor9a.Designer.cs index cffa3eb83..6a3714770 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen9/DonutEditor9a.Designer.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen9/DonutEditor9a.Designer.cs @@ -63,6 +63,11 @@ private void InitializeComponent() CB_Donut = new System.Windows.Forms.ComboBox(); CAL_Date = new System.Windows.Forms.DateTimePicker(); L_Milliseconds = new System.Windows.Forms.Label(); + PB_Star1 = new System.Windows.Forms.PictureBox(); + PB_Star2 = new System.Windows.Forms.PictureBox(); + PB_Star3 = new System.Windows.Forms.PictureBox(); + PB_Star4 = new System.Windows.Forms.PictureBox(); + PB_Star5 = new System.Windows.Forms.PictureBox(); tableLayoutPanel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)PB_Berry0).BeginInit(); ((System.ComponentModel.ISupportInitialize)PB_Berry1).BeginInit(); @@ -79,6 +84,11 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)NUD_Stars).BeginInit(); ((System.ComponentModel.ISupportInitialize)NUD_LevelBoost).BeginInit(); ((System.ComponentModel.ISupportInitialize)NUD_Calories).BeginInit(); + ((System.ComponentModel.ISupportInitialize)PB_Star1).BeginInit(); + ((System.ComponentModel.ISupportInitialize)PB_Star2).BeginInit(); + ((System.ComponentModel.ISupportInitialize)PB_Star3).BeginInit(); + ((System.ComponentModel.ISupportInitialize)PB_Star4).BeginInit(); + ((System.ComponentModel.ISupportInitialize)PB_Star5).BeginInit(); SuspendLayout(); // // tableLayoutPanel1 @@ -451,7 +461,7 @@ private void InitializeComponent() // PB_Donut.Location = new System.Drawing.Point(466, 0); PB_Donut.Name = "PB_Donut"; - PB_Donut.Size = new System.Drawing.Size(80, 80); + PB_Donut.Size = new System.Drawing.Size(72, 72); PB_Donut.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; PB_Donut.TabIndex = 62; PB_Donut.TabStop = false; @@ -686,10 +696,60 @@ private void InitializeComponent() L_Milliseconds.Text = "Milliseconds:"; L_Milliseconds.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // + // PB_Star1 + // + PB_Star1.Location = new System.Drawing.Point(540, 2); + PB_Star1.Name = "PB_Star1"; + PB_Star1.Size = new System.Drawing.Size(20, 20); + PB_Star1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; + PB_Star1.TabIndex = 64; + PB_Star1.TabStop = false; + // + // PB_Star2 + // + PB_Star2.Location = new System.Drawing.Point(560, 2); + PB_Star2.Name = "PB_Star2"; + PB_Star2.Size = new System.Drawing.Size(20, 20); + PB_Star2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; + PB_Star2.TabIndex = 65; + PB_Star2.TabStop = false; + // + // PB_Star3 + // + PB_Star3.Location = new System.Drawing.Point(580, 2); + PB_Star3.Name = "PB_Star3"; + PB_Star3.Size = new System.Drawing.Size(20, 20); + PB_Star3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; + PB_Star3.TabIndex = 66; + PB_Star3.TabStop = false; + // + // PB_Star4 + // + PB_Star4.Location = new System.Drawing.Point(600, 2); + PB_Star4.Name = "PB_Star4"; + PB_Star4.Size = new System.Drawing.Size(20, 20); + PB_Star4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; + PB_Star4.TabIndex = 67; + PB_Star4.TabStop = false; + // + // PB_Star5 + // + PB_Star5.Location = new System.Drawing.Point(620, 2); + PB_Star5.Name = "PB_Star5"; + PB_Star5.Size = new System.Drawing.Size(20, 20); + PB_Star5.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; + PB_Star5.TabIndex = 68; + PB_Star5.TabStop = false; + // // DonutEditor9a // AutoSize = true; AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + Controls.Add(PB_Star5); + Controls.Add(PB_Star4); + Controls.Add(PB_Star3); + Controls.Add(PB_Star2); + Controls.Add(PB_Star1); Controls.Add(PB_Donut); Controls.Add(flowLayoutPanel1); Name = "DonutEditor9a"; @@ -712,6 +772,11 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)NUD_Stars).EndInit(); ((System.ComponentModel.ISupportInitialize)NUD_LevelBoost).EndInit(); ((System.ComponentModel.ISupportInitialize)NUD_Calories).EndInit(); + ((System.ComponentModel.ISupportInitialize)PB_Star1).EndInit(); + ((System.ComponentModel.ISupportInitialize)PB_Star2).EndInit(); + ((System.ComponentModel.ISupportInitialize)PB_Star3).EndInit(); + ((System.ComponentModel.ISupportInitialize)PB_Star4).EndInit(); + ((System.ComponentModel.ISupportInitialize)PB_Star5).EndInit(); ResumeLayout(false); PerformLayout(); } @@ -764,5 +829,10 @@ private void InitializeComponent() private System.Windows.Forms.ComboBox CB_Donut; private System.Windows.Forms.DateTimePicker CAL_Date; private System.Windows.Forms.Label L_Milliseconds; + private System.Windows.Forms.PictureBox PB_Star1; + private System.Windows.Forms.PictureBox PB_Star2; + private System.Windows.Forms.PictureBox PB_Star3; + private System.Windows.Forms.PictureBox PB_Star4; + private System.Windows.Forms.PictureBox PB_Star5; } } diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen9/DonutEditor9a.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen9/DonutEditor9a.cs index 783dcc638..06cb608e1 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen9/DonutEditor9a.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen9/DonutEditor9a.cs @@ -64,6 +64,8 @@ public void InitializeLists(ReadOnlySpan flavors, ReadOnlySpan i CAL_Date.ValueChanged += ChangeDateTime; TB_Milliseconds.TextChanged += OnValueChanged; TB_Milliseconds.TextChanged += ChangeMilliseconds; + NUD_Stars.ValueChanged += OnValueChanged; + NUD_Stars.ValueChanged += NUD_Stars_ValueChanged; } private static void SetDataSource(ComboBox cb, List list) @@ -133,6 +135,8 @@ public void LoadDonut(Donut9a donut) CB_Donut.SelectedValue = (int)donut.Donut; + LoadDonutStarCount(donut.Stars); // acknowledge existing star count + CB_Berry0.SelectedValue = (int)donut.BerryName; CB_Berry1.SelectedValue = (int)donut.Berry1; CB_Berry2.SelectedValue = (int)donut.Berry2; @@ -240,6 +244,14 @@ private static ulong GetDonutFlavorHash(ComboBox cb) return hash; } + private void LoadDonutStarCount(byte count) + { + var star = DonutSpriteUtil.StarSprite; + PictureBox[] starBoxes = [PB_Star1, PB_Star2, PB_Star3, PB_Star4, PB_Star5]; + for (int i = 0; i < starBoxes.Length; i++) + starBoxes[i].Image = i < count ? star : null; + } + private void CB_Donut_SelectedIndexChanged(object? sender, EventArgs e) { _donut.Donut = (ushort)CB_Donut.SelectedIndex; @@ -333,4 +345,6 @@ private void ChangeDateTime(object? sender, EventArgs e) private sealed record ComboText(string Text, string Value); // ReSharper enable NotAccessedPositionalProperty.Local public string GetDonutName() => CB_Donut.Text; + + private void NUD_Stars_ValueChanged(object? sender, EventArgs e) => LoadDonutStarCount((byte)NUD_Stars.Value); }