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:
+54
-1
@@ -34,12 +34,29 @@ Steps::Steps(): m_StepsType(StepsType_Invalid),
|
|||||||
m_sDescription(""), m_sChartStyle(""),
|
m_sDescription(""), m_sChartStyle(""),
|
||||||
m_Difficulty(Difficulty_Invalid), m_iMeter(0),
|
m_Difficulty(Difficulty_Invalid), m_iMeter(0),
|
||||||
m_bAreCachedRadarValuesJustLoaded(false),
|
m_bAreCachedRadarValuesJustLoaded(false),
|
||||||
m_sCredit("") {}
|
m_sCredit(""), displayBPMType(DISPLAY_BPM_ACTUAL),
|
||||||
|
specifiedBPMMin(0), specifiedBPMMax(0) {}
|
||||||
|
|
||||||
Steps::~Steps()
|
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
|
bool Steps::HasAttacks() const
|
||||||
{
|
{
|
||||||
return !this->m_Attacks.empty();
|
return !this->m_Attacks.empty();
|
||||||
@@ -514,6 +531,38 @@ public:
|
|||||||
return 1;
|
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()
|
LunaSteps()
|
||||||
{
|
{
|
||||||
ADD_METHOD( GetAuthorCredit );
|
ADD_METHOD( GetAuthorCredit );
|
||||||
@@ -534,6 +583,10 @@ public:
|
|||||||
ADD_METHOD( IsAutogen );
|
ADD_METHOD( IsAutogen );
|
||||||
ADD_METHOD( IsAPlayerEdit );
|
ADD_METHOD( IsAPlayerEdit );
|
||||||
ADD_METHOD( UsesSplitTiming );
|
ADD_METHOD( UsesSplitTiming );
|
||||||
|
ADD_METHOD( GetDisplayBpms );
|
||||||
|
ADD_METHOD( IsDisplayBpmSecret );
|
||||||
|
ADD_METHOD( IsDisplayBpmConstant );
|
||||||
|
ADD_METHOD( IsDisplayBpmRandom );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -198,6 +198,8 @@ public:
|
|||||||
return this->specifiedBPMMax;
|
return this->specifiedBPMMax;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GetDisplayBpms( DisplayBpms &addTo) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
inline const Steps *Real() const { return parent ? parent : this; }
|
inline const Steps *Real() const { return parent ? parent : this; }
|
||||||
void DeAutogen( bool bCopyNoteData = true ); /* If this Steps is autogenerated, make it a real Steps. */
|
void DeAutogen( bool bCopyNoteData = true ); /* If this Steps is autogenerated, make it a real Steps. */
|
||||||
|
|||||||
Reference in New Issue
Block a user