[splittiming] PlayerOptions -> HasTimingChanges.
Steps gained most of the functionality and lua doc. Leaving song version in: may still have a use thanks to #DISPLAYBPM.
This commit is contained in:
@@ -1349,6 +1349,7 @@
|
||||
<Function name='GetMeter'/>
|
||||
<Function name='GetRadarValues'/>
|
||||
<Function name='GetStepsType'/>
|
||||
<Function name='HasSignificantTimingChanges'/>
|
||||
<Function name='IsAPlayerEdit'/>
|
||||
<Function name='IsAnEdit'/>
|
||||
<Function name='IsAutogen'/>
|
||||
|
||||
@@ -3368,6 +3368,9 @@
|
||||
<Function name='GetMeter' return='int' arguments=''>
|
||||
Returns the numerical difficulty of the Steps.
|
||||
</Function>
|
||||
<Function name='HasSignificantTimingChanges' sm-ssc='true' return='bool' arguments=''>
|
||||
Returns <code>true</code> if the song has significant timing changes.
|
||||
</Function>
|
||||
<Function name='GetRadarValues' return='RadarValues' arguments='PlayerNumber pn'>
|
||||
Returns the complete list of RadarValues for player <code>pn</code>. Use <Link class='RadarValues' function='GetValue' /> to grab a specific value.
|
||||
</Function>
|
||||
|
||||
@@ -680,7 +680,7 @@ bool PlayerOptions::operator==( const PlayerOptions &other ) const
|
||||
|
||||
bool PlayerOptions::IsEasierForSongAndSteps( Song* pSong, Steps* pSteps, PlayerNumber pn ) const
|
||||
{
|
||||
if( m_fTimeSpacing && pSong->HasSignificantBpmChangesOrStops() )
|
||||
if( m_fTimeSpacing && pSteps->HasSignificantTimingChanges() )
|
||||
return true;
|
||||
const RadarValues &rv = pSteps->GetRadarValues( pn );
|
||||
if( m_bTransforms[TRANSFORM_NOHOLDS] && rv[RadarCategory_Holds]>0 )
|
||||
|
||||
@@ -402,6 +402,21 @@ void Steps::SetMeter( int meter )
|
||||
m_iMeter = meter;
|
||||
}
|
||||
|
||||
bool Steps::HasSignificantTimingChanges() const
|
||||
{
|
||||
if( m_Timing.HasStops() )
|
||||
return true;
|
||||
|
||||
/* TODO: Deal with DisplayBPM here...if possible?
|
||||
* Song's version may still be useful. */
|
||||
|
||||
else if( m_Timing.HasBpmChanges() || m_Timing.HasWarps() || m_Timing.HasSpeedChanges() )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Steps::SetCachedRadarValues( const RadarValues v[NUM_PLAYERS] )
|
||||
{
|
||||
DeAutogen();
|
||||
@@ -426,6 +441,8 @@ public:
|
||||
DEFINE_METHOD( IsAnEdit, IsAnEdit() )
|
||||
DEFINE_METHOD( IsAPlayerEdit, IsAPlayerEdit() )
|
||||
|
||||
static int HasSignificantTimingChanges( T* p, lua_State *L ) { lua_pushboolean(L, p->HasSignificantTimingChanges()); return 1; }
|
||||
|
||||
static int GetRadarValues( T* p, lua_State *L )
|
||||
{
|
||||
PlayerNumber pn = Enum::Check<PlayerNumber>(L, 1);
|
||||
@@ -454,6 +471,7 @@ public:
|
||||
ADD_METHOD( GetFilename );
|
||||
ADD_METHOD( GetHash );
|
||||
ADD_METHOD( GetMeter );
|
||||
ADD_METHOD( HasSignificantTimingChanges );
|
||||
ADD_METHOD( GetRadarValues );
|
||||
//ADD_METHOD( GetSMNoteData );
|
||||
ADD_METHOD( GetStepsType );
|
||||
|
||||
@@ -120,6 +120,11 @@ public:
|
||||
|
||||
/** @brief Timing data */
|
||||
TimingData m_Timing;
|
||||
|
||||
/**
|
||||
* @brief Determine if the Steps have any major timing changes during gameplay.
|
||||
* @return true if it does, or false otherwise. */
|
||||
bool HasSignificantTimingChanges() const;
|
||||
|
||||
// Lua
|
||||
void PushSelf( lua_State *L );
|
||||
|
||||
Reference in New Issue
Block a user