diff --git a/stepmania/src/DateTime.cpp b/stepmania/src/DateTime.cpp index b88b80aa6f..3f52e90e7b 100644 --- a/stepmania/src/DateTime.cpp +++ b/stepmania/src/DateTime.cpp @@ -196,6 +196,7 @@ static const char *MonthNames[] = }; XToString( Month, NUM_Month ); XToLocalizedString( Month ); +LuaXType( Month ); RString LastWeekToString( int iLastWeekIndex ) { @@ -303,8 +304,8 @@ tm GetDayInYearAndYear( int iDayInYearIndex, int iYear ) return when; } -LuaFunction( MonthToString, MonthToString( (Month)IArg(1) ) ); -LuaFunction( MonthToLocalizedString, MonthToLocalizedString( (Month)IArg(1) ) ); +LuaFunction( MonthToString, MonthToString( Enum::Check(L, 1) ) ); +LuaFunction( MonthToLocalizedString, MonthToLocalizedString( Enum::Check(L, 1) ) ); LuaFunction( MonthOfYear, GetLocalTime().tm_mon ); LuaFunction( DayOfMonth, GetLocalTime().tm_mday ); LuaFunction( Hour, GetLocalTime().tm_hour ); diff --git a/stepmania/src/DateTime.h b/stepmania/src/DateTime.h index 73bbb13532..60bb7c1824 100644 --- a/stepmania/src/DateTime.h +++ b/stepmania/src/DateTime.h @@ -1,6 +1,7 @@ #ifndef DATE_TIME_H #define DATE_TIME_H +#include "EnumHelper.h" #include const int NUM_LAST_DAYS = 7; @@ -21,6 +22,7 @@ const RString &MonthToString( Month month ); const RString &MonthToLocalizedString( Month month ); RString LastWeekToString( int iLastWeekIndex ); RString LastWeekToLocalizedString( int iLastWeekIndex ); +LuaDeclareType( Month ); tm AddDays( tm start, int iDaysToMove ); tm GetYesterday( tm start );