From 6fc4b62b50ad841453897984d045fc681a74ee27 Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Sun, 26 Dec 2010 00:31:46 -0600 Subject: [PATCH] [ScreenEdit] Added GetEditState Lua binding. --- Docs/Changelog_sm-ssc.txt | 8 ++++++++ src/ScreenEdit.cpp | 16 ++++++++++++++++ src/ScreenEdit.h | 8 ++++++++ 3 files changed, 32 insertions(+) diff --git a/Docs/Changelog_sm-ssc.txt b/Docs/Changelog_sm-ssc.txt index 8fc0f5ebb9..3e11cb0d8b 100644 --- a/Docs/Changelog_sm-ssc.txt +++ b/Docs/Changelog_sm-ssc.txt @@ -13,6 +13,14 @@ _____________________________________________________________________________ sm-ssc v1.2 | 201012xx -------------------------------------------------------------------------------- +20101226 +-------- +* [ScreenEdit] Added GetEditState Lua binding. [freem] + +20101225 +-------- +* Fixed Life difficulty scale being 0. [Daisuke Master] + 20101223 -------- * Added Banners for most SortOrders. (Group is excluded (song group banners diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index ecede280c6..3c94fa8668 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -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 +{ +public: + DEFINE_METHOD( GetEditState, GetEditState() ) + LunaScreenEdit() + { + ADD_METHOD( GetEditState ); + } +}; + +LUA_REGISTER_DERIVED_CLASS( ScreenEdit, ScreenWithMenuElements ) + /* * (c) 2001-2004 Chris Danford * All rights reserved. diff --git a/src/ScreenEdit.h b/src/ScreenEdit.h index fef5ba076e..5b521e93dd 100644 --- a/src/ScreenEdit.h +++ b/src/ScreenEdit.h @@ -18,6 +18,7 @@ #include "GameInput.h" #include "GameplayAssist.h" #include "AutoKeysounds.h" +#include "EnumHelper.h" #include @@ -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(); }