From ce392f003cd9bd1b461cb78cff0f6a9d252cd2fb Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Tue, 10 May 2011 09:30:03 -0500 Subject: [PATCH] [BPMDisplay] Added SetFromCourse Lua binding. --- Docs/Changelog_sm5.txt | 3 ++- src/BPMDisplay.cpp | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Docs/Changelog_sm5.txt b/Docs/Changelog_sm5.txt index 2addb23d65..d6320fef24 100644 --- a/Docs/Changelog_sm5.txt +++ b/Docs/Changelog_sm5.txt @@ -10,7 +10,8 @@ StepMania 5.0 $NEXT | 20110xyy 2011/05/10 ---------- -* [Sprite] Added SetSecondsIntoAnimation(float) Lua binding. [AJ] +* [Sprite] Added SetSecondsIntoAnimation Lua binding. [AJ] +* [BPMDisplay] Added SetFromCourse Lua binding. [AJ] 2011/05/03 ---------- diff --git a/src/BPMDisplay.cpp b/src/BPMDisplay.cpp index 4412ee9bcd..981976974f 100644 --- a/src/BPMDisplay.cpp +++ b/src/BPMDisplay.cpp @@ -305,12 +305,23 @@ public: } return 0; } + static int SetFromCourse( T* p, lua_State *L ) + { + if( lua_isnil(L,1) ) { p->NoBPM(); } + else + { + const Course* pCourse = Luna::check( L, 1, true ); + p->SetBpmFromCourse(pCourse); + } + 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( SetFromCourse ); ADD_METHOD( GetText ); } };