2020-10-05 19:47:53 +00:00
|
|
|
|
2020-10-06 21:49:34 +00:00
|
|
|
//-------------------------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// Caption drawer
|
|
|
|
//
|
|
|
|
//-------------------------------------------------------------------------------------------
|
|
|
|
|
2020-10-06 23:00:43 +00:00
|
|
|
class BloodMenuDelegate : RazeMenuDelegate
|
2020-10-05 19:47:53 +00:00
|
|
|
{
|
|
|
|
override int DrawCaption(String title, Font fnt, int y, bool drawit)
|
|
|
|
{
|
2021-04-28 18:16:13 +00:00
|
|
|
return BloodScreen.DrawCaption(title, y, drawit); // this ignores the passed font intentionally.
|
2020-10-05 19:47:53 +00:00
|
|
|
}
|
2021-12-30 09:30:21 +00:00
|
|
|
|
2020-10-06 22:03:05 +00:00
|
|
|
override bool DrawSelector(ListMenuDescriptor desc)
|
|
|
|
{
|
|
|
|
return true; // do not draw any selector.
|
|
|
|
}
|
2021-12-30 09:30:21 +00:00
|
|
|
|
2020-10-05 19:47:53 +00:00
|
|
|
}
|
2020-10-06 21:49:34 +00:00
|
|
|
|
|
|
|
//-------------------------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// The dripping blood - partially native.
|
|
|
|
//
|
|
|
|
//-------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class ListMenuItemBloodDripDrawer : ListMenuItem
|
|
|
|
{
|
|
|
|
void Init(ListMenuDescriptor desc)
|
|
|
|
{
|
|
|
|
Super.Init(0, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
native override void Draw(bool selected, ListMenuDescriptor desc);
|
2020-10-06 22:50:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
//
|
|
|
|
// text item
|
|
|
|
//
|
|
|
|
//=============================================================================
|
|
|
|
|
|
|
|
class ListMenuItemBloodTextItem : ListMenuItemTextItem
|
|
|
|
{
|
|
|
|
void Init(ListMenuDescriptor desc, String text, String hotkey, Name child, int param = 0)
|
|
|
|
{
|
|
|
|
Super.Init(desc, text, hotkey, child, param);
|
|
|
|
}
|
2021-12-30 09:30:21 +00:00
|
|
|
|
2020-10-06 22:50:26 +00:00
|
|
|
void InitDirect(double x, double y, int height, String hotkey, String text, Font font, int color, int color2, Name child, int param = 0)
|
|
|
|
{
|
|
|
|
Super.InitDirect(x, y, height, hotkey, text, font, color, color2, child, param);
|
|
|
|
}
|
2021-12-30 09:30:21 +00:00
|
|
|
|
2020-10-06 22:50:26 +00:00
|
|
|
override void Draw(bool selected, ListMenuDescriptor desc)
|
|
|
|
{
|
|
|
|
int shade = Selectable()? 32: 48;
|
|
|
|
int pal = 5;
|
2021-05-31 09:51:02 +00:00
|
|
|
let gamefont = Raze.PickBigFont();
|
2020-10-06 22:50:26 +00:00
|
|
|
int xpos = mXpos - gamefont.StringWidth(mText) / 2;
|
2021-05-29 09:47:05 +00:00
|
|
|
int cr = generic_ui? Font.CR_GRAY : Font.CR_NATIVEPAL;
|
2020-10-06 22:50:26 +00:00
|
|
|
int trans = generic_ui? 0 : Translation.MakeID(Translation_Remap, pal);
|
2021-12-30 09:30:21 +00:00
|
|
|
|
2022-10-09 11:56:07 +00:00
|
|
|
if (selected) shade = 32 - ((MSTime() * 120 / 1000) & 63);
|
2020-10-06 22:50:26 +00:00
|
|
|
|
2021-05-29 09:47:05 +00:00
|
|
|
Screen.DrawText(gamefont, Font.CR_UNTRANSLATED, xpos+1, mYpos+1, mText, DTA_Color, 0xff000000, DTA_FullscreenScale, FSMode_Fit320x200);
|
|
|
|
Screen.DrawText(gamefont, Font.CR_NATIVEPAL, xpos, mYpos, mText, DTA_TranslationIndex, trans, DTA_Color, Raze.shadeToLight(shade), DTA_FullscreenScale, FSMode_Fit320x200);
|
2020-10-06 22:50:26 +00:00
|
|
|
}
|
2021-12-30 09:30:21 +00:00
|
|
|
|
2020-10-06 22:50:26 +00:00
|
|
|
}
|
|
|
|
|
2020-10-08 22:50:21 +00:00
|
|
|
|
|
|
|
class ImageScrollerPageQavDrawer : ImageScrollerPage
|
|
|
|
{
|
|
|
|
String qavn;
|
|
|
|
voidptr qav;
|
2021-12-30 09:30:21 +00:00
|
|
|
|
2020-10-08 22:50:21 +00:00
|
|
|
void Init(ImageScrollerDescriptor desc, String qavname)
|
|
|
|
{
|
|
|
|
Super.Init();
|
|
|
|
qavn = qavname;
|
|
|
|
qav = null;
|
|
|
|
}
|
|
|
|
|
|
|
|
override void OnDestroy()
|
|
|
|
{
|
|
|
|
if (qav) DestroyQav(qav);
|
|
|
|
Super.OnDestroy();
|
|
|
|
}
|
|
|
|
|
|
|
|
override void Drawer(bool selected)
|
|
|
|
{
|
|
|
|
if (qav) DrawQav(qav);
|
|
|
|
}
|
|
|
|
|
|
|
|
override void OnStartPage()
|
|
|
|
{
|
|
|
|
qav = LoadQav(qavn);
|
|
|
|
}
|
2021-12-30 09:30:21 +00:00
|
|
|
|
2020-10-08 22:50:21 +00:00
|
|
|
override void OnEndPage()
|
|
|
|
{
|
|
|
|
if (qav) DestroyQav(qav);
|
|
|
|
qav = null;
|
|
|
|
}
|
|
|
|
|
|
|
|
native static voidptr LoadQav(string s);
|
|
|
|
native static void DestroyQav(voidptr s);
|
|
|
|
native static void DrawQav(voidptr s);
|
|
|
|
}
|