[ScreenEdit] Added GetEditState Lua binding.
This commit is contained in:
@@ -89,6 +89,7 @@ static const char *EditStateNames[] = {
|
||||
"Playing"
|
||||
};
|
||||
XToString( EditState );
|
||||
LuaXType( EditState );
|
||||
|
||||
#if defined(XBOX)
|
||||
void ScreenEdit::InitEditMappings()
|
||||
@@ -3919,6 +3920,21 @@ void ScreenEdit::DoHelp()
|
||||
EditMiniMenu( &g_EditHelp );
|
||||
}
|
||||
|
||||
// lua start
|
||||
#include "LuaBinding.h"
|
||||
|
||||
class LunaScreenEdit: public Luna<ScreenEdit>
|
||||
{
|
||||
public:
|
||||
DEFINE_METHOD( GetEditState, GetEditState() )
|
||||
LunaScreenEdit()
|
||||
{
|
||||
ADD_METHOD( GetEditState );
|
||||
}
|
||||
};
|
||||
|
||||
LUA_REGISTER_DERIVED_CLASS( ScreenEdit, ScreenWithMenuElements )
|
||||
|
||||
/*
|
||||
* (c) 2001-2004 Chris Danford
|
||||
* All rights reserved.
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "GameInput.h"
|
||||
#include "GameplayAssist.h"
|
||||
#include "AutoKeysounds.h"
|
||||
#include "EnumHelper.h"
|
||||
|
||||
#include <map>
|
||||
|
||||
@@ -33,6 +34,8 @@ enum EditState
|
||||
NUM_EditState,
|
||||
EditState_Invalid
|
||||
};
|
||||
const RString& EditStateToString( EditState es );
|
||||
LuaDeclareType( EditState );
|
||||
|
||||
enum EditButton
|
||||
{
|
||||
@@ -189,6 +192,11 @@ public:
|
||||
void SetDirty( bool bDirty ) { m_bDirty = bDirty; }
|
||||
bool IsDirty() const { return m_bDirty; }
|
||||
|
||||
EditState GetEditState(){ return m_EditState; }
|
||||
|
||||
// Lua
|
||||
virtual void PushSelf( lua_State *L );
|
||||
|
||||
protected:
|
||||
virtual ScreenType GetScreenType() const { return m_EditState==STATE_PLAYING ? gameplay : ScreenWithMenuElements::GetScreenType(); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user