Allow defining a range for an Attack. UNSTABLE!
I seem to randomly get crashes from this. I have not been able to identify the cause.
This commit is contained in:
@@ -817,6 +817,7 @@ CoinsPerCredit=Coins Per Credit
|
||||
Connection=Connection
|
||||
Convert pause to beats=Convert stop to beats
|
||||
Convert delay to beats=Convert delay to beats
|
||||
Convert selection to attack=Convert selection to Attack
|
||||
Convert selection to pause=Convert selection to stop
|
||||
Convert selection to delay=Convert selection to delay
|
||||
Convert selection to warp=Convert selection to Warp Segment
|
||||
|
||||
@@ -571,6 +571,8 @@ static MenuDef g_AlterMenu(
|
||||
EditMode_Full, true, true, 0, NULL ),
|
||||
MenuRowDef(ScreenEdit::convert_to_fake, "Convert selection to fake", true,
|
||||
EditMode_Full, true, true, 0, NULL ),
|
||||
MenuRowDef(ScreenEdit::convert_to_attack, "Convert selection to attack", true,
|
||||
EditMode_Full, true, true, 0, NULL),
|
||||
MenuRowDef(ScreenEdit::routine_invert_notes, "Invert notes' player", true,
|
||||
EditMode_Full, true, true, 0, NULL ),
|
||||
MenuRowDef(ScreenEdit::routine_mirror_1_to_2, "Mirror Player 1 to 2", true,
|
||||
@@ -4114,6 +4116,29 @@ void ScreenEdit::HandleAlterMenuChoice(AlterMenuChoice c, const vector<int> &iAn
|
||||
SetDirty(true);
|
||||
break;
|
||||
}
|
||||
case convert_to_attack:
|
||||
{
|
||||
float startBeat = NoteRowToBeat(m_NoteFieldEdit.m_iBeginMarker);
|
||||
float endBeat = NoteRowToBeat(m_NoteFieldEdit.m_iEndMarker);
|
||||
TimingData &timing = GetAppropriateTiming();
|
||||
float &start = g_fLastInsertAttackPositionSeconds;
|
||||
float &length = g_fLastInsertAttackDurationSeconds;
|
||||
start = timing.GetElapsedTimeFromBeat(startBeat);
|
||||
length = timing.GetElapsedTimeFromBeat(endBeat) - start;
|
||||
|
||||
AttackArray &attacks = GAMESTATE->m_bIsUsingStepTiming ?
|
||||
m_pSteps->m_Attacks : m_pSong->m_Attacks;
|
||||
int iAttack = FindAttackAtTime(attacks, start);
|
||||
|
||||
PlayerOptions po;
|
||||
if (iAttack >= 0)
|
||||
po.FromString(attacks[iAttack].sModifiers);
|
||||
|
||||
GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions.Assign( ModsLevel_Preferred, po );
|
||||
SCREENMAN->AddNewScreenToTop( "ScreenPlayerOptions", SM_BackFromInsertStepAttackPlayerOptions );
|
||||
SetDirty(true);
|
||||
break;
|
||||
}
|
||||
case convert_to_fake:
|
||||
{
|
||||
float startBeat = NoteRowToBeat(m_NoteFieldEdit.m_iBeginMarker);
|
||||
|
||||
@@ -409,6 +409,7 @@ public:
|
||||
convert_to_delay, /**< Convert the range into a DelaySegment. */
|
||||
convert_to_warp, /**< Convert the range into a WarpSegment. */
|
||||
convert_to_fake, /**< Convert the range into a FakeSegment. */
|
||||
convert_to_attack, /**< Convert the range into an Attack. */
|
||||
routine_invert_notes, /**< Switch which player hits the note. */
|
||||
routine_mirror_1_to_2, /**< Mirror Player 1's notes for Player 2. */
|
||||
routine_mirror_2_to_1, /**< Mirror Player 2's notes for Player 1. */
|
||||
|
||||
Reference in New Issue
Block a user