2019-08-21 02:50:28 +00:00
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
using PKHeX.Core;
|
|
|
|
|
using PKHeX.WinForms.Properties;
|
|
|
|
|
|
|
|
|
|
namespace PKHeX.WinForms.Controls
|
|
|
|
|
{
|
2019-10-04 02:09:02 +00:00
|
|
|
|
public sealed class SummaryPreviewer
|
2019-08-21 02:50:28 +00:00
|
|
|
|
{
|
2020-12-22 07:37:07 +00:00
|
|
|
|
private readonly ToolTip ShowSet = new() { InitialDelay = 200, IsBalloon = false };
|
2019-08-21 02:50:28 +00:00
|
|
|
|
|
|
|
|
|
public void Show(Control pb, PKM pk)
|
|
|
|
|
{
|
|
|
|
|
if (pk.Species == 0)
|
|
|
|
|
{
|
|
|
|
|
Clear();
|
|
|
|
|
return;
|
|
|
|
|
}
|
2020-12-29 05:42:54 +00:00
|
|
|
|
var text = ShowdownParsing.GetLocalizedPreviewText(pk, Settings.Default.Language);
|
2019-08-21 02:50:28 +00:00
|
|
|
|
ShowSet.SetToolTip(pb, text);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Clear() => ShowSet.RemoveAll();
|
|
|
|
|
}
|
|
|
|
|
}
|