diff --git a/Docs/Changelog_sm5.txt b/Docs/Changelog_sm5.txt index 3146997e4c..4e4ef035af 100644 --- a/Docs/Changelog_sm5.txt +++ b/Docs/Changelog_sm5.txt @@ -8,6 +8,11 @@ ________________________________________________________________________________ StepMania 5.0 beta 2 | 20130??? -------------------------------------------------------------------------------- +2013/03/24 +---------- +* [MusicWheel] Add the ChangeSort method to the Lua interface to allow the + theme to switch sorting methods. + 2013/02/04 ---------- * [Player] Add a "Column" parameter to the StepMessage to allow the theme or diff --git a/Docs/Luadoc/LuaDocumentation.xml b/Docs/Luadoc/LuaDocumentation.xml index 74cd2bb243..fab6b8e330 100644 --- a/Docs/Luadoc/LuaDocumentation.xml +++ b/Docs/Luadoc/LuaDocumentation.xml @@ -2610,6 +2610,9 @@ save yourself some time, copy this for undocumented things: + + Changes the sort order of the wheel. Returns true if the order was changed. + Returns true if the MusicWheel is currently handling Roulette selection. diff --git a/src/MusicWheel.cpp b/src/MusicWheel.cpp index 64e7650185..7c2999724c 100644 --- a/src/MusicWheel.cpp +++ b/src/MusicWheel.cpp @@ -1626,6 +1626,16 @@ void MusicWheel::FinishChangingSorts() class LunaMusicWheel: public Luna { public: + static int ChangeSort( T* p, lua_State *L ) + { + if( lua_isnil(L,1) ) { lua_pushboolean( L, false ); } + else + { + SortOrder so = Enum::Check(L, 1); + lua_pushboolean( L, p->ChangeSort( so ) ); + } + return 1; + } static int IsRouletting( T* p, lua_State *L ){ lua_pushboolean( L, p->IsRouletting() ); return 1; } static int SelectSong( T* p, lua_State *L ) { @@ -1651,12 +1661,16 @@ public: LunaMusicWheel() { + ADD_METHOD( ChangeSort ); ADD_METHOD( IsRouletting ); ADD_METHOD( SelectSong ); ADD_METHOD( SelectCourse ); } }; +LUA_REGISTER_DERIVED_CLASS( MusicWheel, WheelBase ) +// lua end + /* * (c) 2001-2004 Chris Danford, Chris Gomez, Glenn Maynard * All rights reserved. diff --git a/src/MusicWheel.h b/src/MusicWheel.h index bbe64c2b91..03c1dae0c6 100644 --- a/src/MusicWheel.h +++ b/src/MusicWheel.h @@ -50,6 +50,9 @@ public: RString JumpToPrevGroup(); const MusicWheelItemData *GetCurWheelItemData( int i ) { return (const MusicWheelItemData *) m_CurWheelItemData[i]; } + // Lua + void PushSelf( lua_State *L ); + protected: MusicWheelItem *MakeItem();