diff --git a/PKHeX.Core/Saves/Storage/StorageSlotFlag.cs b/PKHeX.Core/Saves/Storage/StorageSlotFlag.cs index 6a712dfbe..cd67d5913 100644 --- a/PKHeX.Core/Saves/Storage/StorageSlotFlag.cs +++ b/PKHeX.Core/Saves/Storage/StorageSlotFlag.cs @@ -6,18 +6,22 @@ namespace PKHeX.Core public enum StorageSlotFlag { None, - Party1 = 1 << 0, - Party2 = 1 << 1, - Party3 = 1 << 2, - Party4 = 1 << 3, - Party5 = 1 << 4, - Party6 = 1 << 5, - BattleTeam1 = 1 << 6, - BattleTeam2 = 1 << 7, - BattleTeam3 = 1 << 8, - BattleTeam4 = 1 << 9, - BattleTeam5 = 1 << 10, - BattleTeam6 = 1 << 11, + + Party = 1 << 0, + Party1 = Party << 0, + Party2 = Party << 1, + Party3 = Party << 2, + Party4 = Party << 3, + Party5 = Party << 4, + Party6 = Party << 5, + + BattleTeam = 1 << 6, + BattleTeam1 = BattleTeam << 0, + BattleTeam2 = BattleTeam << 1, + BattleTeam3 = BattleTeam << 2, + BattleTeam4 = BattleTeam << 3, + BattleTeam5 = BattleTeam << 4, + BattleTeam6 = BattleTeam << 5, Starter = 1 << 29, Locked = 1 << 30, @@ -35,25 +39,43 @@ public static bool IsOverwriteProtected(this StorageSlotFlag value) if (value.HasFlagFast(StorageSlotFlag.Starter)) return true; - return value.IsBattleTeam(); + return value.IsBattleTeam() >= 0; } - public static bool IsBattleTeam(this StorageSlotFlag value) + public static int IsBattleTeam(this StorageSlotFlag value) { if (value.HasFlagFast(StorageSlotFlag.BattleTeam1)) - return true; + return 0; if (value.HasFlagFast(StorageSlotFlag.BattleTeam2)) - return true; + return 1; if (value.HasFlagFast(StorageSlotFlag.BattleTeam3)) - return true; + return 2; if (value.HasFlagFast(StorageSlotFlag.BattleTeam4)) - return true; + return 3; if (value.HasFlagFast(StorageSlotFlag.BattleTeam5)) - return true; + return 4; if (value.HasFlagFast(StorageSlotFlag.BattleTeam6)) - return true; + return 5; - return false; + return -1; + } + + public static int IsParty(this StorageSlotFlag value) + { + if (value.HasFlagFast(StorageSlotFlag.Party1)) + return 0; + if (value.HasFlagFast(StorageSlotFlag.Party2)) + return 1; + if (value.HasFlagFast(StorageSlotFlag.Party3)) + return 2; + if (value.HasFlagFast(StorageSlotFlag.Party4)) + return 3; + if (value.HasFlagFast(StorageSlotFlag.Party5)) + return 4; + if (value.HasFlagFast(StorageSlotFlag.Party6)) + return 5; + + return -1; } } } diff --git a/PKHeX.WinForms/PKHeX.WinForms.csproj b/PKHeX.WinForms/PKHeX.WinForms.csproj index 374effe5d..2517c1c8c 100644 --- a/PKHeX.WinForms/PKHeX.WinForms.csproj +++ b/PKHeX.WinForms/PKHeX.WinForms.csproj @@ -1972,6 +1972,13 @@ + + + + + + + diff --git a/PKHeX.WinForms/Properties/Resources.Designer.cs b/PKHeX.WinForms/Properties/Resources.Designer.cs index 0ca55e65e..a11a09bac 100644 --- a/PKHeX.WinForms/Properties/Resources.Designer.cs +++ b/PKHeX.WinForms/Properties/Resources.Designer.cs @@ -28218,6 +28218,66 @@ internal class Resources { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap party1 { + get { + object obj = ResourceManager.GetObject("party1", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap party2 { + get { + object obj = ResourceManager.GetObject("party2", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap party3 { + get { + object obj = ResourceManager.GetObject("party3", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap party4 { + get { + object obj = ResourceManager.GetObject("party4", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap party5 { + get { + object obj = ResourceManager.GetObject("party5", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap party6 { + get { + object obj = ResourceManager.GetObject("party6", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Byte[]. /// @@ -29416,6 +29476,16 @@ internal class Resources { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap starter { + get { + object obj = ResourceManager.GetObject("starter", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/PKHeX.WinForms/Properties/Resources.resx b/PKHeX.WinForms/Properties/Resources.resx index 577d921e2..d952acf76 100644 --- a/PKHeX.WinForms/Properties/Resources.resx +++ b/PKHeX.WinForms/Properties/Resources.resx @@ -9235,4 +9235,25 @@ ..\Resources\img\misc\icon_favo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\img\misc\party1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\img\misc\party2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\img\misc\party3.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\img\misc\party4.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\img\misc\party5.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\img\misc\party6.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\img\misc\starter.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.WinForms/Resources/img/misc/party1.png b/PKHeX.WinForms/Resources/img/misc/party1.png new file mode 100644 index 000000000..665eeac27 Binary files /dev/null and b/PKHeX.WinForms/Resources/img/misc/party1.png differ diff --git a/PKHeX.WinForms/Resources/img/misc/party2.png b/PKHeX.WinForms/Resources/img/misc/party2.png new file mode 100644 index 000000000..a1e742c41 Binary files /dev/null and b/PKHeX.WinForms/Resources/img/misc/party2.png differ diff --git a/PKHeX.WinForms/Resources/img/misc/party3.png b/PKHeX.WinForms/Resources/img/misc/party3.png new file mode 100644 index 000000000..d6f1ec484 Binary files /dev/null and b/PKHeX.WinForms/Resources/img/misc/party3.png differ diff --git a/PKHeX.WinForms/Resources/img/misc/party4.png b/PKHeX.WinForms/Resources/img/misc/party4.png new file mode 100644 index 000000000..520641858 Binary files /dev/null and b/PKHeX.WinForms/Resources/img/misc/party4.png differ diff --git a/PKHeX.WinForms/Resources/img/misc/party5.png b/PKHeX.WinForms/Resources/img/misc/party5.png new file mode 100644 index 000000000..d20ed7a29 Binary files /dev/null and b/PKHeX.WinForms/Resources/img/misc/party5.png differ diff --git a/PKHeX.WinForms/Resources/img/misc/party6.png b/PKHeX.WinForms/Resources/img/misc/party6.png new file mode 100644 index 000000000..1119ac730 Binary files /dev/null and b/PKHeX.WinForms/Resources/img/misc/party6.png differ diff --git a/PKHeX.WinForms/Resources/img/misc/starter.png b/PKHeX.WinForms/Resources/img/misc/starter.png new file mode 100644 index 000000000..b2a9df25c Binary files /dev/null and b/PKHeX.WinForms/Resources/img/misc/starter.png differ diff --git a/PKHeX.WinForms/Util/SpriteUtil.cs b/PKHeX.WinForms/Util/SpriteUtil.cs index f7916ea05..83787a248 100644 --- a/PKHeX.WinForms/Util/SpriteUtil.cs +++ b/PKHeX.WinForms/Util/SpriteUtil.cs @@ -130,13 +130,24 @@ private static Image GetSprite(PKM pkm, SaveFile SAV, int box, int slot, bool fl var flags = SAV.GetSlotFlags(box, slot); if (flags.HasFlagFast(StorageSlotFlag.Locked)) sprite = ImageUtil.LayerImage(sprite, Resources.locked, 26, 0); - else if (flags != 0) + int team = flags.IsBattleTeam(); + if (team >= 0) sprite = ImageUtil.LayerImage(sprite, Resources.team, 21, 0); + int party = flags.IsParty(); + if (party >= 0) + sprite = ImageUtil.LayerImage(sprite, PartyMarks[party], 24, 0); + if (flags.HasFlagFast(StorageSlotFlag.Starter)) + sprite = ImageUtil.LayerImage(sprite, Resources.starter, 0, 0); } return sprite; } + private static readonly Image[] PartyMarks = + { + Resources.party1, Resources.party2, Resources.party3, Resources.party4, Resources.party5, Resources.party6, + }; + public static void GetSpriteGlow(PKM pk, byte[] bgr, out byte[] pixels, out Image baseSprite, bool forceHollow = false) { bool egg = pk.IsEgg;