From d90c8cfe07460e83f4e0a51532f1dbfc1f1c54ba Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Sat, 11 Jun 2011 15:17:48 -0400 Subject: [PATCH] Add GetPlayerTimingData lua binding...for now. This may be removed if it fails its purpose. --- src/Player.cpp | 8 +++++++- src/Player.h | 10 ++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/Player.cpp b/src/Player.cpp index c853fc86f9..aefe1b12a5 100644 --- a/src/Player.cpp +++ b/src/Player.cpp @@ -3339,11 +3339,17 @@ class LunaPlayer: public Luna public: static int SetActorWithJudgmentPosition( T* p, lua_State *L ) { Actor *pActor = Luna::check(L, 1); p->SetActorWithJudgmentPosition(pActor); return 0; } static int SetActorWithComboPosition( T* p, lua_State *L ) { Actor *pActor = Luna::check(L, 1); p->SetActorWithComboPosition(pActor); return 0; } - + static int GetPlayerTimingData( T* p, lua_State *L ) + { + p->GetPlayerTimingData().PushSelf(L); + return 1; + } + LunaPlayer() { ADD_METHOD( SetActorWithJudgmentPosition ); ADD_METHOD( SetActorWithComboPosition ); + ADD_METHOD( GetPlayerTimingData ); } }; diff --git a/src/Player.h b/src/Player.h index 8d85733858..f2cb2c9b5c 100644 --- a/src/Player.h +++ b/src/Player.h @@ -69,6 +69,16 @@ public: void Load(); void CrossedRows( int iLastRowCrossed, const RageTimer &now ); bool IsOniDead() const; + + /** + * @brief Retrieve the Player's TimingData. + * + * This is primarily for a lua hook. + * @return the TimingData in question. */ + TimingData GetPlayerTimingData() const + { + return *(this->m_Timing); + } // Called when a fret, step, or strum type button changes void Fret( int col, int row, const RageTimer &tm, bool bHeld, bool bRelease );