[Screen] add GetScreenType() Lua binding.
This commit is contained in:
@@ -14,6 +14,15 @@
|
|||||||
#define PERSIST_SCREENS THEME->GetMetric (m_sName,"PersistScreens")
|
#define PERSIST_SCREENS THEME->GetMetric (m_sName,"PersistScreens")
|
||||||
#define GROUPED_SCREENS THEME->GetMetric (m_sName,"GroupedScreens")
|
#define GROUPED_SCREENS THEME->GetMetric (m_sName,"GroupedScreens")
|
||||||
|
|
||||||
|
static const char *ScreenTypeNames[] = {
|
||||||
|
"Attract",
|
||||||
|
"GameMenu",
|
||||||
|
"Gameplay",
|
||||||
|
"SystemMenu",
|
||||||
|
};
|
||||||
|
XToString( ScreenType );
|
||||||
|
LuaXType( ScreenType );
|
||||||
|
|
||||||
void Screen::InitScreen( Screen *pScreen )
|
void Screen::InitScreen( Screen *pScreen )
|
||||||
{
|
{
|
||||||
pScreen->Init();
|
pScreen->Init();
|
||||||
@@ -272,6 +281,7 @@ public:
|
|||||||
static int GetNextScreenName( T* p, lua_State *L ) { lua_pushstring(L, p->GetNextScreenName() ); return 1; }
|
static int GetNextScreenName( T* p, lua_State *L ) { lua_pushstring(L, p->GetNextScreenName() ); return 1; }
|
||||||
static int GetPrevScreenName( T* p, lua_State *L ) { lua_pushstring(L, p->GetPrevScreen() ); return 1; }
|
static int GetPrevScreenName( T* p, lua_State *L ) { lua_pushstring(L, p->GetPrevScreen() ); return 1; }
|
||||||
static int lockinput( T* p, lua_State *L ) { p->SetLockInputSecs(FArg(1)); return 0; }
|
static int lockinput( T* p, lua_State *L ) { p->SetLockInputSecs(FArg(1)); return 0; }
|
||||||
|
DEFINE_METHOD( GetScreenType, GetScreenType() )
|
||||||
|
|
||||||
static int PostScreenMessage( T* p, lua_State *L )
|
static int PostScreenMessage( T* p, lua_State *L )
|
||||||
{
|
{
|
||||||
@@ -287,6 +297,7 @@ public:
|
|||||||
ADD_METHOD( GetPrevScreenName );
|
ADD_METHOD( GetPrevScreenName );
|
||||||
ADD_METHOD( PostScreenMessage );
|
ADD_METHOD( PostScreenMessage );
|
||||||
ADD_METHOD( lockinput );
|
ADD_METHOD( lockinput );
|
||||||
|
ADD_METHOD( GetScreenType );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+6
-1
@@ -11,6 +11,7 @@
|
|||||||
#include "InputQueue.h"
|
#include "InputQueue.h"
|
||||||
#include "CodeSet.h"
|
#include "CodeSet.h"
|
||||||
#include "LightsManager.h"
|
#include "LightsManager.h"
|
||||||
|
#include "EnumHelper.h"
|
||||||
|
|
||||||
class InputEventPlus;
|
class InputEventPlus;
|
||||||
class Screen;
|
class Screen;
|
||||||
@@ -26,8 +27,12 @@ enum ScreenType
|
|||||||
attract,
|
attract,
|
||||||
game_menu,
|
game_menu,
|
||||||
gameplay,
|
gameplay,
|
||||||
system_menu
|
system_menu,
|
||||||
|
NUM_ScreenType,
|
||||||
|
ScreenType_Invalid
|
||||||
};
|
};
|
||||||
|
const RString& ScreenTypeToString( ScreenType st );
|
||||||
|
LuaDeclareType( ScreenType );
|
||||||
|
|
||||||
class Screen : public ActorFrame
|
class Screen : public ActorFrame
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user