[WheelBase, WheelItemBase] Turned WheelItemDataType into a Lua type, made WheelBase:GetSelectedType() return the enum instead of a number.

This commit is contained in:
AJ Kelly
2012-02-10 13:57:24 -06:00
parent cb38919b8c
commit dc3300ae90
4 changed files with 25 additions and 5 deletions
+5
View File
@@ -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.
+1 -4
View File
@@ -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()
{
+16
View File
@@ -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 )
{
+3 -1
View File
@@ -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 );