From c8cdff8abce5ad1459ecab2ad0559e2cfec7339b Mon Sep 17 00:00:00 2001 From: Kurt Date: Sat, 5 May 2018 08:25:36 -0700 Subject: [PATCH] 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 --- .../Controls/SAV Editor/SlotChangeManager.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/PKHeX.WinForms/Controls/SAV Editor/SlotChangeManager.cs b/PKHeX.WinForms/Controls/SAV Editor/SlotChangeManager.cs index 69611e8e4..eff5bd30c 100644 --- a/PKHeX.WinForms/Controls/SAV Editor/SlotChangeManager.cs +++ b/PKHeX.WinForms/Controls/SAV Editor/SlotChangeManager.cs @@ -29,7 +29,7 @@ public sealed class SlotChangeManager : IDisposable public readonly List Boxes = new List(); public readonly List> OtherSlots = new List>(); 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 @@ public void MouseEnter(object sender, EventArgs e) 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>(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) {