diff --git a/Docs/Changelog_sm5.txt b/Docs/Changelog_sm5.txt index 7d8faeddf8..9790afd40d 100644 --- a/Docs/Changelog_sm5.txt +++ b/Docs/Changelog_sm5.txt @@ -8,6 +8,10 @@ ________________________________________________________________________________ StepMania 5.0 $next | 2011???? -------------------------------------------------------------------------------- +2011/09/25 +---------- +* [WheelItemBase] Added GetColor and GetText Lua bindings. [AJ] + 2011/09/24 ---------- * [ScreenEdit] Disable shifting timing changes down one beat if starting on diff --git a/src/WheelItemBase.cpp b/src/WheelItemBase.cpp index 7f4704a2fe..b4381ffcf0 100644 --- a/src/WheelItemBase.cpp +++ b/src/WheelItemBase.cpp @@ -8,6 +8,7 @@ WheelItemBaseData::WheelItemBaseData( WheelItemDataType type, RString sText, Rag m_color = color; } +// begin WheelItemBase WheelItemBase::WheelItemBase( const WheelItemBase &cpy ): ActorFrame( cpy ), m_pData( cpy.m_pData ), @@ -62,7 +63,28 @@ void WheelItemBase::DrawPrimitives() if( m_pGrayBar != NULL ) DrawGrayBar( *m_pGrayBar ); } - + +// lua start +#include "LuaBinding.h" + +/** @brief Allow Lua to have access to the WheelItemBase. */ +class LunaWheelItemBase: public Luna +{ +public: + DEFINE_METHOD( GetColor, GetColor() ) + DEFINE_METHOD( GetText, GetText() ) + //DEFINE_METHOD( GetType, GetType() ) + + LunaWheelItemBase() + { + ADD_METHOD( GetColor ); + ADD_METHOD( GetText ); + //ADD_METHOD( GetType ); + } +}; +LUA_REGISTER_DERIVED_CLASS( WheelItemBase, ActorFrame ) +// lua end + /* * (c) 2001-2004 Chris Danford, Chris Gomez, Glenn Maynard, Josh Allen * All rights reserved. diff --git a/src/WheelItemBase.h b/src/WheelItemBase.h index 8e41633ac4..fa6f68e6d7 100644 --- a/src/WheelItemBase.h +++ b/src/WheelItemBase.h @@ -48,6 +48,13 @@ public: RageColor m_colorLocked; + const RString GetText(){ return m_pData->m_sText; } + const RageColor GetColor(){ return m_pData->m_color; } + WheelItemDataType GetType(){ return m_pData->m_Type; } + + // Lua + void PushSelf( lua_State *L ); + protected: void SetGrayBar( Actor *pBar ) { m_pGrayBar = pBar; }