reload SSM help text on sort changed

clean up SortOrder names
This commit is contained in:
Chris Danford
2005-04-15 07:18:40 +00:00
parent 38bbd07fe0
commit 228ca9f166
13 changed files with 65 additions and 19 deletions
+26 -4
View File
@@ -103,17 +103,17 @@ static const CString SortOrderNames[NUM_SORT_ORDERS] = {
"Preferred",
"Group",
"Title",
"BPM",
"Bpm",
"Popularity",
"TopGrade",
"TopGrades",
"Artist",
"Genre",
"EasyMeter",
"MediumMeter",
"HardMeter",
"ChallengeMeter",
"Mode",
"Courses",
"ModeMenu",
"AllCourses",
"Nonstop",
"Oni",
"Endless",
@@ -122,6 +122,28 @@ static const CString SortOrderNames[NUM_SORT_ORDERS] = {
XToString( SortOrder, NUM_SORT_ORDERS );
StringToX( SortOrder );
static void LuaSortOrder(lua_State* L)
{
FOREACH_SortOrder( so )
{
CString s = SortOrderToString( so );
// [uppercase] -> _[uppercase]
for( unsigned i=0; i<s.size(); i++ )
{
if( isupper(s[i]) )
{
s.insert( s.begin()+i, '_' );
i++;
}
}
s.MakeUpper();
LUA->SetGlobal( "SORT"+s, so );
}
}
REGISTER_WITH_LUA_FUNCTION( LuaSortOrder );
static const CString TapNoteScoreNames[NUM_TAP_NOTE_SCORES] = {
"None",