Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion RaidCrawler.Core/RaidCrawler.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</PackageReference>
<PackageReference Include="FlatSharp.Runtime" Version="7.9.0" />
<PackageReference Include="LibUsbDotNet" Version="2.2.75" />
<PackageReference Include="PKHeX.Core" Version="25.6.9" />
<PackageReference Include="PKHeX.Core" Version="26.7.7" />
<Reference Include="SysBot.Base">
<HintPath>deps\SysBot.Base.dll</HintPath>
</Reference>
Expand Down
4 changes: 2 additions & 2 deletions RaidCrawler.Core/Structures/RaidFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion RaidCrawler.Tests/RaidCrawler.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="8.10.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.6.0" />
<PackageReference Include="PKHeX.Core" Version="25.6.9" />
<PackageReference Include="PKHeX.Core" Version="26.7.7" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand Down
27 changes: 13 additions & 14 deletions RaidCrawler.WinForms/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;

Expand All @@ -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)
Expand Down Expand Up @@ -1333,36 +1333,35 @@ private static string IVsString(ReadOnlySpan<int> 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)
{
int stripeHeight = thick; // from bottom
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)
{
int stripeHeight = thick; // from top
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)
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion RaidCrawler.WinForms/RaidCrawler.WinForms.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="PKHeX.Core" Version="25.6.9" />
<PackageReference Include="PKHeX.Core" Version="26.7.7" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion RaidCrawler.WinForms/SubForms/RewardsView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public RewardsView(IReadOnlyList<string> itemStrings, IReadOnlyList<string> 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();
Expand Down
Binary file modified RaidCrawler.WinForms/deps/PKHeX.Drawing.Misc.dll
Binary file not shown.
Binary file modified RaidCrawler.WinForms/deps/PKHeX.Drawing.PokeSprite.dll
Binary file not shown.
Binary file modified RaidCrawler.WinForms/deps/PKHeX.Drawing.dll
Binary file not shown.
Loading