- scriptified PlayerMenu.Drawer

This commit is contained in:
Christoph Oelckers 2017-02-17 16:53:36 +01:00
parent 74c4748593
commit 416911587e
3 changed files with 28 additions and 36 deletions

View File

@ -65,6 +65,7 @@ class DPlayerMenu : public DListMenu
{
DECLARE_CLASS(DPlayerMenu, DListMenu)
public:
int PlayerClassIndex;
FPlayerClass *PlayerClass;
TArray<int> PlayerColorSets;
@ -91,8 +92,6 @@ public:
bool Responder (event_t *ev);
bool MenuEvent (int mkey, bool fromcontroller);
bool MouseEvent(int type, int x, int y);
void Ticker ();
void Drawer ();
};
IMPLEMENT_CLASS(DPlayerMenu, false, false)
@ -693,38 +692,5 @@ bool DPlayerMenu::MouseEvent(int type, int x, int y)
return res;
}
//=============================================================================
//
//
//
//=============================================================================
void DPlayerMenu::Ticker ()
{
Super::Ticker();
}
//=============================================================================
//
//
//
//=============================================================================
void DPlayerMenu::Drawer ()
{
Super::Drawer();
const char *str = "PRESS " TEXTCOLOR_WHITE "SPACE";
screen->DrawText (SmallFont, CR_GOLD, 320 - 32 - 32 -
SmallFont->StringWidth (str)/2,
50 + 48 + 70, str,
DTA_Clean, true, TAG_DONE);
str = mRotation ? "TO SEE FRONT" : "TO SEE BACK";
screen->DrawText (SmallFont, CR_GOLD, 320 - 32 - 32 -
SmallFont->StringWidth (str)/2,
50 + 48 + 70 + SmallFont->GetHeight (), str,
DTA_Clean, true, TAG_DONE);
}
DEFINE_FIELD(DPlayerMenu, mRotation)

View File

@ -15,6 +15,7 @@
#include "zscript/menu/optionmenuitems.txt"
#include "zscript/menu/colorpickermenu.txt"
#include "zscript/menu/joystickmenu.txt"
#include "zscript/menu/playermenu.txt"
#include "zscript/menu/playerdisplay.txt"
#include "zscript/menu/playercontrols.txt"
#include "zscript/menu/textentermenu.txt"

View File

@ -0,0 +1,25 @@
class PlayerMenu : ListMenu native
{
native int mRotation;
//=============================================================================
//
//
//
//=============================================================================
override void Drawer ()
{
Super.Drawer();
String str = "PRESS " .. TEXTCOLOR_WHITE .. "SPACE";
screen.DrawText (SmallFont, Font.CR_GOLD, 320 - 32 - 32 - SmallFont.StringWidth (str)/2, 50 + 48 + 70, str, DTA_Clean, true);
str = mRotation ? "TO SEE FRONT" : "TO SEE BACK";
screen.DrawText (SmallFont, Font.CR_GOLD, 320 - 32 - 32 - SmallFont.StringWidth (str)/2, 50 + 48 + 70 + SmallFont.GetHeight (), str, DTA_Clean, true);
}
}