2020-10-04 22:14:55 +00:00
|
|
|
// This class allows global customization of certain menu aspects, e.g. replacing the menu caption.
|
|
|
|
|
2020-10-08 15:44:23 +00:00
|
|
|
class MenuDelegateBase ui
|
2020-10-04 22:14:55 +00:00
|
|
|
{
|
|
|
|
virtual int DrawCaption(String title, Font fnt, int y, bool drawit)
|
|
|
|
{
|
2020-10-17 06:48:24 +00:00
|
|
|
if (drawit) screen.DrawText(fnt, OptionMenuSettings.mTitleColor, (screen.GetWidth() - fnt.StringWidth(title) * CleanXfac_1) / 2, 10 * CleanYfac_1, title, DTA_CleanNoMove_1, true);
|
2020-10-07 16:29:34 +00:00
|
|
|
return (y + fnt.GetHeight()) * CleanYfac_1; // return is spacing in screen pixels.
|
2020-10-04 22:14:55 +00:00
|
|
|
}
|
2022-06-06 10:09:29 +00:00
|
|
|
|
2020-10-07 16:29:34 +00:00
|
|
|
virtual void PlaySound(Name sound)
|
|
|
|
{
|
|
|
|
}
|
2022-06-06 10:09:29 +00:00
|
|
|
|
2020-10-07 16:29:34 +00:00
|
|
|
virtual bool DrawSelector(ListMenuDescriptor desc)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void MenuDismissed()
|
|
|
|
{
|
|
|
|
// overriding this allows to execute special actions when the menu closes
|
|
|
|
}
|
2022-06-06 10:09:29 +00:00
|
|
|
|
2020-10-17 12:00:29 +00:00
|
|
|
virtual Font PickFont(Font fnt)
|
|
|
|
{
|
|
|
|
if (generic_ui || !fnt) return NewSmallFont;
|
|
|
|
if (fnt == SmallFont) return AlternativeSmallFont;
|
|
|
|
if (fnt == BigFont) return AlternativeBigFont;
|
|
|
|
return fnt;
|
|
|
|
}
|
2020-10-04 22:14:55 +00:00
|
|
|
}
|