From ada902140e7fb883f8b63494d28fe2164cde0080 Mon Sep 17 00:00:00 2001 From: sigatrev Date: Tue, 22 Jul 2014 17:39:55 -0500 Subject: [PATCH] add OldStyleStringToDifficulty method because SM recognizes them in .sm files. --- Docs/Luadoc/Lua.xml | 1 + Docs/Luadoc/LuaDocumentation.xml | 3 +++ src/Difficulty.cpp | 2 ++ 3 files changed, 6 insertions(+) diff --git a/Docs/Luadoc/Lua.xml b/Docs/Luadoc/Lua.xml index 12a3bf303b..df5d1ca652 100644 --- a/Docs/Luadoc/Lua.xml +++ b/Docs/Luadoc/Lua.xml @@ -115,6 +115,7 @@ + diff --git a/Docs/Luadoc/LuaDocumentation.xml b/Docs/Luadoc/LuaDocumentation.xml index e43210529f..2b53a7b533 100644 --- a/Docs/Luadoc/LuaDocumentation.xml +++ b/Docs/Luadoc/LuaDocumentation.xml @@ -372,6 +372,9 @@ save yourself some time, copy this for undocumented things: next returns the next index of the table and its associated value." See the Lua manual for more details. + + Converts a string such as 'oni' or 'expert' or 'trick' to the appropriate difficulty. + [03 ThemePrefs.lua] Returns a Lua option row for ProTiming. diff --git a/src/Difficulty.cpp b/src/Difficulty.cpp index 9f18ac5442..1d49ae4615 100644 --- a/src/Difficulty.cpp +++ b/src/Difficulty.cpp @@ -72,6 +72,8 @@ Difficulty OldStyleStringToDifficulty( const RString& sDC ) else return Difficulty_Invalid; } +LuaFunction( OldStyleStringToDifficulty, OldStyleStringToDifficulty(SArg(1)) ); + static ThemeMetric NAMES("CustomDifficulty","Names"); RString GetCustomDifficulty( StepsType st, Difficulty dc, CourseType ct )