diff --git a/RaidCrawler.Core/RaidCrawler.Core.csproj b/RaidCrawler.Core/RaidCrawler.Core.csproj index 21ad374..e34896e 100644 --- a/RaidCrawler.Core/RaidCrawler.Core.csproj +++ b/RaidCrawler.Core/RaidCrawler.Core.csproj @@ -13,7 +13,7 @@ - + deps\SysBot.Base.dll diff --git a/RaidCrawler.Core/Structures/RaidFilter.cs b/RaidCrawler.Core/Structures/RaidFilter.cs index 6d5da40..9cd6669 100644 --- a/RaidCrawler.Core/Structures/RaidFilter.cs +++ b/RaidCrawler.Core/Structures/RaidFilter.cs @@ -176,8 +176,8 @@ public bool IsBatchFilterSatisfied(PK9 blank) if (filters.Count == 0) return true; - BatchEditing.ScreenStrings(filters); - return BatchEditing.IsFilterMatch(filters, blank); + EntityBatchEditor.ScreenStrings(filters); + return BatchEditingUtil.IsFilterMatch(filters, blank); } public bool FilterSatisfied( diff --git a/RaidCrawler.Tests/RaidCrawler.Tests.csproj b/RaidCrawler.Tests/RaidCrawler.Tests.csproj index 6b80612..7d9327c 100644 --- a/RaidCrawler.Tests/RaidCrawler.Tests.csproj +++ b/RaidCrawler.Tests/RaidCrawler.Tests.csproj @@ -96,7 +96,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/RaidCrawler.WinForms/MainWindow.cs b/RaidCrawler.WinForms/MainWindow.cs index 4679451..57a712d 100644 --- a/RaidCrawler.WinForms/MainWindow.cs +++ b/RaidCrawler.WinForms/MainWindow.cs @@ -943,7 +943,7 @@ private void DisplayRaid() raid.GenerateDataPK9(blank, param, encounter.Shiny, raid.Seed); var img = blank.Sprite(); - img = (Bitmap)ApplyTeraColor((byte)teraType, img, SpriteBackgroundType.BottomStripe); + ApplyTeraColor((byte)teraType, img, SpriteBackgroundType.BottomStripe); var form = ShowdownParsing.GetStringFromForm( encounter.Form, @@ -997,12 +997,12 @@ private void DisplayRaid() Task.Run(async () => await this.DisplayMessageBox(Webhook, msg, Source.Token).ConfigureAwait(false), Source.Token); } - private static Image? GetDisplayGemImage(int teratype, Raid raid) + private static Bitmap? GetDisplayGemImage(int teratype, Raid raid) { var shouldDisplayBlack = raid.IsBlack || raid.Flags == 3; var baseImg = shouldDisplayBlack - ? (Image?)Properties.Resources.ResourceManager.GetObject($"black_{teratype:D2}") - : (Image?)Properties.Resources.ResourceManager.GetObject($"gem_{teratype:D2}"); + ? (Bitmap?)Properties.Resources.ResourceManager.GetObject($"black_{teratype:D2}") + : (Bitmap?)Properties.Resources.ResourceManager.GetObject($"gem_{teratype:D2}"); if (baseImg is null) return null; @@ -1012,7 +1012,7 @@ private void DisplayRaid() baseImg.PixelFormat ); baseImg = ImageUtil.LayerImage(backlayer, baseImg, 5, 5); - var pixels = ImageUtil.GetPixelData((Bitmap)baseImg); + var pixels = baseImg.GetBitmapData(); for (int i = 0; i < pixels.Length; i += 4) { if (pixels[i + 3] == 0) @@ -1333,16 +1333,16 @@ private static string IVsString(ReadOnlySpan ivs, bool verbose = false) return s; } - private static Image ApplyTeraColor(byte elementalType, Image img, SpriteBackgroundType type) + private static void ApplyTeraColor(byte elementalType, Bitmap img, SpriteBackgroundType type) { var color = TypeColor.GetTypeSpriteColor(elementalType); var thk = SpriteBuilder.ShowTeraThicknessStripe; var op = SpriteBuilder.ShowTeraOpacityStripe; var bg = SpriteBuilder.ShowTeraOpacityBackground; - return ApplyColor(img, type, color, thk, op, bg); + ApplyColor(img, type, color, thk, op, bg); } - private static Image ApplyColor(Image img, SpriteBackgroundType type, Color color, int thick, byte opacStripe, byte opacBack) + private static void ApplyColor(Bitmap img, SpriteBackgroundType type, Color color, int thick, byte opacStripe, byte opacBack) { if (type == SpriteBackgroundType.BottomStripe) { @@ -1350,7 +1350,7 @@ private static Image ApplyColor(Image img, SpriteBackgroundType type, Color colo if ((uint)stripeHeight > img.Height) // clamp negative & too-high values back to height. stripeHeight = img.Height; - return ImageUtil.BlendTransparentTo(img, color, opacStripe, img.Width * 4 * (img.Height - stripeHeight)); + img.BlendTransparentTo(color, opacStripe, img.Width * 4 * (img.Height - stripeHeight)); } if (type == SpriteBackgroundType.TopStripe) { @@ -1358,11 +1358,10 @@ private static Image ApplyColor(Image img, SpriteBackgroundType type, Color colo if ((uint)stripeHeight > img.Height) // clamp negative & too-high values back to height. stripeHeight = img.Height; - return ImageUtil.BlendTransparentTo(img, color, opacStripe, 0, (img.Width * 4 * stripeHeight) - 4); + img.BlendTransparentTo(color, opacStripe, 0, img.Width * 4 * stripeHeight); } if (type == SpriteBackgroundType.FullBackground) // full background - return ImageUtil.BlendTransparentTo(img, color, opacBack); - return img; + img.ChangeTransparentTo(color, opacBack); } private static Bitmap? GenerateMap(Raid raid, int teratype) @@ -1396,7 +1395,7 @@ private static Image ApplyColor(Image img, SpriteBackgroundType type, Color colo try { (double x, double z) = GetCoordinate(raid, locData, gem); - return ImageUtil.LayerImage(map, gem, (int)x, (int)z); + return ImageUtil.LayerImage((Bitmap)map, gem, (int)x, (int)z); } catch { @@ -1786,7 +1785,7 @@ private async Task TestWebhookAsync(CancellationToken token) Form = encounters[i].Form, Gender = encounters[i].Gender, }; - blank.SetSuggestedFormArgument(); + blank.SetSuggestedFormArgument(blank.Species, blank.Form, blank.Context, new LegalityAnalysis(blank).Info.EvoChainsAllGens); var spriteName = GetSpriteNameForUrl(blank, raids[i].CheckIsShiny(encounters[i])); await Webhook.SendNotification(encounters[i], raids[i], filter, time, rewards[i], hexColor, spriteName, token).ConfigureAwait(false); diff --git a/RaidCrawler.WinForms/RaidCrawler.WinForms.csproj b/RaidCrawler.WinForms/RaidCrawler.WinForms.csproj index 131c0ba..45743b7 100644 --- a/RaidCrawler.WinForms/RaidCrawler.WinForms.csproj +++ b/RaidCrawler.WinForms/RaidCrawler.WinForms.csproj @@ -175,7 +175,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/RaidCrawler.WinForms/SubForms/RewardsView.cs b/RaidCrawler.WinForms/SubForms/RewardsView.cs index 97d427c..1fe8e33 100644 --- a/RaidCrawler.WinForms/SubForms/RewardsView.cs +++ b/RaidCrawler.WinForms/SubForms/RewardsView.cs @@ -42,7 +42,7 @@ public RewardsView(IReadOnlyList itemStrings, IReadOnlyList move var img = GetItem(rewards, i); if (img != null && Rewards.RareRewards.Contains(reward.Item1)) - img = ImageUtil.LayerImage(img, rare, 0, 0, 0.7); + img = ImageUtil.LayerImage((Bitmap)img, rare, 0, 0, 0.7); pb.Image = img; label.Text = $"{item} x{reward.Item2} {subject}".TrimEnd(); diff --git a/RaidCrawler.WinForms/deps/PKHeX.Drawing.Misc.dll b/RaidCrawler.WinForms/deps/PKHeX.Drawing.Misc.dll index 1eb2e71..c166bdf 100644 Binary files a/RaidCrawler.WinForms/deps/PKHeX.Drawing.Misc.dll and b/RaidCrawler.WinForms/deps/PKHeX.Drawing.Misc.dll differ diff --git a/RaidCrawler.WinForms/deps/PKHeX.Drawing.PokeSprite.dll b/RaidCrawler.WinForms/deps/PKHeX.Drawing.PokeSprite.dll index fc8517d..41c9c78 100644 Binary files a/RaidCrawler.WinForms/deps/PKHeX.Drawing.PokeSprite.dll and b/RaidCrawler.WinForms/deps/PKHeX.Drawing.PokeSprite.dll differ diff --git a/RaidCrawler.WinForms/deps/PKHeX.Drawing.dll b/RaidCrawler.WinForms/deps/PKHeX.Drawing.dll index 5de1eb2..2cb375f 100644 Binary files a/RaidCrawler.WinForms/deps/PKHeX.Drawing.dll and b/RaidCrawler.WinForms/deps/PKHeX.Drawing.dll differ