Add showdownset preview bubble for slot views

Hold control when you move your mouse to enter the slot's control area
(ie put your mouse on the sprite while holding control); the program
will display a ShowdownSet summary of the contents so you don't have to
load to tabs.

Holding Control is required for now (can always recompile to have it
always on); can be a nuisance for those not wanting to view details
since it overlays a big window (obscuring).

Closes #1925
This commit is contained in:
Kurt 2018-05-05 08:25:36 -07:00
parent 232427d002
commit c8cdff8abc

View file

@ -29,7 +29,7 @@ namespace PKHeX.WinForms.Controls
public readonly List<BoxEditor> Boxes = new List<BoxEditor>();
public readonly List<ISlotViewer<PictureBox>> OtherSlots = new List<ISlotViewer<PictureBox>>();
public event DragEventHandler RequestExternalDragDrop;
private readonly ToolTip ShowSet = new ToolTip();
private readonly ToolTip ShowSet = new ToolTip {InitialDelay = 200, IsBalloon = true};
public SlotChangeManager(SAVEditor se)
{
@ -51,7 +51,17 @@ namespace PKHeX.WinForms.Controls
OriginalBackground = pb.BackgroundImage;
pb.BackgroundImage = CurrentBackground = pb.BackgroundImage == null ? Resources.slotHover : ImageUtil.LayerImage(pb.BackgroundImage, Resources.slotHover, 0, 0, 1);
if (!DragActive)
{
SetCursor(Cursors.Hand, sender);
}
else
{
var view = WinFormsUtil.FindFirstControlOfType<ISlotViewer<PictureBox>>(pb);
var data = view.GetSlotData(pb);
var pk = SAV.GetStoredSlot(data.Offset);
if (pk.Species > 0 && Control.ModifierKeys.HasFlag(Keys.Control))
ShowSet.SetToolTip(pb, pk.ShowdownText);
}
}
public void MouseLeave(object sender, EventArgs e)
{