If it's a random entry, rather than doing nothing, open ScreenPlayerOptions and set modifiers for the entry. It's less clear how attacks should be handled...so don't.
Strange things happen with second player. I'll look at it later.
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
#include "song.h"
|
#include "song.h"
|
||||||
#include "Steps.h"
|
#include "Steps.h"
|
||||||
#include "OptionRowHandler.h"
|
#include "OptionRowHandler.h"
|
||||||
|
#include "PlayerState.h"
|
||||||
|
|
||||||
enum EditCourseEntryRow
|
enum EditCourseEntryRow
|
||||||
{
|
{
|
||||||
@@ -26,6 +27,8 @@ enum EditCourseEntryRow
|
|||||||
};
|
};
|
||||||
#define FOREACH_EditCourseEntryRow( i ) FOREACH_ENUM( EditCourseEntryRow, NUM_EditCourseEntryRow, i )
|
#define FOREACH_EditCourseEntryRow( i ) FOREACH_ENUM( EditCourseEntryRow, NUM_EditCourseEntryRow, i )
|
||||||
|
|
||||||
|
AutoScreenMessage( SM_BackFromCoursePlayerOptions );
|
||||||
|
|
||||||
static void FillSongsAndChoices( const RString &sSongGroup, vector<Song*> &vpSongsOut, vector<RString> &vsChoicesOut )
|
static void FillSongsAndChoices( const RString &sSongGroup, vector<Song*> &vpSongsOut, vector<RString> &vsChoicesOut )
|
||||||
{
|
{
|
||||||
vpSongsOut.clear();
|
vpSongsOut.clear();
|
||||||
@@ -78,7 +81,7 @@ public:
|
|||||||
}
|
}
|
||||||
virtual int ExportOption( const vector<PlayerNumber> &vpns, const vector<bool> vbSelected[NUM_PLAYERS] ) const
|
virtual int ExportOption( const vector<PlayerNumber> &vpns, const vector<bool> vbSelected[NUM_PLAYERS] ) const
|
||||||
{
|
{
|
||||||
int iChoice = OptionRowHandlerUtil::GetOneSelection( vbSelected[PLAYER_1] );
|
int iChoice = OptionRowHandlerUtil::GetOneSelection( vbSelected[GAMESTATE->m_MasterPlayerNumber] );
|
||||||
GAMESTATE->m_pCurSong.Set( m_vpDisplayedSongs[iChoice] );
|
GAMESTATE->m_pCurSong.Set( m_vpDisplayedSongs[iChoice] );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -276,6 +279,13 @@ void ScreenOptionsEditCourseEntry::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
GAMESTATE->m_pCurTrail[PLAYER_1].Set( pTrail );
|
GAMESTATE->m_pCurTrail[PLAYER_1].Set( pTrail );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
else if( SM == SM_BackFromCoursePlayerOptions )
|
||||||
|
{
|
||||||
|
const PlayerOptions &po = GAMESTATE->m_pPlayerState[GAMESTATE->m_MasterPlayerNumber]->m_PlayerOptions;
|
||||||
|
CourseEntry &ce = pCourse->m_vEntries[GAMESTATE->m_iEditCourseEntryIndex];
|
||||||
|
|
||||||
|
ce.sModifiers = po.GetString();
|
||||||
|
}
|
||||||
|
|
||||||
ScreenOptions::HandleScreenMessage( SM );
|
ScreenOptions::HandleScreenMessage( SM );
|
||||||
}
|
}
|
||||||
@@ -484,7 +494,9 @@ void ScreenOptionsEditCourseEntry::ExportOptions( int iRow, const vector<PlayerN
|
|||||||
|
|
||||||
void ScreenOptionsEditCourseEntry::ProcessMenuStart( const InputEventPlus &input )
|
void ScreenOptionsEditCourseEntry::ProcessMenuStart( const InputEventPlus &input )
|
||||||
{
|
{
|
||||||
switch( m_iCurrentRow[GAMESTATE->m_MasterPlayerNumber] )
|
PlayerNumber pn = GAMESTATE->m_MasterPlayerNumber;
|
||||||
|
|
||||||
|
switch( m_iCurrentRow[pn] )
|
||||||
{
|
{
|
||||||
case ROW_SONG_GROUP:
|
case ROW_SONG_GROUP:
|
||||||
case ROW_SONG:
|
case ROW_SONG:
|
||||||
@@ -498,7 +510,17 @@ void ScreenOptionsEditCourseEntry::ProcessMenuStart( const InputEventPlus &input
|
|||||||
if( SHOW_MODS_ROW )
|
if( SHOW_MODS_ROW )
|
||||||
{
|
{
|
||||||
if( !GAMESTATE->m_pCurCourse->m_vEntries[GAMESTATE->m_iEditCourseEntryIndex].IsFixedSong() )
|
if( !GAMESTATE->m_pCurCourse->m_vEntries[GAMESTATE->m_iEditCourseEntryIndex].IsFixedSong() )
|
||||||
|
{
|
||||||
|
// Set up for ScreenPlayerOptions
|
||||||
|
const Style *pStyle = GAMEMAN->GetEditorStyleForStepsType( GAMESTATE->m_stEdit );
|
||||||
|
CourseEntry &ce = GAMESTATE->m_pCurCourse->m_vEntries[GAMESTATE->m_iEditCourseEntryIndex];
|
||||||
|
|
||||||
|
GAMESTATE->m_pCurStyle.Set( pStyle );
|
||||||
|
GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions.Init();
|
||||||
|
GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions.FromString( ce.sModifiers );
|
||||||
|
SCREENMAN->AddNewScreenToTop( "ScreenPlayerOptions", SM_BackFromCoursePlayerOptions );
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// fall through
|
// fall through
|
||||||
case ROW_DONE:
|
case ROW_DONE:
|
||||||
|
|||||||
Reference in New Issue
Block a user