From c2bc9d1ff3a6dea29702f4096062cdffcb2dbaeb Mon Sep 17 00:00:00 2001 From: Flameshadowxeroshin Date: Sun, 22 Jul 2012 12:05:19 -0500 Subject: [PATCH] if you fail to reach the top the more you break the more you drop. try it again. try it again. --- Docs/Luadoc/Lua.xml | 3 ++- Docs/Luadoc/LuaDocumentation.xml | 7 +++++-- src/MusicWheel.cpp | 17 +++++++++++++++-- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/Docs/Luadoc/Lua.xml b/Docs/Luadoc/Lua.xml index 76476fd88b..a8edb5afde 100644 --- a/Docs/Luadoc/Lua.xml +++ b/Docs/Luadoc/Lua.xml @@ -891,7 +891,8 @@ - + + diff --git a/Docs/Luadoc/LuaDocumentation.xml b/Docs/Luadoc/LuaDocumentation.xml index 6bc7b1e69f..1fb73dd675 100644 --- a/Docs/Luadoc/LuaDocumentation.xml +++ b/Docs/Luadoc/LuaDocumentation.xml @@ -2613,8 +2613,11 @@ save yourself some time, copy this for undocumented things: Returns true if the MusicWheel is currently handling Roulette selection. - - Tries to set the MusicWheel's selection based on preferred song, preferred course, and current sort order. Returns false on failure. + + Selects a song. Returns false on failure. + + + Selects a course. Returns false on failure. diff --git a/src/MusicWheel.cpp b/src/MusicWheel.cpp index 964f73ae4c..52c15b4e94 100644 --- a/src/MusicWheel.cpp +++ b/src/MusicWheel.cpp @@ -1619,12 +1619,25 @@ class LunaMusicWheel: public Luna { public: static int IsRouletting( T* p, lua_State *L ){ lua_pushboolean( L, p->IsRouletting() ); return 1; } - static int ResetSelection( T* p, lua_State *L ){ lua_pushboolean( L, p->SelectSongOrCourse() ); return 1; } + static int SelectSong( T* p, lua_State *L ) + { + if( lua_isnil(L,1) ) { lua_pushboolean( L, false ); return 1; } + else { Song *pS = Luna::check( L, 1, true ); lua_pushboolean( L, p->SelectSong( pS ) ); } + return 1; + } + static int SelectCourse( T* p, lua_State *L ) + { + if( lua_isnil(L,1) ) { lua_pushboolean( L, false ); return 1; } + else { Course *pC = Luna::check( L, 1, true ); lua_pushboolean( L, p->SelectSong( pC ) ); } + return 1; + } + LunaMusicWheel() { ADD_METHOD( IsRouletting ); - ADD_METHOD( ResetSelection ); + ADD_METHOD( SelectSong ); + ADD_METHOD( SelectCourse ); } };