[Course] Add IsPlayableIn(StepsType) and IsRanking() Lua bindings.

This commit is contained in:
AJ Kelly
2011-08-18 23:54:01 -05:00
parent a2cff970f6
commit 38625e55d8
3 changed files with 15 additions and 8 deletions
+1
View File
@@ -12,6 +12,7 @@ StepMania 5.0 Preview 3 | 2011081?
----------
* [RageInput] Added "No input devices were loaded." string to languages. [AJ]
* [RageInputDevice] Added localized names for InputDeviceState. [AJ]
* [Course] Add IsPlayableIn(StepsType) and IsRanking() Lua bindings. [AJ]
2011/08/16
----------
+10 -4
View File
@@ -86,8 +86,6 @@ int CourseEntry::GetNumModChanges() const
}
Course::Course(): m_bIsAutogen(false), m_sPath(""), m_sMainTitle(""),
m_sMainTitleTranslit(""), m_sSubTitle(""), m_sSubTitleTranslit(""),
m_sScripter(""), m_sDescription(""), m_sBannerPath(""), m_sBackgroundPath(""),
@@ -1059,8 +1057,7 @@ public:
LUA_REGISTER_CLASS( CourseEntry )
// Not done with lua yet: still another class.
// Now for the Course bindings:
/** @brief Allow Lua to have access to the Course. */
class LunaCourse: public Luna<Course>
{
@@ -1114,6 +1111,13 @@ public:
static int HasBanner( T* p, lua_State *L ) { lua_pushboolean(L, p->HasBanner() ); return 1; }
static int HasBackground( T* p, lua_State *L ) { lua_pushboolean(L, p->HasBackground() ); return 1; }
DEFINE_METHOD( IsAnEdit, IsAnEdit() )
static int IsPlayableIn( T* p, lua_State *L )
{
StepsType st = Enum::Check<StepsType>(L, 1);
lua_pushboolean(L, p->IsPlayableIn( st ) );
return 1;
}
DEFINE_METHOD( IsRanking, IsRanking() )
LunaCourse()
{
@@ -1142,6 +1146,8 @@ public:
ADD_METHOD( HasBanner );
ADD_METHOD( HasBackground );
ADD_METHOD( IsAnEdit );
ADD_METHOD( IsPlayableIn );
ADD_METHOD( IsRanking );
}
};