mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-23 20:43:07 +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
24 lines
No EOL
626 B
C#
24 lines
No EOL
626 B
C#
using System.Windows.Forms;
|
|
using PKHeX.Core;
|
|
using PKHeX.WinForms.Properties;
|
|
|
|
namespace PKHeX.WinForms.Controls
|
|
{
|
|
public class SummaryPreviewer
|
|
{
|
|
private readonly ToolTip ShowSet = new ToolTip { InitialDelay = 200, IsBalloon = false };
|
|
|
|
public void Show(Control pb, PKM pk)
|
|
{
|
|
if (pk.Species == 0)
|
|
{
|
|
Clear();
|
|
return;
|
|
}
|
|
var text = ShowdownSet.GetLocalizedPreviewText(pk, Settings.Default.Language);
|
|
ShowSet.SetToolTip(pb, text);
|
|
}
|
|
|
|
public void Clear() => ShowSet.RemoveAll();
|
|
}
|
|
} |