mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-23 12:33:06 +00:00
bf6c25eca7
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
35 lines
No EOL
1.1 KiB
C#
35 lines
No EOL
1.1 KiB
C#
using System;
|
|
using System.Drawing;
|
|
using System.Windows.Forms;
|
|
using PKHeX.Core;
|
|
using PKHeX.WinForms.Properties;
|
|
|
|
namespace PKHeX.WinForms.Controls
|
|
{
|
|
public static class SlotUtil
|
|
{
|
|
public static Image GetTouchTypeBackground(SlotTouchType t)
|
|
{
|
|
switch (t)
|
|
{
|
|
case SlotTouchType.None: return Resources.slotTrans;
|
|
case SlotTouchType.Get: return Resources.slotView;
|
|
case SlotTouchType.Set: return Resources.slotSet;
|
|
case SlotTouchType.Delete: return Resources.slotDel;
|
|
case SlotTouchType.Swap: return Resources.slotSet;
|
|
default:
|
|
throw new ArgumentOutOfRangeException(nameof(t), t, null);
|
|
}
|
|
}
|
|
|
|
public static DropModifier GetDropModifier()
|
|
{
|
|
switch (Control.ModifierKeys)
|
|
{
|
|
case Keys.Shift: return DropModifier.Clone;
|
|
case Keys.Alt: return DropModifier.Overwrite;
|
|
default: return DropModifier.None;
|
|
}
|
|
}
|
|
}
|
|
} |