From 08ba7f42517c4593bdecfd4befb0aebc7b681d02 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Wed, 16 Feb 2005 17:35:58 +0000 Subject: [PATCH] expose to Lua --- stepmania/src/StatsManager.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/stepmania/src/StatsManager.cpp b/stepmania/src/StatsManager.cpp index 506479fff7..1d1333c7d0 100644 --- a/stepmania/src/StatsManager.cpp +++ b/stepmania/src/StatsManager.cpp @@ -24,6 +24,16 @@ public: { ADD_METHOD( GetCurStageStats ) Luna::Register( L ); + + // Add global singleton if constructed already. If it's not constructed yet, + // then we'll register it later when we reinit Lua just before + // initializing the display. + if( STATSMAN ) + { + lua_pushstring(L, "STATSMAN"); + STATSMAN->PushSelf( LUA->L ); + lua_settable(L, LUA_GLOBALSINDEX); + } } };