Show encounter's full details on hover (mgdb/encdb)

Won't work neatly for Mystery Gift types since those aren't record types.
This commit is contained in:
Kurt 2021-04-04 12:05:00 -07:00
parent 8c4ca3134a
commit ecf1f361fe

View File

@ -10,7 +10,7 @@ namespace PKHeX.WinForms.Controls
{
public sealed class SummaryPreviewer
{
private readonly ToolTip ShowSet = new() { InitialDelay = 200, IsBalloon = false };
private readonly ToolTip ShowSet = new() { InitialDelay = 200, IsBalloon = false, AutoPopDelay = 32_767 };
public void Show(Control pb, PKM pk)
{
@ -51,6 +51,16 @@ public void Show(Control pb, IEncounterInfo enc)
? $"Level: {enc.LevelMin}"
: $"Level: {enc.LevelMin}-{enc.LevelMax}");
#if DEBUG
// Record types! Can get a nice summary.
// Won't work neatly for Mystery Gift types since those aren't record types.
if (enc is not MysteryGift)
{
var raw = enc.ToString();
lines.AddRange(raw.Split(',', '}', '{'));
}
#endif
var text = string.Join(Environment.NewLine, lines);
ShowSet.SetToolTip(pb, text);
}