More copying from Song to Steps.

This includes the lua, but we're not documenting this yet.

Want to be sure this works without it blowing up.

...I think some work on the editor will be needed here.
This commit is contained in:
Jason Felds
2011-07-07 15:47:29 -04:00
parent 92e6227fc6
commit eaa058c521
2 changed files with 56 additions and 1 deletions
+54 -1
View File
@@ -34,12 +34,29 @@ Steps::Steps(): m_StepsType(StepsType_Invalid),
m_sDescription(""), m_sChartStyle(""),
m_Difficulty(Difficulty_Invalid), m_iMeter(0),
m_bAreCachedRadarValuesJustLoaded(false),
m_sCredit("") {}
m_sCredit(""), displayBPMType(DISPLAY_BPM_ACTUAL),
specifiedBPMMin(0), specifiedBPMMax(0) {}
Steps::~Steps()
{
}
void Steps::GetDisplayBpms( DisplayBpms &AddTo ) const
{
if( this->GetDisplayBPM() == DISPLAY_BPM_SPECIFIED )
{
AddTo.Add( this->GetMinBPM() );
AddTo.Add( this->GetMaxBPM() );
}
else
{
float fMinBPM, fMaxBPM;
this->m_Timing.GetActualBPM( fMinBPM, fMaxBPM );
AddTo.Add( fMinBPM );
AddTo.Add( fMaxBPM );
}
}
bool Steps::HasAttacks() const
{
return !this->m_Attacks.empty();
@@ -513,6 +530,38 @@ public:
lua_pushstring(L, p->GetChartName());
return 1;
}
static int GetDisplayBpms( T* p, lua_State *L )
{
DisplayBpms temp;
p->GetDisplayBpms(temp);
float fMin = temp.GetMin();
float fMax = temp.GetMax();
vector<float> fBPMs;
fBPMs.push_back( fMin );
fBPMs.push_back( fMax );
LuaHelpers::CreateTableFromArray(fBPMs, L);
return 1;
}
static int IsDisplayBpmSecret( T* p, lua_State *L )
{
DisplayBpms temp;
p->GetDisplayBpms(temp);
lua_pushboolean( L, temp.IsSecret() );
return 1;
}
static int IsDisplayBpmConstant( T* p, lua_State *L )
{
DisplayBpms temp;
p->GetDisplayBpms(temp);
lua_pushboolean( L, temp.BpmIsConstant() );
return 1;
}
static int IsDisplayBpmRandom( T* p, lua_State *L )
{
lua_pushboolean( L, p->GetDisplayBPM() == DISPLAY_BPM_RANDOM );
return 1;
}
LunaSteps()
{
@@ -534,6 +583,10 @@ public:
ADD_METHOD( IsAutogen );
ADD_METHOD( IsAPlayerEdit );
ADD_METHOD( UsesSplitTiming );
ADD_METHOD( GetDisplayBpms );
ADD_METHOD( IsDisplayBpmSecret );
ADD_METHOD( IsDisplayBpmConstant );
ADD_METHOD( IsDisplayBpmRandom );
}
};
+2
View File
@@ -197,6 +197,8 @@ public:
{
return this->specifiedBPMMax;
}
void GetDisplayBpms( DisplayBpms &addTo) const;
private:
inline const Steps *Real() const { return parent ? parent : this; }