using PKHeX.Core;
using System.Windows.Forms;
namespace PKHeX.WinForms.Controls;
public class RenderedString : TextBox
{
public bool DisableInGameFont
{
get;
set
{
if (value == field)
return;
field = value;
if (value)
ResetFont();
else
ChangeContext(DisplayContext);
}
}
///
/// Context the string is rendered in.
///
public EntityContext DisplayContext
{
get;
set
{
if (value == field)
return;
field = value;
if (!DisableInGameFont)
ChangeContext(value);
}
}
///
/// Fetches the necessary font.
///
private void ChangeContext(EntityContext context)
{
if (DesignMode)
return;
Font = FontUtil.GetFont(context);
}
}