mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-05-05 21:17:14 -05:00
A little bit cleaner when the logic is separated Keep an abstraction of BoxEdit to cache the current box contents. Already fetched to show sprites; any future fetches (for preview text / hover sprite) can reuse the already fetched pkm data. Should probably rewrite this stuff completely, but effort better spent elsewhere
27 lines
693 B
C#
27 lines
693 B
C#
using System.Drawing;
|
|
using System.Windows.Forms;
|
|
using PKHeX.Core;
|
|
|
|
namespace PKHeX.WinForms.Controls
|
|
{
|
|
public class SlotTrackerImage : SlotTracker<PictureBox>
|
|
{
|
|
public Image InteractionColor { get; private set; }
|
|
public Image OriginalBackground { get; set; }
|
|
public Image CurrentBackground { get; set; }
|
|
|
|
public void Reset()
|
|
{
|
|
Box = Slot = -1;
|
|
OriginalBackground = CurrentBackground = null;
|
|
}
|
|
|
|
public void SetInteraction(int box, int slot, Image img)
|
|
{
|
|
Box = box;
|
|
Slot = slot;
|
|
InteractionColor = img;
|
|
OriginalBackground = img;
|
|
}
|
|
}
|
|
} |