[Trail] Added GetTotalMeter(), GetLengthSeconds(), IsSecret() and ContainsSong(song) Lua bindings.
This commit is contained in:
@@ -13,6 +13,8 @@ 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]
|
||||
* [Trail] Added GetTotalMeter(), GetLengthSeconds(), IsSecret()
|
||||
and ContainsSong(song) Lua bindings. [AJ]
|
||||
|
||||
2011/08/16
|
||||
----------
|
||||
|
||||
+15
-3
@@ -42,7 +42,7 @@ bool TrailEntry::ContainsTransformOrTurn() const
|
||||
return false;
|
||||
}
|
||||
|
||||
// lua start
|
||||
// TrailEntry lua start
|
||||
#include "LuaBinding.h"
|
||||
|
||||
/** @brief Allow Lua to have access to the TrailEntry. */
|
||||
@@ -78,8 +78,7 @@ public:
|
||||
};
|
||||
|
||||
LUA_REGISTER_CLASS( TrailEntry )
|
||||
// lua end
|
||||
|
||||
// TrailEntry lua end
|
||||
|
||||
void Trail::SetRadarValues( const RadarValues &rv )
|
||||
{
|
||||
@@ -233,6 +232,7 @@ class LunaTrail: public Luna<Trail>
|
||||
public:
|
||||
static int GetDifficulty( T* p, lua_State *L ) { LuaHelpers::Push(L, p->m_CourseDifficulty ); return 1; }
|
||||
static int GetMeter( T* p, lua_State *L ) { LuaHelpers::Push(L, p->GetMeter() ); return 1; }
|
||||
static int GetTotalMeter( T* p, lua_State *L ) { LuaHelpers::Push(L, p->GetTotalMeter() ); return 1; }
|
||||
static int GetStepsType( T* p, lua_State *L ) { LuaHelpers::Push(L, p->m_StepsType ); return 1; }
|
||||
static int GetRadarValues( T* p, lua_State *L )
|
||||
{
|
||||
@@ -280,16 +280,28 @@ public:
|
||||
LuaHelpers::CreateTableFromArray<TrailEntry*>( v, L );
|
||||
return 1;
|
||||
}
|
||||
DEFINE_METHOD( GetLengthSeconds, GetLengthSeconds() )
|
||||
DEFINE_METHOD( IsSecret, IsSecret() )
|
||||
static int ContainsSong( T* p, lua_State *L )
|
||||
{
|
||||
const Song *pS = Luna<Song>::check(L,1);
|
||||
lua_pushboolean(L, p->ContainsSong(pS));
|
||||
return 1;
|
||||
}
|
||||
|
||||
LunaTrail()
|
||||
{
|
||||
ADD_METHOD( GetDifficulty );
|
||||
ADD_METHOD( GetMeter );
|
||||
ADD_METHOD( GetTotalMeter );
|
||||
ADD_METHOD( GetStepsType );
|
||||
ADD_METHOD( GetRadarValues );
|
||||
ADD_METHOD( GetArtists );
|
||||
ADD_METHOD( GetTrailEntry );
|
||||
ADD_METHOD( GetTrailEntries );
|
||||
ADD_METHOD( GetLengthSeconds );
|
||||
ADD_METHOD( IsSecret );
|
||||
ADD_METHOD( ContainsSong );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -37,7 +37,6 @@ struct TrailEntry
|
||||
AttackArray Attacks;
|
||||
/**
|
||||
* @brief Is this Song and its Step meant to be a secret?
|
||||
*
|
||||
* If so, it will show text such as "???" to indicate that it's a mystery. */
|
||||
bool bSecret;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user