diff --git a/SwitchGiftDataManager.Core/Classes/BCATManager/BCATManager.cs b/SwitchGiftDataManager.Core/Classes/BCATManager/BCATManager.cs index 7426f3b..31a2da0 100644 --- a/SwitchGiftDataManager.Core/Classes/BCATManager/BCATManager.cs +++ b/SwitchGiftDataManager.Core/Classes/BCATManager/BCATManager.cs @@ -1,5 +1,8 @@ using System.Buffers.Binary; +using System.Diagnostics.Metrics; +using System.Globalization; using System.Reflection.Metadata.Ecma335; +using System.Text; using Enums; namespace SwitchGiftDataManager.Core @@ -274,11 +277,15 @@ namespace SwitchGiftDataManager.Core var type = wc.Type!.ToString()!; var content = type.Equals("Pokemon") ? $"{((PokemonGift)wc.Content!).GetSpeciesName()}" : type; var str = $"{wc.WCID:0000}_{content}"; - System.Text.StringBuilder sb = new(); + var sb = new System.Text.StringBuilder(); foreach (char c in str) if (c != '\\' && c != '/' && c != ':' && c != '*' && c != '?' && c != '"' && c != '<' && c != '>' && c != '|') sb.Append(c); - return sb.ToString().ToLower(); + var _sb = new System.Text.StringBuilder(); + foreach (char c in sb.ToString().Normalize(NormalizationForm.FormD)) + if (CharUnicodeInfo.GetUnicodeCategory(c) != UnicodeCategory.NonSpacingMark) + _sb.Append(c); + return _sb.ToString().ToLower(); } public ReadOnlySpan ForgeMetaInfo(object? data = null) diff --git a/SwitchGiftDataManager.Core/Classes/WCManager/GiftData/OtherGift.cs b/SwitchGiftDataManager.Core/Classes/WCManager/GiftData/OtherGift.cs index 686a2ac..e67e4e7 100644 --- a/SwitchGiftDataManager.Core/Classes/WCManager/GiftData/OtherGift.cs +++ b/SwitchGiftDataManager.Core/Classes/WCManager/GiftData/OtherGift.cs @@ -89,8 +89,12 @@ namespace SwitchGiftDataManager.Core str = Properties.Resources.Items.Split(new String[] { Environment.NewLine }, StringSplitOptions.None)[id]; else if ((GiftType9)type is GiftType9.Clothing) { - var category = (ClothingType8A)id; - var description = ""; //TODO + var category = (ClothingType9)id; + var description = category switch + { + ClothingType9.Bags => Properties.Resources.SCVIClothingBags.Split(new String[] { Environment.NewLine }, StringSplitOptions.None)[opt], + _ => "", + }; if (string.IsNullOrWhiteSpace(description)) description = $"{opt:X4}"; str = $"[{category}] {description}"; diff --git a/SwitchGiftDataManager.Core/Classes/WCManager/WC9.cs b/SwitchGiftDataManager.Core/Classes/WCManager/WC9.cs index 4b75ee5..5fba133 100644 --- a/SwitchGiftDataManager.Core/Classes/WCManager/WC9.cs +++ b/SwitchGiftDataManager.Core/Classes/WCManager/WC9.cs @@ -37,17 +37,20 @@ namespace SwitchGiftDataManager.Core var test = (ShinyType9)Data![ShinyTypeOffset]; var pidtype = (ShinyType9)Data![ShinyTypeOffset] switch { + ShinyType9.ShinyLocked => PIDType.RandomPID, + ShinyType9.ShinyRandom => PIDType.RandomPID, + ShinyType9.ShinyStar => PIDType.FixedPID, + ShinyType9.ShinySquare => PIDType.FixedPID, ShinyType9.Fixed => PIDType.FixedPID, - _ => PIDType.RandomPID, + _ => throw new ArgumentOutOfRangeException(), }; var shinytype = (ShinyType9)Data![ShinyTypeOffset] switch { + ShinyType9.ShinyLocked => ShinyType.ShinyLocked, + ShinyType9.ShinyRandom => ShinyType.ShinyPossible, + ShinyType9.ShinyStar or ShinyType9.ShinySquare => ShinyType.ShinyForced, ShinyType9.Fixed => PokemonGift.IsShiny(pid, tid, sid) ? ShinyType.ShinyForced : PokemonGift.IsTIDAbusePossible(tid, sid, pidtype) ? ShinyType.ShinyTIDAbuse : ShinyType.ShinyLocked, - ShinyType9.ShinyLocked => ShinyType.ShinyLocked, - ShinyType9.Shiny => ShinyType.ShinyForced, - ShinyType9.ShinyRandom => ShinyType.ShinyPossible, - ShinyType9.ShinyHighOdds => ShinyType.ShinyHighOdds, _ => throw new ArgumentOutOfRangeException(), }; diff --git a/SwitchGiftDataManager.Core/Classes/WCManager/Wondercard.cs b/SwitchGiftDataManager.Core/Classes/WCManager/Wondercard.cs index 1262f2e..2470ae6 100644 --- a/SwitchGiftDataManager.Core/Classes/WCManager/Wondercard.cs +++ b/SwitchGiftDataManager.Core/Classes/WCManager/Wondercard.cs @@ -6,7 +6,7 @@ namespace SwitchGiftDataManager.Core internal abstract class Wondercard { public static int GenOffset = 0x0F; - protected const int MaxItemCount = 7; + protected const int MaxItemCount = 6; public Games Game { get; } public ushort WCID { get; protected set; } diff --git a/SwitchGiftDataManager.Core/Enums/Enums.cs b/SwitchGiftDataManager.Core/Enums/Enums.cs index 61f64b0..a833d96 100644 --- a/SwitchGiftDataManager.Core/Enums/Enums.cs +++ b/SwitchGiftDataManager.Core/Enums/Enums.cs @@ -104,11 +104,11 @@ internal enum ShinyType9 : byte { - Fixed = 0, - ShinyLocked = 1, - Shiny = 2, - ShinyRandom = 3, - ShinyHighOdds = 4, + ShinyLocked = 0, + ShinyRandom = 1, + ShinyStar = 2, + ShinySquare = 3, + Fixed = 4, } internal enum ClothingType8: byte @@ -136,4 +136,17 @@ Eyes = 0x08, None = 0xFF, } + + internal enum ClothingType9 : byte + { + Heads = 0x00, + Tops = 0x01, + Bottoms = 0x02, + Outfit = 0x03, + Bags = 0x04, + Shoes = 0x5, + Glasses = 0x06, + Eyes = 0x08, + None = 0xFF, + } } \ No newline at end of file diff --git a/SwitchGiftDataManager.Core/Properties/Resources.Designer.cs b/SwitchGiftDataManager.Core/Properties/Resources.Designer.cs index 3bd3d67..f99dd48 100644 --- a/SwitchGiftDataManager.Core/Properties/Resources.Designer.cs +++ b/SwitchGiftDataManager.Core/Properties/Resources.Designer.cs @@ -218,6 +218,7 @@ namespace SwitchGiftDataManager.Core.Properties { /// /// /// + /// ///Fancy Bottoms (Oshawott) ///Fancy Bottoms (Cyndaquil) ///Fancy Bottoms (Rowlet) @@ -230,7 +231,7 @@ namespace SwitchGiftDataManager.Core.Properties { ///Fancy Bottoms (Mountainscape) ///Fancy Bottoms (Townscape) ///Fancy Bottoms (Spiritomb) - ///Fancy Bottoms (Honchkrow) /// [rest of string was truncated]";. + ///Fancy Bottoms (Honchkrow [rest of string was truncated]";. /// internal static string PLAClothingBottoms { get { @@ -389,8 +390,84 @@ namespace SwitchGiftDataManager.Core.Properties { /// /// /// + /// ///Baneful Fox Mask (White lily) - ///Baneful Fox Mask (Shiny). + ///Baneful Fox Mask (Shiny) + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// /// [rest of string was truncated]";. /// internal static string PLAClothingHeads { get { @@ -480,6 +557,7 @@ namespace SwitchGiftDataManager.Core.Properties { /// /// /// + /// ///Fancy Kimono (Oshawott) ///Fancy Kimono (Cyndaquil) ///Fancy Kimono (Rowlet) @@ -493,7 +571,7 @@ namespace SwitchGiftDataManager.Core.Properties { ///Fancy Kimono (Townscape) ///Fancy Kimono (Spiritomb) ///Fancy Kimono (Honchkrow) - ///Fancy Kimono [rest of string was truncated]";. + ///Fancy Kimo [rest of string was truncated]";. /// internal static string PLAClothingTops { get { @@ -501,6 +579,269 @@ namespace SwitchGiftDataManager.Core.Properties { } } + /// + /// Looks up a localized string similar to None + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// [rest of string was truncated]";. + /// + internal static string SCVIClothingBags { + get { + return ResourceManager.GetString("SCVIClothingBags", resourceCulture); + } + } + /// /// Looks up a localized string similar to None, ///Bulbasaur, diff --git a/SwitchGiftDataManager.Core/Properties/Resources.resx b/SwitchGiftDataManager.Core/Properties/Resources.resx index bbe0564..c6492be 100644 --- a/SwitchGiftDataManager.Core/Properties/Resources.resx +++ b/SwitchGiftDataManager.Core/Properties/Resources.resx @@ -133,6 +133,9 @@ ..\Resources\PLAClothingTops.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 + + ..\Resources\SCVIClothingBags.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 + ..\Resources\Species.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 diff --git a/SwitchGiftDataManager.Core/Resources/SCVIClothingBags.txt b/SwitchGiftDataManager.Core/Resources/SCVIClothingBags.txt new file mode 100644 index 0000000..290560b --- /dev/null +++ b/SwitchGiftDataManager.Core/Resources/SCVIClothingBags.txt @@ -0,0 +1,3076 @@ +None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Floral-print Sports Backpack \ No newline at end of file