From 9ee7d3f5c00ca5227fb66b5537d2bc9456fcbf5e Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Thu, 31 Mar 2005 02:03:49 +0000 Subject: [PATCH] add Lua CourseDifficulties --- stepmania/src/Difficulty.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/stepmania/src/Difficulty.cpp b/stepmania/src/Difficulty.cpp index 7763118c3b..991de43d55 100644 --- a/stepmania/src/Difficulty.cpp +++ b/stepmania/src/Difficulty.cpp @@ -47,7 +47,7 @@ static void LuaDifficulty(lua_State* L) { FOREACH_Difficulty( d ) { - CString s = DifficultyNames[d]; + CString s = DifficultyToString(d); s.MakeUpper(); LUA->SetGlobal( "DIFFICULTY_"+s, d ); } @@ -80,6 +80,18 @@ CourseDifficulty GetNextShownCourseDifficulty( CourseDifficulty cd ) return DIFFICULTY_INVALID; } +static void LuaCourseDifficulty(lua_State* L) +{ + FOREACH_CourseDifficulty( d ) + { + CString s = CourseDifficultyToString(d); + s.MakeUpper(); + LUA->SetGlobal( "COURSE_DIFFICULTY_"+s, d ); + } + LUA->SetGlobal( "NUM_COURSE_DIFFICULTIES", NUM_COURSE_DIFFICULTIES ); +} +REGISTER_WITH_LUA_FUNCTION( LuaCourseDifficulty ); + /* * (c) 2001-2004 Chris Danford * All rights reserved.