diff --git a/Docs/Changelog_sm5.txt b/Docs/Changelog_sm5.txt index 1b2891ef7e..4aad8a4238 100644 --- a/Docs/Changelog_sm5.txt +++ b/Docs/Changelog_sm5.txt @@ -8,6 +8,11 @@ ________________________________________________________________________________ StepMania 5.0 alpha 1a | 201202?? -------------------------------------------------------------------------------- +2012/02/10 +---------- +* [WheelBase, WheelItemBase] Turned WheelItemDataType into a Lua type, + made WheelBase:GetSelectedType() return the enum instead of a number. [AJ] + 2012/02/08 ---------- * [ScreenOptionsMaster] Added StepsRowLayoutType metric. diff --git a/src/WheelBase.cpp b/src/WheelBase.cpp index 880121dd49..797f422153 100644 --- a/src/WheelBase.cpp +++ b/src/WheelBase.cpp @@ -530,10 +530,7 @@ public: //static int Move( T* p, lua_State *L ){ p->Move( IArg(1) ); return 0; } //static int ChangeMusic( T* p, lua_State *L ){ p->ChangeMusicUnlessLocked( IArg(1) ); return 0; } - static int GetSelectedType( T* p, lua_State *L ) { - lua_pushnumber( L, p->GetSelectedType() ); - return 1; - } + DEFINE_METHOD( GetSelectedType, GetSelectedType() ) LunaWheelBase() { diff --git a/src/WheelItemBase.cpp b/src/WheelItemBase.cpp index bdd0439c89..af80aac741 100644 --- a/src/WheelItemBase.cpp +++ b/src/WheelItemBase.cpp @@ -1,5 +1,21 @@ #include "global.h" #include "WheelItemBase.h" +#include "LuaManager.h" + +static const char *WheelItemDataTypeNames[] = { + "Generic", + "Section", + "Song", + "Roulette", + "Random", + "Portal", + "Course", + "Sort", + "Custom", +}; +XToString( WheelItemDataType ); +StringToX( WheelItemDataType ); +LuaXType( WheelItemDataType ); WheelItemBaseData::WheelItemBaseData( WheelItemDataType type, RString sText, RageColor color ) { diff --git a/src/WheelItemBase.h b/src/WheelItemBase.h index 920db9fb0a..0dc1146636 100644 --- a/src/WheelItemBase.h +++ b/src/WheelItemBase.h @@ -19,7 +19,9 @@ enum WheelItemDataType WheelItemDataType_Portal, /**< The portal section on the Wheel. */ WheelItemDataType_Course, /**< A Course on the Wheel. */ WheelItemDataType_Sort, /**< A generic sorting item on the Wheel. */ - WheelItemDataType_Custom /**< A custom item on the Wheel. */ + WheelItemDataType_Custom, /**< A custom item on the Wheel. */ + NUM_WheelItemDataType, + WheelItemDataType_Invalid }; LuaDeclareType( WheelItemDataType );