Adjust attacks on offset change.
Should we ever store the other timing segments in seconds and not beats in the future, we may want to use this.
This commit is contained in:
@@ -104,6 +104,14 @@ vector<RString> AttackArray::ToVectorString() const
|
||||
return ret;
|
||||
}
|
||||
|
||||
void AttackArray::UpdateStartTimes(float delta)
|
||||
{
|
||||
FOREACH(Attack, *this, a)
|
||||
{
|
||||
a->fStartSecond += delta;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (c) 2003-2004 Chris Danford
|
||||
* All rights reserved.
|
||||
|
||||
@@ -76,6 +76,11 @@ struct AttackArray : public vector<Attack>
|
||||
* @brief Return a string representation used for simfiles.
|
||||
* @return the string representation. */
|
||||
vector<RString> ToVectorString() const;
|
||||
|
||||
/**
|
||||
* @brief Adjust the starting time of all attacks.
|
||||
* @param delta the amount to change. */
|
||||
void UpdateStartTimes(float delta);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1936,6 +1936,14 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
||||
}
|
||||
GetAppropriateTiming().m_fBeat0OffsetInSeconds += fDelta;
|
||||
(fDelta>0 ? m_soundValueIncrease : m_soundValueDecrease).Play();
|
||||
if (GAMESTATE->m_bIsUsingStepTiming)
|
||||
{
|
||||
GAMESTATE->m_pCurSteps[PLAYER_1]->m_Attacks.UpdateStartTimes(fDelta);
|
||||
}
|
||||
else
|
||||
{
|
||||
GAMESTATE->m_pCurSong->m_Attacks.UpdateStartTimes(fDelta);
|
||||
}
|
||||
SetDirty( true );
|
||||
}
|
||||
break;
|
||||
@@ -3430,7 +3438,17 @@ static void ChangeBeat0Offset( const RString &sNew )
|
||||
TimingData &timing = (GAMESTATE->m_bIsUsingStepTiming ?
|
||||
GAMESTATE->m_pCurSteps[PLAYER_1]->m_Timing :
|
||||
GAMESTATE->m_pCurSong->m_SongTiming);
|
||||
float old = timing.m_fBeat0OffsetInSeconds;
|
||||
timing.m_fBeat0OffsetInSeconds = StringToFloat( sNew );
|
||||
float delta = timing.m_fBeat0OffsetInSeconds - old;
|
||||
if (GAMESTATE->m_bIsUsingStepTiming)
|
||||
{
|
||||
GAMESTATE->m_pCurSteps[PLAYER_1]->m_Attacks.UpdateStartTimes(delta);
|
||||
}
|
||||
else
|
||||
{
|
||||
GAMESTATE->m_pCurSong->m_Attacks.UpdateStartTimes(delta);
|
||||
}
|
||||
}
|
||||
|
||||
static void ChangeLastSecondHint( const RString &sNew )
|
||||
|
||||
Reference in New Issue
Block a user