diff --git a/Docs/Changelog_sm5.txt b/Docs/Changelog_sm5.txt index 43e296c938..4cfe232d9b 100644 --- a/Docs/Changelog_sm5.txt +++ b/Docs/Changelog_sm5.txt @@ -8,6 +8,11 @@ ________________________________________________________________________________ StepMania 5.0 $next | 20111xxx -------------------------------------------------------------------------------- +2011/12/27 +---------- +* [MusicWheel] Add +* [WheelBase] Add GetNumWheelItems Lua binding. [AJ] + 2011/12/26 ---------- * [ArchHooks_OSX] Worked around a crash when language detection goes wrong. diff --git a/src/MusicWheel.cpp b/src/MusicWheel.cpp index 0b2d499e84..7ced369c24 100644 --- a/src/MusicWheel.cpp +++ b/src/MusicWheel.cpp @@ -1602,6 +1602,20 @@ void MusicWheel::FinishChangingSorts() m_fTimeLeftInState = 0; } +// lua start +#include "LuaBinding.h" + +class LunaMusicWheel: public Luna +{ +public: + static int IsRouletting( T* p, lua_State *L ){ lua_pushboolean( L, p->IsRouletting() ); return 1; } + + LunaMusicWheel() + { + ADD_METHOD( IsRouletting ); + } +}; + /* * (c) 2001-2004 Chris Danford, Chris Gomez, Glenn Maynard * All rights reserved. diff --git a/src/WheelBase.cpp b/src/WheelBase.cpp index 880121dd49..9c3178960c 100644 --- a/src/WheelBase.cpp +++ b/src/WheelBase.cpp @@ -521,6 +521,7 @@ public: return 1; } + static int GetNumWheelItems( T* p, lua_State *L ){ lua_pushnumber( L, p->GetNumItems() ); return 1; } static int IsSettled( T* p, lua_State *L ){ lua_pushboolean( L, p->IsSettled() ); return 1; } static int IsLocked( T* p, lua_State *L ){ lua_pushboolean( L, p->WheelIsLocked() ); return 1; } static int SetOpenSection( T* p, lua_State *L ){ p->SetOpenSection( SArg(1) ); return 0; } @@ -538,6 +539,7 @@ public: LunaWheelBase() { ADD_METHOD( GetWheelItem ); + ADD_METHOD( GetNumWheelItems ); ADD_METHOD( IsSettled ); ADD_METHOD( IsLocked ); ADD_METHOD( SetOpenSection );