diff --git a/Docs/Changelog_sm-ssc.txt b/Docs/Changelog_sm-ssc.txt index 3288d1b998..d1126c8c48 100644 --- a/Docs/Changelog_sm-ssc.txt +++ b/Docs/Changelog_sm-ssc.txt @@ -18,6 +18,7 @@ sm-ssc v1.2.5 | 201104?? * [BeginnerHelper] Various changes: [AJ] * Changed Player_#X/Y metrics to Player#X/Y metrics for consistency. * Converted the background to an AutoActor. +* [BPMDisplay] Added SetFromSong Lua binding. [AJ] 20110423 -------- diff --git a/src/BPMDisplay.cpp b/src/BPMDisplay.cpp index bd26e2c099..5bdcbd66f4 100644 --- a/src/BPMDisplay.cpp +++ b/src/BPMDisplay.cpp @@ -294,11 +294,22 @@ class LunaBPMDisplay: public Luna { public: static int SetFromGameState( T* p, lua_State *L ) { p->SetFromGameState(); return 0; } + static int SetFromSong( T* p, lua_State *L ) + { + if( lua_isnil(L,1) ) { p->NoBPM(); } + else + { + const Song* pSong = Luna::check( L, 1, true ); + p->SetBpmFromSong(pSong); + } + return 0; + } static int GetText( T* p, lua_State *L ) { lua_pushstring( L, p->GetText() ); return 1; } LunaBPMDisplay() { ADD_METHOD( SetFromGameState ); + ADD_METHOD( SetFromSong ); ADD_METHOD( GetText ); } };