[ScreenEdit] Added GetEditState Lua binding.

This commit is contained in:
AJ Kelly
2010-12-26 00:31:46 -06:00
parent 5bfd735aaa
commit 6fc4b62b50
3 changed files with 32 additions and 0 deletions
+8
View File
@@ -13,6 +13,14 @@ _____________________________________________________________________________
sm-ssc v1.2 | 201012xx sm-ssc v1.2 | 201012xx
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
20101226
--------
* [ScreenEdit] Added GetEditState Lua binding. [freem]
20101225
--------
* Fixed Life difficulty scale being 0. [Daisuke Master]
20101223 20101223
-------- --------
* Added Banners for most SortOrders. (Group is excluded (song group banners * Added Banners for most SortOrders. (Group is excluded (song group banners
+16
View File
@@ -89,6 +89,7 @@ static const char *EditStateNames[] = {
"Playing" "Playing"
}; };
XToString( EditState ); XToString( EditState );
LuaXType( EditState );
#if defined(XBOX) #if defined(XBOX)
void ScreenEdit::InitEditMappings() void ScreenEdit::InitEditMappings()
@@ -3919,6 +3920,21 @@ void ScreenEdit::DoHelp()
EditMiniMenu( &g_EditHelp ); 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 * (c) 2001-2004 Chris Danford
* All rights reserved. * All rights reserved.
+8
View File
@@ -18,6 +18,7 @@
#include "GameInput.h" #include "GameInput.h"
#include "GameplayAssist.h" #include "GameplayAssist.h"
#include "AutoKeysounds.h" #include "AutoKeysounds.h"
#include "EnumHelper.h"
#include <map> #include <map>
@@ -33,6 +34,8 @@ enum EditState
NUM_EditState, NUM_EditState,
EditState_Invalid EditState_Invalid
}; };
const RString& EditStateToString( EditState es );
LuaDeclareType( EditState );
enum EditButton enum EditButton
{ {
@@ -189,6 +192,11 @@ public:
void SetDirty( bool bDirty ) { m_bDirty = bDirty; } void SetDirty( bool bDirty ) { m_bDirty = bDirty; }
bool IsDirty() const { return m_bDirty; } bool IsDirty() const { return m_bDirty; }
EditState GetEditState(){ return m_EditState; }
// Lua
virtual void PushSelf( lua_State *L );
protected: protected:
virtual ScreenType GetScreenType() const { return m_EditState==STATE_PLAYING ? gameplay : ScreenWithMenuElements::GetScreenType(); } virtual ScreenType GetScreenType() const { return m_EditState==STATE_PLAYING ? gameplay : ScreenWithMenuElements::GetScreenType(); }