PKHeX/PKHeX.Drawing.PokeSprite/Builder/SpriteBuilder5668.cs
Kurt 0e097b1fc6 Minor slot hover performance improvements
Skip repaint on cursor moving the hover window
Cache reference to the slot interaction types and "nothing" slot image
Dispose of slot sprites when updating with a new one
If scrolling box/group, auto-update hover with the newly displayed slot's content instead of hiding
2026-03-19 17:25:06 -05:00

41 lines
2.1 KiB
C#

using System.Drawing;
using PKHeX.Core;
using PKHeX.Drawing.PokeSprite.Properties;
namespace PKHeX.Drawing.PokeSprite;
/// <summary>
/// 56 high, 68 wide sprite builder
/// </summary>
public sealed class SpriteBuilder5668s : SpriteBuilder
{
public override int Height => 56;
public override int Width => 68;
protected override int ItemShiftX => 2;
protected override int ItemShiftY => 2;
protected override int ItemMaxSize => 32;
protected override int EggItemShiftX => 18;
protected override int EggItemShiftY => 1;
public override bool HasFallbackMethod => true;
protected override string GetSpriteStringSpeciesOnly(ushort species) => 'b' + $"_{species}";
protected override string GetSpriteAll(ushort species, byte form, byte gender, uint formarg, bool shiny, EntityContext context) => 'b' + SpriteName.GetResourceStringSprite(species, form, gender, formarg, context, shiny);
protected override string GetSpriteAllSecondary(ushort species, byte form, byte gender, uint formarg, bool shiny, EntityContext context) => 'c' + SpriteName.GetResourceStringSprite(species, form, gender, formarg, context, shiny);
protected override string GetItemResourceName(int item) => 'b' + $"item_{item}";
protected override Bitmap Unknown => Resources.b_unknown;
protected override Bitmap GetEggSprite(ushort species) => species == (int)Species.Manaphy ? Resources.b_490_e : Resources.b_egg;
public override Bitmap Hover { get; } = Resources.slotHover68;
public override Bitmap View { get; } = Resources.slotView68;
public override Bitmap Set { get; } = Resources.slotSet68;
public override Bitmap Delete { get; } = Resources.slotDel68;
public override Bitmap Transparent { get; } = Resources.slotTrans68;
public override Bitmap Drag => Resources.slotDrag68;
public override Bitmap UnknownItem => Resources.bitem_unk;
public override Bitmap None { get; } = Resources.b_0;
public override Bitmap ItemTM => Resources.bitem_tm;
public override Bitmap ItemTR => Resources.bitem_tr;
public override Bitmap ShadowLugia => Resources.b_249x;
}