rename: ModeChoice -> GameCommand
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#include "global.h"
|
||||
#include "ModeChoice.h"
|
||||
#include "GameCommand.h"
|
||||
#include "RageUtil.h"
|
||||
#include "RageLog.h"
|
||||
#include "GameManager.h"
|
||||
@@ -18,7 +18,7 @@
|
||||
#include "Style.h"
|
||||
#include "Foreach.h"
|
||||
|
||||
void ModeChoice::Init()
|
||||
void GameCommand::Init()
|
||||
{
|
||||
m_sName = "";
|
||||
m_bInvalid = true;
|
||||
@@ -40,7 +40,7 @@ void ModeChoice::Init()
|
||||
|
||||
bool CompareSongOptions( const SongOptions &so1, const SongOptions &so2 );
|
||||
|
||||
bool ModeChoice::DescribesCurrentModeForAllPlayers() const
|
||||
bool GameCommand::DescribesCurrentModeForAllPlayers() const
|
||||
{
|
||||
FOREACH_HumanPlayer( pn )
|
||||
if( !DescribesCurrentMode(pn) )
|
||||
@@ -49,7 +49,7 @@ bool ModeChoice::DescribesCurrentModeForAllPlayers() const
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ModeChoice::DescribesCurrentMode( PlayerNumber pn ) const
|
||||
bool GameCommand::DescribesCurrentMode( PlayerNumber pn ) const
|
||||
{
|
||||
if( m_pGame != NULL && m_pGame != GAMESTATE->m_pCurGame )
|
||||
return false;
|
||||
@@ -97,7 +97,7 @@ bool ModeChoice::DescribesCurrentMode( PlayerNumber pn ) const
|
||||
return true;
|
||||
}
|
||||
|
||||
void ModeChoice::Load( int iIndex, const ActorCommands& acs )
|
||||
void GameCommand::Load( int iIndex, const ActorCommands& acs )
|
||||
{
|
||||
m_iIndex = iIndex;
|
||||
|
||||
@@ -294,7 +294,7 @@ static bool AreStyleAndPlayModeCompatible( const Style *style, PlayMode pm )
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ModeChoice::IsPlayable( CString *why ) const
|
||||
bool GameCommand::IsPlayable( CString *why ) const
|
||||
{
|
||||
if( m_bInvalid )
|
||||
{
|
||||
@@ -401,7 +401,7 @@ bool ModeChoice::IsPlayable( CString *why ) const
|
||||
return true;
|
||||
}
|
||||
|
||||
void ModeChoice::ApplyToAllPlayers() const
|
||||
void GameCommand::ApplyToAllPlayers() const
|
||||
{
|
||||
FOREACH_HumanPlayer( pn )
|
||||
Apply( pn);
|
||||
@@ -410,7 +410,7 @@ void ModeChoice::ApplyToAllPlayers() const
|
||||
SCREENMAN->SetNewScreen( m_sScreen );
|
||||
}
|
||||
|
||||
void ModeChoice::Apply( PlayerNumber pn ) const
|
||||
void GameCommand::Apply( PlayerNumber pn ) const
|
||||
{
|
||||
if( !GAMESTATE->IsHumanPlayer(pn) )
|
||||
return;
|
||||
@@ -493,7 +493,7 @@ void ModeChoice::Apply( PlayerNumber pn ) const
|
||||
GAMESTATE->m_SongOptions.m_LifeType = SongOptions::LIFE_BATTERY;
|
||||
}
|
||||
|
||||
bool ModeChoice::IsZero() const
|
||||
bool GameCommand::IsZero() const
|
||||
{
|
||||
if( m_pGame != NULL ||
|
||||
m_pm != PLAY_MODE_INVALID ||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* ModeChoice */
|
||||
/* GameCommand */
|
||||
|
||||
#ifndef MODECHOICE_H
|
||||
#define MODECHOICE_H
|
||||
#ifndef GameCommand_H
|
||||
#define GameCommand_H
|
||||
|
||||
#include "GameConstantsAndTypes.h"
|
||||
#include "PlayerNumber.h"
|
||||
@@ -16,9 +16,9 @@ class Style;
|
||||
class Game;
|
||||
struct ActorCommands;
|
||||
|
||||
struct ModeChoice // used in SelectMode
|
||||
struct GameCommand // used in SelectMode
|
||||
{
|
||||
ModeChoice() { Init(); }
|
||||
GameCommand() { Init(); }
|
||||
void Init();
|
||||
|
||||
void Load( int iIndex, const ActorCommands& acs );
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "SongManager.h"
|
||||
#include "Steps.h"
|
||||
#include "NoteSkinManager.h"
|
||||
#include "ModeChoice.h"
|
||||
#include "GameCommand.h"
|
||||
#include "NoteFieldPositioning.h"
|
||||
#include "Character.h"
|
||||
#include "UnlockSystem.h"
|
||||
@@ -85,7 +85,7 @@ void GameState::ApplyCmdline()
|
||||
CString sMode;
|
||||
for( int i = 0; GetCommandlineArgument( "mode", &sMode, i ); ++i )
|
||||
{
|
||||
ModeChoice m;
|
||||
GameCommand m;
|
||||
m.Load( 0, ParseActorCommands(sMode) );
|
||||
CString why;
|
||||
if( !m.IsPlayable(&why) )
|
||||
@@ -175,7 +175,7 @@ void GameState::Reset()
|
||||
// one or the other. -Chris
|
||||
// Having default modifiers in prefs is needed for several things.
|
||||
// The theme setting is for eg. BM being reverse by default. (This
|
||||
// could be done in the title menu ModeChoice, but then it wouldn't
|
||||
// could be done in the title menu GameCommand, but then it wouldn't
|
||||
// affect demo, and other non-gameplay things ...) -glenn
|
||||
ApplyModifiers( p, DEFAULT_MODIFIERS );
|
||||
ApplyModifiers( p, PREFSMAN->m_sDefaultModifiers );
|
||||
@@ -256,7 +256,7 @@ void GameState::PlayersFinalized()
|
||||
GAMESTATE->m_PlayerOptions[pn].ResetSavedPrefs();
|
||||
GAMESTATE->ApplyModifiers( pn, sModifiers );
|
||||
}
|
||||
// Only set the sort order if it wasn't already set by a ModeChoice (or by an earlier profile)
|
||||
// Only set the sort order if it wasn't already set by a GameCommand (or by an earlier profile)
|
||||
if( m_SortOrder == SORT_INVALID && pProfile->m_SortOrder != SORT_INVALID )
|
||||
m_SortOrder = pProfile->m_SortOrder;
|
||||
if( pProfile->m_LastDifficulty != DIFFICULTY_INVALID )
|
||||
@@ -584,7 +584,7 @@ static int GetNumStagesForCurrentSong()
|
||||
* stage is the final stage, and we picked a stage that takes two songs, it
|
||||
* only counts as one stage (so it doesn't bump us all the way to Ex2).
|
||||
* One case where this happens is a long/marathon extra stage. Another is
|
||||
* if a long/marathon song is selected explicitly in the theme with a ModeChoice,
|
||||
* if a long/marathon song is selected explicitly in the theme with a GameCommand,
|
||||
* and PREFSMAN->m_iNumArcadeStages is less than the number of stages that
|
||||
* song takes. */
|
||||
int iNumStagesLeft = PREFSMAN->m_iNumArcadeStages - GAMESTATE->m_iCurrentStageIndex;
|
||||
|
||||
@@ -56,9 +56,10 @@ Attack.cpp Attack.h AutoKeysounds.cpp AutoKeysounds.h BannerCache.cpp BannerCach
|
||||
Character.cpp Character.h CharacterHead.cpp CharacterHead.h \
|
||||
CodeDetector.cpp CodeDetector.h Difficulty.cpp Difficulty.h EnumHelper.cpp EnumHelper.h Course.cpp Course.h \
|
||||
CourseUtil.cpp CourseUtil.h DateTime.cpp DateTime.h Font.cpp Font.h FontCharAliases.cpp FontCharAliases.h \
|
||||
FontCharmaps.cpp FontCharmaps.h Game.cpp Game.h GameConstantsAndTypes.cpp GameConstantsAndTypes.h \
|
||||
FontCharmaps.cpp FontCharmaps.h Game.cpp Game.h GameCommand.cpp GameCommand.h \
|
||||
GameConstantsAndTypes.cpp GameConstantsAndTypes.h \
|
||||
GameInput.cpp GameInput.h Grade.cpp Grade.h HighScore.cpp HighScore.h Inventory.cpp Inventory.h LuaFunctions.h \
|
||||
LuaHelpers.cpp LuaHelpers.h LyricsLoader.cpp LyricsLoader.h MenuInput.h ModeChoice.cpp ModeChoice.h \
|
||||
LuaHelpers.cpp LuaHelpers.h LyricsLoader.cpp LyricsLoader.h MenuInput.h \
|
||||
NoteData.cpp NoteData.h NoteDataUtil.cpp NoteDataUtil.h NoteDataWithScoring.cpp NoteDataWithScoring.h \
|
||||
NoteFieldPositioning.cpp NoteFieldPositioning.h NoteTypes.cpp NoteTypes.h NotesLoader.cpp NotesLoader.h \
|
||||
NotesLoaderBMS.cpp NotesLoaderBMS.h NotesLoaderDWI.cpp NotesLoaderDWI.h NotesLoaderKSF.cpp NotesLoaderKSF.h \
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include "Banner.h"
|
||||
#include "Steps.h"
|
||||
#include "UnlockSystem.h"
|
||||
#include "ModeChoice.h"
|
||||
#include "GameCommand.h"
|
||||
#include "ActorUtil.h"
|
||||
#include "SongUtil.h"
|
||||
#include "CourseUtil.h"
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "WheelNotifyIcon.h"
|
||||
#include "TextBanner.h"
|
||||
#include "GameConstantsAndTypes.h"
|
||||
#include "ModeChoice.h"
|
||||
#include "GameCommand.h"
|
||||
class Course;
|
||||
class Song;
|
||||
|
||||
@@ -77,7 +77,7 @@ struct WheelItemData
|
||||
|
||||
// for TYPE_SORT
|
||||
CString m_sLabel;
|
||||
ModeChoice m_Action;
|
||||
GameCommand m_Action;
|
||||
SortOrder m_SortOrder;
|
||||
};
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "ScreenManager.h"
|
||||
#include "ThemeManager.h"
|
||||
#include "LuaHelpers.h"
|
||||
#include "ModeChoice.h"
|
||||
#include "GameCommand.h"
|
||||
#include "RageUtil.h"
|
||||
|
||||
#define CHOICES THEME->GetMetric (m_sName,"Choices")
|
||||
@@ -43,7 +43,7 @@ void ScreenBranch::HandleScreenMessage( const ScreenMessage SM )
|
||||
CString sNextScreen = NEXT_SCREEN(m_sChoice);
|
||||
LOG->Trace( "Branching to '%s'", sNextScreen.c_str() );
|
||||
|
||||
ModeChoice mc;
|
||||
GameCommand mc;
|
||||
mc.Load( 0, ParseActorCommands(sNextScreen) );
|
||||
if( mc.m_sScreen == "" )
|
||||
RageException::Throw("Metric %s::%s must set \"screen\"",
|
||||
|
||||
@@ -50,7 +50,7 @@ void ScreenOptionsMaster::SetList( OptionRowData &row, OptionRowHandler &hand, C
|
||||
{
|
||||
arraySkinNames[skin].MakeUpper();
|
||||
|
||||
ModeChoice mc;
|
||||
GameCommand mc;
|
||||
mc.m_sModifiers = arraySkinNames[skin];
|
||||
hand.ListEntries.push_back( mc );
|
||||
row.choices.push_back( arraySkinNames[skin] );
|
||||
@@ -78,7 +78,7 @@ void ScreenOptionsMaster::SetList( OptionRowData &row, OptionRowHandler &hand, C
|
||||
|
||||
for( int col = 0; col < NumCols; ++col )
|
||||
{
|
||||
ModeChoice mc;
|
||||
GameCommand mc;
|
||||
mc.Load( 0, ParseActorCommands(ENTRY_MODE(ListName, col)) );
|
||||
if( mc.m_sName == "" )
|
||||
RageException::Throw( "List \"%s\", col %i has no name", ListName.c_str(), col );
|
||||
@@ -104,7 +104,7 @@ void ScreenOptionsMaster::SetStep( OptionRowData &row, OptionRowHandler &hand )
|
||||
if( GAMESTATE->m_bEditing )
|
||||
{
|
||||
row.choices.push_back( "" );
|
||||
hand.ListEntries.push_back( ModeChoice() );
|
||||
hand.ListEntries.push_back( GameCommand() );
|
||||
}
|
||||
else if( GAMESTATE->IsCourseMode() ) // playing a course
|
||||
{
|
||||
@@ -118,7 +118,7 @@ void ScreenOptionsMaster::SetStep( OptionRowData &row, OptionRowHandler &hand )
|
||||
|
||||
CString s = CourseDifficultyToThemedString( pTrail->m_CourseDifficulty );
|
||||
row.choices.push_back( s );
|
||||
ModeChoice mc;
|
||||
GameCommand mc;
|
||||
mc.m_pTrail = pTrail;
|
||||
hand.ListEntries.push_back( mc );
|
||||
}
|
||||
@@ -140,7 +140,7 @@ void ScreenOptionsMaster::SetStep( OptionRowData &row, OptionRowHandler &hand )
|
||||
s += ssprintf( " (%d)", pSteps->GetMeter() );
|
||||
|
||||
row.choices.push_back( s );
|
||||
ModeChoice mc;
|
||||
GameCommand mc;
|
||||
mc.m_pSteps = pSteps;
|
||||
mc.m_dc = pSteps->GetDifficulty();
|
||||
hand.ListEntries.push_back( mc );
|
||||
@@ -174,7 +174,7 @@ void ScreenOptionsMaster::SetCharacter( OptionRowData &row, OptionRowHandler &ha
|
||||
|
||||
{
|
||||
row.choices.push_back( ENTRY_NAME("Off") );
|
||||
ModeChoice mc;
|
||||
GameCommand mc;
|
||||
mc.m_pCharacter = GAMESTATE->GetDefaultCharacter();
|
||||
hand.ListEntries.push_back( mc );
|
||||
}
|
||||
@@ -188,7 +188,7 @@ void ScreenOptionsMaster::SetCharacter( OptionRowData &row, OptionRowHandler &ha
|
||||
s.MakeUpper();
|
||||
|
||||
row.choices.push_back( s );
|
||||
ModeChoice mc;
|
||||
GameCommand mc;
|
||||
mc.m_pCharacter = pCharacter;
|
||||
hand.ListEntries.push_back( mc );
|
||||
}
|
||||
@@ -290,7 +290,7 @@ ScreenOptionsMaster::ScreenOptionsMaster( CString sClassName ):
|
||||
if( m_OptionsNavigation == NAV_TOGGLE_THREE_KEY )
|
||||
{
|
||||
row.choices.insert( row.choices.begin(), ENTRY_NAME("NextRow") );
|
||||
hand.ListEntries.insert( hand.ListEntries.begin(), ModeChoice() );
|
||||
hand.ListEntries.insert( hand.ListEntries.begin(), GameCommand() );
|
||||
}
|
||||
|
||||
OptionRowHandlers.push_back( hand );
|
||||
@@ -326,7 +326,7 @@ void ScreenOptionsMaster::ImportOption( const OptionRowData &row, const OptionRo
|
||||
|
||||
for( unsigned e = 0; e < hand.ListEntries.size(); ++e )
|
||||
{
|
||||
const ModeChoice &mc = hand.ListEntries[e];
|
||||
const GameCommand &mc = hand.ListEntries[e];
|
||||
|
||||
vbSelectedOut[e] = false;
|
||||
|
||||
@@ -522,7 +522,7 @@ void ScreenOptionsMaster::ExportOptions()
|
||||
if( hand.type == ROW_LIST )
|
||||
{
|
||||
const int choice = m_Rows[row]->m_iChoiceWithFocus[0];
|
||||
const ModeChoice &mc = hand.ListEntries[choice];
|
||||
const GameCommand &mc = hand.ListEntries[choice];
|
||||
if( mc.m_sScreen != "" )
|
||||
m_NextScreen = mc.m_sScreen;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define SCREEN_OPTIONS_MASTER_H
|
||||
|
||||
#include "ScreenOptions.h"
|
||||
#include "ModeChoice.h"
|
||||
#include "GameCommand.h"
|
||||
|
||||
struct ConfOption;
|
||||
|
||||
@@ -30,8 +30,8 @@ private:
|
||||
OptionRowType type;
|
||||
|
||||
/* ROW_LIST: */
|
||||
vector<ModeChoice> ListEntries;
|
||||
ModeChoice Default;
|
||||
vector<GameCommand> ListEntries;
|
||||
GameCommand Default;
|
||||
|
||||
/* ROW_CONFIG: */
|
||||
const ConfOption *opt;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "GameState.h"
|
||||
#include "GameConstantsAndTypes.h"
|
||||
#include "ThemeManager.h"
|
||||
#include "ModeChoice.h"
|
||||
#include "GameCommand.h"
|
||||
#include "RageDisplay.h"
|
||||
#include "UnlockSystem.h"
|
||||
#include "arch/ArchHooks/ArchHooks.h"
|
||||
@@ -49,10 +49,10 @@ ScreenSelect::ScreenSelect( CString sClassName ) : ScreenWithMenuElements(sClass
|
||||
CString sChoiceName = asChoiceNames[c];
|
||||
CString sChoice = CHOICE(sChoiceName);
|
||||
|
||||
ModeChoice mc;
|
||||
GameCommand mc;
|
||||
mc.m_sName = sChoiceName;
|
||||
mc.Load( c, ParseActorCommands(sChoice) );
|
||||
m_aModeChoices.push_back( mc );
|
||||
m_aGameCommands.push_back( mc );
|
||||
|
||||
CString sBGAnimationDir = THEME->GetPath(BGAnimations, m_sName, mc.m_sName, true); // true="optional"
|
||||
if( sBGAnimationDir == "" )
|
||||
@@ -73,12 +73,12 @@ ScreenSelect::ScreenSelect( CString sClassName ) : ScreenWithMenuElements(sClass
|
||||
|
||||
m_aCodes.push_back( code );
|
||||
m_aCodeActions.push_back( CODE_ACTION(c) );
|
||||
ModeChoice mc;
|
||||
GameCommand mc;
|
||||
mc.Load( c, ParseActorCommands(CODE_ACTION(c)) );
|
||||
m_aCodeChoices.push_back( mc );
|
||||
}
|
||||
|
||||
if( !m_aModeChoices.size() )
|
||||
if( !m_aGameCommands.size() )
|
||||
RageException::Throw( "Screen \"%s\" does not set any choices", m_sName.c_str() );
|
||||
|
||||
// derived classes can override if they want
|
||||
@@ -176,8 +176,8 @@ void ScreenSelect::FinalizeChoices()
|
||||
FOREACH_HumanPlayer( p )
|
||||
{
|
||||
const int sel = GetSelectionIndex( p );
|
||||
if( m_aModeChoices[sel].m_pStyle )
|
||||
GAMESTATE->m_pCurStyle = m_aModeChoices[sel].m_pStyle;
|
||||
if( m_aGameCommands[sel].m_pStyle )
|
||||
GAMESTATE->m_pCurStyle = m_aGameCommands[sel].m_pStyle;
|
||||
}
|
||||
SCREENMAN->RefreshCreditsMessages();
|
||||
}
|
||||
@@ -203,7 +203,7 @@ void ScreenSelect::HandleScreenMessage( const ScreenMessage SM )
|
||||
* long time (200+ms), and at SM_AllDoneChoosing, we're still tweening stuff
|
||||
* off-screen. */
|
||||
FOREACH_HumanPlayer( p )
|
||||
m_aModeChoices[this->GetSelectionIndex(p)].Apply( p );
|
||||
m_aGameCommands[this->GetSelectionIndex(p)].Apply( p );
|
||||
|
||||
//
|
||||
// Finalize players if we set a style on this screen.
|
||||
@@ -211,7 +211,7 @@ void ScreenSelect::HandleScreenMessage( const ScreenMessage SM )
|
||||
FOREACH_HumanPlayer( p )
|
||||
{
|
||||
const int sel = GetSelectionIndex( p );
|
||||
if( m_aModeChoices[sel].m_pStyle )
|
||||
if( m_aGameCommands[sel].m_pStyle )
|
||||
{
|
||||
GAMESTATE->PlayersFinalized();
|
||||
break;
|
||||
@@ -219,8 +219,8 @@ void ScreenSelect::HandleScreenMessage( const ScreenMessage SM )
|
||||
}
|
||||
|
||||
const int iSelectionIndex = GetSelectionIndex(GAMESTATE->m_MasterPlayerNumber);
|
||||
if( m_aModeChoices[iSelectionIndex].m_sScreen != "" )
|
||||
SCREENMAN->SetNewScreen( m_aModeChoices[iSelectionIndex ].m_sScreen );
|
||||
if( m_aGameCommands[iSelectionIndex].m_sScreen != "" )
|
||||
SCREENMAN->SetNewScreen( m_aGameCommands[iSelectionIndex ].m_sScreen );
|
||||
else
|
||||
SCREENMAN->SetNewScreen( NEXT_SCREEN(iSelectionIndex) );
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
#include "ScreenWithMenuElements.h"
|
||||
#include "BGAnimation.h"
|
||||
#include "ModeChoice.h"
|
||||
#include "GameCommand.h"
|
||||
#include "CodeDetector.h"
|
||||
|
||||
// Derived classes must send this when done
|
||||
@@ -33,10 +33,10 @@ protected:
|
||||
void FinalizeChoices();
|
||||
|
||||
vector<BGAnimation*> m_vpBGAnimations;
|
||||
vector<ModeChoice> m_aModeChoices; // derived classes should look here for what choices are available
|
||||
vector<GameCommand> m_aGameCommands; // derived classes should look here for what choices are available
|
||||
|
||||
vector<CodeItem> m_aCodes;
|
||||
vector<ModeChoice> m_aCodeChoices;
|
||||
vector<GameCommand> m_aCodeChoices;
|
||||
vector<CString> m_aCodeActions;
|
||||
};
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include "ThemeManager.h"
|
||||
#include "GameState.h"
|
||||
#include "AnnouncerManager.h"
|
||||
#include "ModeChoice.h"
|
||||
#include "GameCommand.h"
|
||||
#include "ActorUtil.h"
|
||||
#include "ScreenDimensions.h"
|
||||
|
||||
@@ -38,18 +38,18 @@ ScreenSelectDifficulty::ScreenSelectDifficulty( CString sClassName ) : ScreenSel
|
||||
}
|
||||
|
||||
unsigned c; // GCC is bitching again.
|
||||
for( c=0; c<m_aModeChoices.size(); c++ )
|
||||
for( c=0; c<m_aGameCommands.size(); c++ )
|
||||
{
|
||||
if( (int)c < NUM_CHOICES_ON_PAGE_1 )
|
||||
m_ModeChoices[PAGE_1].push_back( m_aModeChoices[c] );
|
||||
m_GameCommands[PAGE_1].push_back( m_aGameCommands[c] );
|
||||
else
|
||||
m_ModeChoices[PAGE_2].push_back( m_aModeChoices[c] );
|
||||
m_GameCommands[PAGE_2].push_back( m_aGameCommands[c] );
|
||||
}
|
||||
|
||||
c = 0;
|
||||
for( int page=0; page<NUM_PAGES; page++ )
|
||||
{
|
||||
for( unsigned choice=0; choice<m_ModeChoices[page].size(); choice++, c++ )
|
||||
for( unsigned choice=0; choice<m_GameCommands[page].size(); choice++, c++ )
|
||||
{
|
||||
CString sInfoFile = ssprintf( "%s info%d", m_sName.c_str(), c+1 );
|
||||
CString sPictureFile = ssprintf( "%s picture%d", m_sName.c_str(), c+1 );
|
||||
@@ -77,7 +77,7 @@ ScreenSelectDifficulty::ScreenSelectDifficulty( CString sClassName ) : ScreenSel
|
||||
|
||||
FOREACH_PlayerNumber( p )
|
||||
{
|
||||
CLAMP( m_iChoiceOnPage[p], 0, (int)m_ModeChoices[0].size()-1 );
|
||||
CLAMP( m_iChoiceOnPage[p], 0, (int)m_GameCommands[0].size()-1 );
|
||||
m_bChosen[p] = false;
|
||||
|
||||
if( !GAMESTATE->IsHumanPlayer(p) )
|
||||
@@ -142,7 +142,7 @@ int ScreenSelectDifficulty::GetSelectionIndex( PlayerNumber pn )
|
||||
{
|
||||
int index = 0;
|
||||
for( int page=0; page<m_CurrentPage; page++ )
|
||||
index += m_ModeChoices[page].size();
|
||||
index += m_GameCommands[page].size();
|
||||
index += m_iChoiceOnPage[pn];
|
||||
return index;
|
||||
}
|
||||
@@ -153,11 +153,11 @@ void ScreenSelectDifficulty::UpdateSelectableChoices()
|
||||
{
|
||||
/* XXX: If a player joins during the tween-in, this diffuse change
|
||||
* will be undone by the tween. Hmm. */
|
||||
for( unsigned i=0; i<m_ModeChoices[page].size(); i++ )
|
||||
for( unsigned i=0; i<m_GameCommands[page].size(); i++ )
|
||||
{
|
||||
/* If the icon is text, use a dimmer diffuse, or we won't be
|
||||
* able to see the glow. */
|
||||
if( m_ModeChoices[page][i].IsPlayable() )
|
||||
if( m_GameCommands[page][i].IsPlayable() )
|
||||
{
|
||||
m_sprInfo[page][i].SetDiffuse( RageColor(1,1,1,1) );
|
||||
m_sprPicture[page][i].SetDiffuse( RageColor(1,1,1,1) );
|
||||
@@ -180,7 +180,7 @@ void ScreenSelectDifficulty::UpdateSelectableChoices()
|
||||
// }
|
||||
}
|
||||
|
||||
static bool BothPlayersModeChoice( const ModeChoice &mc )
|
||||
static bool BothPlayersGameCommand( const GameCommand &mc )
|
||||
{
|
||||
switch( mc.m_pm )
|
||||
{
|
||||
@@ -209,8 +209,8 @@ void ScreenSelectDifficulty::MenuLeft( PlayerNumber pn )
|
||||
int iSwitchToIndex = -1;
|
||||
for( int i=m_iChoiceOnPage[pn]-1; i>=0; i-- )
|
||||
{
|
||||
const ModeChoice &mc = m_ModeChoices[m_CurrentPage][i];
|
||||
if( AnotherPlayerSelected && BothPlayersModeChoice(mc) )
|
||||
const GameCommand &mc = m_GameCommands[m_CurrentPage][i];
|
||||
if( AnotherPlayerSelected && BothPlayersGameCommand(mc) )
|
||||
continue;
|
||||
if( mc.IsPlayable() )
|
||||
{
|
||||
@@ -243,10 +243,10 @@ void ScreenSelectDifficulty::MenuRight( PlayerNumber pn )
|
||||
AnotherPlayerSelected = true;
|
||||
|
||||
int iSwitchToIndex = -1;
|
||||
for( int i=m_iChoiceOnPage[pn]+1; i<(int) m_ModeChoices[m_CurrentPage].size(); i++ )
|
||||
for( int i=m_iChoiceOnPage[pn]+1; i<(int) m_GameCommands[m_CurrentPage].size(); i++ )
|
||||
{
|
||||
const ModeChoice &mc = m_ModeChoices[m_CurrentPage][i];
|
||||
if( AnotherPlayerSelected && BothPlayersModeChoice(mc) )
|
||||
const GameCommand &mc = m_GameCommands[m_CurrentPage][i];
|
||||
if( AnotherPlayerSelected && BothPlayersGameCommand(mc) )
|
||||
continue;
|
||||
if( mc.IsPlayable() )
|
||||
{
|
||||
@@ -257,7 +257,7 @@ void ScreenSelectDifficulty::MenuRight( PlayerNumber pn )
|
||||
|
||||
if( iSwitchToIndex == -1 )
|
||||
{
|
||||
if( m_ModeChoices[m_CurrentPage+1].size()==0 ) // there is no page 2
|
||||
if( m_GameCommands[m_CurrentPage+1].size()==0 ) // there is no page 2
|
||||
return;
|
||||
|
||||
if( m_CurrentPage < NUM_PAGES-1 )
|
||||
@@ -290,18 +290,18 @@ void ScreenSelectDifficulty::ChangePage( Page newPage )
|
||||
int iSwitchToIndex = -1;
|
||||
if( !bPageIncreasing )
|
||||
{
|
||||
for( int i=m_ModeChoices[newPage].size()-1; i>=0; i-- )
|
||||
for( int i=m_GameCommands[newPage].size()-1; i>=0; i-- )
|
||||
{
|
||||
if( m_ModeChoices[newPage][i].IsPlayable() )
|
||||
if( m_GameCommands[newPage][i].IsPlayable() )
|
||||
{
|
||||
iSwitchToIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for( unsigned i=0; i<m_ModeChoices[newPage].size(); i++ )
|
||||
for( unsigned i=0; i<m_GameCommands[newPage].size(); i++ )
|
||||
{
|
||||
if( m_ModeChoices[newPage][i].IsPlayable() )
|
||||
if( m_GameCommands[newPage][i].IsPlayable() )
|
||||
{
|
||||
iSwitchToIndex = i;
|
||||
break;
|
||||
@@ -325,7 +325,7 @@ void ScreenSelectDifficulty::ChangePage( Page newPage )
|
||||
|
||||
bool ScreenSelectDifficulty::ChangeWithinPage( PlayerNumber pn, int iNewChoice, bool bChangingPages )
|
||||
{
|
||||
ASSERT_M( iNewChoice >= 0 && iNewChoice < (int) m_ModeChoices[m_CurrentPage].size(), ssprintf("%i, %i", iNewChoice, (int) m_ModeChoices[m_CurrentPage].size()) );
|
||||
ASSERT_M( iNewChoice >= 0 && iNewChoice < (int) m_GameCommands[m_CurrentPage].size(), ssprintf("%i, %i", iNewChoice, (int) m_GameCommands[m_CurrentPage].size()) );
|
||||
|
||||
bool bAnyChanged = false;
|
||||
FOREACH_HumanPlayer( p )
|
||||
@@ -369,7 +369,7 @@ void ScreenSelectDifficulty::MenuStart( PlayerNumber pn )
|
||||
for( int page=0; page<NUM_PAGES; page++ )
|
||||
OFF_COMMAND( m_sprMore[page] );
|
||||
|
||||
const ModeChoice& mc = m_ModeChoices[m_CurrentPage][m_iChoiceOnPage[pn]];
|
||||
const GameCommand& mc = m_GameCommands[m_CurrentPage][m_iChoiceOnPage[pn]];
|
||||
|
||||
/* Don't play sound if we're recursive, since it just played. */
|
||||
static bool bPlaySelect = true;
|
||||
@@ -380,7 +380,7 @@ void ScreenSelectDifficulty::MenuStart( PlayerNumber pn )
|
||||
}
|
||||
|
||||
// courses should be selected for both players at all times
|
||||
if( BothPlayersModeChoice(mc) )
|
||||
if( BothPlayersGameCommand(mc) )
|
||||
{
|
||||
FOREACH_HumanPlayer( p )
|
||||
{
|
||||
@@ -401,24 +401,24 @@ void ScreenSelectDifficulty::MenuStart( PlayerNumber pn )
|
||||
if( m_bChosen[p] || p == pn )
|
||||
continue;
|
||||
|
||||
if( !BothPlayersModeChoice(m_ModeChoices[m_CurrentPage][m_iChoiceOnPage[p]]) )
|
||||
if( !BothPlayersGameCommand(m_GameCommands[m_CurrentPage][m_iChoiceOnPage[p]]) )
|
||||
continue;
|
||||
|
||||
/* This player is currently on a choice that is no longer available due to
|
||||
* the selection just made. */
|
||||
int iSwitchToIndex = -1;
|
||||
for( int i=m_iChoiceOnPage[p]+1; iSwitchToIndex == -1 && i < (int) m_ModeChoices[m_CurrentPage].size(); ++i )
|
||||
for( int i=m_iChoiceOnPage[p]+1; iSwitchToIndex == -1 && i < (int) m_GameCommands[m_CurrentPage].size(); ++i )
|
||||
{
|
||||
const ModeChoice &mc = m_ModeChoices[m_CurrentPage][i];
|
||||
if( mc.IsPlayable() && !BothPlayersModeChoice(mc) )
|
||||
const GameCommand &mc = m_GameCommands[m_CurrentPage][i];
|
||||
if( mc.IsPlayable() && !BothPlayersGameCommand(mc) )
|
||||
iSwitchToIndex = i;
|
||||
}
|
||||
if( iSwitchToIndex == -1 ) /* couldn't find a spot looking up; look down */
|
||||
{
|
||||
for( int i=m_iChoiceOnPage[p]-1; iSwitchToIndex == -1 && i >= 0; --i )
|
||||
{
|
||||
const ModeChoice &mc = m_ModeChoices[m_CurrentPage][i];
|
||||
if( mc.IsPlayable() && !BothPlayersModeChoice(mc) )
|
||||
const GameCommand &mc = m_GameCommands[m_CurrentPage][i];
|
||||
if( mc.IsPlayable() && !BothPlayersGameCommand(mc) )
|
||||
iSwitchToIndex = i;
|
||||
}
|
||||
}
|
||||
@@ -443,16 +443,16 @@ void ScreenSelectDifficulty::MenuStart( PlayerNumber pn )
|
||||
|
||||
if( bAnyPlayersLeft )
|
||||
{
|
||||
for( unsigned c=0; c<m_ModeChoices[PAGE_1].size(); c++ )
|
||||
for( unsigned c=0; c<m_GameCommands[PAGE_1].size(); c++ )
|
||||
{
|
||||
if( BothPlayersModeChoice(m_ModeChoices[PAGE_1][c]) )
|
||||
if( BothPlayersGameCommand(m_GameCommands[PAGE_1][c]) )
|
||||
{
|
||||
m_sprPicture[PAGE_1][c].Command( IGNORED_ELEMENT_COMMAND );
|
||||
m_sprInfo[PAGE_1][c].Command( IGNORED_ELEMENT_COMMAND );
|
||||
|
||||
// IGNORED_ELEMENT_COMMAND
|
||||
}
|
||||
// m_ModeChoices[PAGE_1].push_back( m_aModeChoices[c] );
|
||||
// m_GameCommands[PAGE_1].push_back( m_aGameCommands[c] );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -494,7 +494,7 @@ void ScreenSelectDifficulty::TweenOnScreen()
|
||||
SET_XY_AND_ON_COMMAND( m_sprExplanation[page] );
|
||||
SET_XY_AND_ON_COMMAND( m_sprMore[page] );
|
||||
|
||||
for( unsigned c=0; c<m_ModeChoices[page].size(); c++ )
|
||||
for( unsigned c=0; c<m_GameCommands[page].size(); c++ )
|
||||
{
|
||||
SET_XY_AND_ON_COMMAND( m_sprInfo[page][c] );
|
||||
SET_XY_AND_ON_COMMAND( m_sprPicture[page][c] );
|
||||
@@ -528,7 +528,7 @@ void ScreenSelectDifficulty::TweenOffScreen()
|
||||
OFF_COMMAND( m_sprShadow[p] );
|
||||
}
|
||||
|
||||
for( unsigned c=0; c<m_ModeChoices[page].size(); c++ )
|
||||
for( unsigned c=0; c<m_GameCommands[page].size(); c++ )
|
||||
{
|
||||
OFF_COMMAND( m_sprInfo[page][c] );
|
||||
OFF_COMMAND( m_sprPicture[page][c] );
|
||||
|
||||
@@ -52,7 +52,7 @@ protected:
|
||||
RageSound m_soundChange;
|
||||
RandomSample m_soundDifficult;
|
||||
|
||||
vector<ModeChoice> m_ModeChoices[NUM_PAGES];
|
||||
vector<GameCommand> m_GameCommands[NUM_PAGES];
|
||||
|
||||
Page m_CurrentPage;
|
||||
int m_iChoiceOnPage[NUM_PLAYERS];
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include "GameSoundManager.h"
|
||||
#include "GameState.h"
|
||||
#include "AnnouncerManager.h"
|
||||
#include "ModeChoice.h"
|
||||
#include "GameCommand.h"
|
||||
#include "ActorUtil.h"
|
||||
#include "RageLog.h"
|
||||
#include <set>
|
||||
@@ -42,9 +42,9 @@ REGISTER_SCREEN_CLASS( ScreenSelectMaster );
|
||||
ScreenSelectMaster::ScreenSelectMaster( CString sClassName ) : ScreenSelect( sClassName )
|
||||
{
|
||||
int iDefaultChoice = -1;
|
||||
for( unsigned c=0; c<m_aModeChoices.size(); c++ )
|
||||
for( unsigned c=0; c<m_aGameCommands.size(); c++ )
|
||||
{
|
||||
const ModeChoice& mc = m_aModeChoices[c];
|
||||
const GameCommand& mc = m_aGameCommands[c];
|
||||
if( mc.m_sName == DEFAULT_CHOICE )
|
||||
{
|
||||
iDefaultChoice = c;
|
||||
@@ -99,9 +99,9 @@ ScreenSelectMaster::ScreenSelectMaster( CString sClassName ) : ScreenSelect( sCl
|
||||
m_Scroller[0].SetName( "Scroller" );
|
||||
this->AddChild( &m_Scroller[0] );
|
||||
|
||||
for( unsigned c=0; c<m_aModeChoices.size(); c++ )
|
||||
for( unsigned c=0; c<m_aGameCommands.size(); c++ )
|
||||
{
|
||||
const ModeChoice& mc = m_aModeChoices[c];
|
||||
const GameCommand& mc = m_aGameCommands[c];
|
||||
|
||||
CString sFName = ssprintf("%s Scroll Choice%s", m_sName.c_str(),mc.m_sName.c_str());
|
||||
m_sprScroll[c][0].Load( THEME->GetPathToG(sFName) );
|
||||
@@ -123,9 +123,9 @@ ScreenSelectMaster::ScreenSelectMaster( CString sClassName ) : ScreenSelect( sCl
|
||||
m_Scroller[p].SetName( ssprintf("ScrollerP%d",p+1) );
|
||||
this->AddChild( &m_Scroller[p] );
|
||||
|
||||
for( unsigned c=0; c<m_aModeChoices.size(); c++ )
|
||||
for( unsigned c=0; c<m_aGameCommands.size(); c++ )
|
||||
{
|
||||
const ModeChoice& mc = m_aModeChoices[c];
|
||||
const GameCommand& mc = m_aGameCommands[c];
|
||||
|
||||
CString sFName = ssprintf("%s Scroll Choice%s P%d", m_sName.c_str(),mc.m_sName.c_str(),p+1);
|
||||
m_sprScroll[c][p].Load( THEME->GetPathToG(sFName) );
|
||||
@@ -136,9 +136,9 @@ ScreenSelectMaster::ScreenSelectMaster( CString sClassName ) : ScreenSelect( sCl
|
||||
}
|
||||
}
|
||||
|
||||
for( unsigned c=0; c<m_aModeChoices.size(); c++ )
|
||||
for( unsigned c=0; c<m_aGameCommands.size(); c++ )
|
||||
{
|
||||
const ModeChoice& mc = m_aModeChoices[c];
|
||||
const GameCommand& mc = m_aGameCommands[c];
|
||||
|
||||
// init icon
|
||||
for( int i=0; i<NUM_ICON_PARTS; i++ )
|
||||
@@ -190,7 +190,7 @@ ScreenSelectMaster::ScreenSelectMaster( CString sClassName ) : ScreenSelect( sCl
|
||||
|
||||
FOREACH_PlayerNumber( p )
|
||||
{
|
||||
CLAMP( m_iChoice[p], 0, (int)m_aModeChoices.size()-1 );
|
||||
CLAMP( m_iChoice[p], 0, (int)m_aGameCommands.size()-1 );
|
||||
m_bChosen[p] = false;
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ ScreenSelectMaster::ScreenSelectMaster( CString sClassName ) : ScreenSelect( sCl
|
||||
for( int dir = 0; dir < NUM_DIRS; ++dir )
|
||||
{
|
||||
/* Reasonable defaults: */
|
||||
for( unsigned c = 0; c < m_aModeChoices.size(); ++c )
|
||||
for( unsigned c = 0; c < m_aGameCommands.size(); ++c )
|
||||
{
|
||||
int add;
|
||||
switch( dir )
|
||||
@@ -214,9 +214,9 @@ ScreenSelectMaster::ScreenSelectMaster( CString sClassName ) : ScreenSelect( sCl
|
||||
m_Next[dir][c] = c + add;
|
||||
/* By default, only wrap around for DIR_AUTO. */
|
||||
if( dir == DIR_AUTO )
|
||||
wrap( m_Next[dir][c], m_aModeChoices.size() );
|
||||
wrap( m_Next[dir][c], m_aGameCommands.size() );
|
||||
else
|
||||
m_Next[dir][c] = clamp( m_Next[dir][c], 0, (int)m_aModeChoices.size()-1 );
|
||||
m_Next[dir][c] = clamp( m_Next[dir][c], 0, (int)m_aGameCommands.size()-1 );
|
||||
}
|
||||
|
||||
const CString dirname = dirs[dir];
|
||||
@@ -239,8 +239,8 @@ ScreenSelectMaster::ScreenSelectMaster( CString sClassName ) : ScreenSelect( sCl
|
||||
--from;
|
||||
--to;
|
||||
|
||||
if( from >= m_aModeChoices.size() ||
|
||||
to >= m_aModeChoices.size() )
|
||||
if( from >= m_aGameCommands.size() ||
|
||||
to >= m_aGameCommands.size() )
|
||||
{
|
||||
LOG->Warn( "%s::OptionOrder%s out of range", m_sName.c_str(), dirname.c_str() );
|
||||
continue;
|
||||
@@ -328,18 +328,18 @@ int ScreenSelectMaster::GetSelectionIndex( PlayerNumber pn )
|
||||
|
||||
void ScreenSelectMaster::UpdateSelectableChoices()
|
||||
{
|
||||
for( unsigned c=0; c<m_aModeChoices.size(); c++ )
|
||||
for( unsigned c=0; c<m_aGameCommands.size(); c++ )
|
||||
for( int i=0; i<NUM_ICON_PARTS; i++ )
|
||||
COMMAND( m_sprIcon[i][c], m_aModeChoices[c].IsPlayable()? "Enabled":"Disabled" );
|
||||
COMMAND( m_sprIcon[i][c], m_aGameCommands[c].IsPlayable()? "Enabled":"Disabled" );
|
||||
|
||||
FOREACH_PlayerNumber( p )
|
||||
{
|
||||
if( !GAMESTATE->IsHumanPlayer(p) )
|
||||
continue;
|
||||
|
||||
if( !m_aModeChoices[m_iChoice[p]].IsPlayable() )
|
||||
if( !m_aGameCommands[m_iChoice[p]].IsPlayable() )
|
||||
Move( (PlayerNumber) p, DIR_AUTO );
|
||||
ASSERT( m_aModeChoices[m_iChoice[p]].IsPlayable() );
|
||||
ASSERT( m_aGameCommands[m_iChoice[p]].IsPlayable() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -356,7 +356,7 @@ bool ScreenSelectMaster::Move( PlayerNumber pn, Dirs dir )
|
||||
return false; // went full circle and none found
|
||||
seen.insert( iSwitchToIndex );
|
||||
}
|
||||
while( !m_aModeChoices[iSwitchToIndex].IsPlayable() );
|
||||
while( !m_aGameCommands[iSwitchToIndex].IsPlayable() );
|
||||
|
||||
return ChangeSelection( pn, iSwitchToIndex );
|
||||
}
|
||||
@@ -417,7 +417,7 @@ bool ScreenSelectMaster::ChangePage( int iNewChoice )
|
||||
|
||||
const CString sIconAndExplanationCommand = ssprintf( "SwitchToPage%d", newPage+1 );
|
||||
|
||||
for( unsigned c=0; c<m_aModeChoices.size(); c++ )
|
||||
for( unsigned c=0; c<m_aGameCommands.size(); c++ )
|
||||
for( int i=0; i<NUM_ICON_PARTS; i++ )
|
||||
COMMAND( m_sprIcon[i][c], sIconAndExplanationCommand );
|
||||
|
||||
@@ -540,10 +540,10 @@ bool ScreenSelectMaster::ChangeSelection( PlayerNumber pn, int iNewChoice )
|
||||
m_Scroller[p].SetDestinationItem( iNewChoice );
|
||||
|
||||
if( SHARED_PREVIEW_AND_CURSOR )
|
||||
for( unsigned c=0; c<m_aModeChoices.size(); c++ )
|
||||
for( unsigned c=0; c<m_aGameCommands.size(); c++ )
|
||||
COMMAND( *m_sprScroll[c][0], int(c) == m_iChoice[0]? "GainFocus":"LoseFocus" );
|
||||
else
|
||||
for( unsigned c=0; c<m_aModeChoices.size(); c++ )
|
||||
for( unsigned c=0; c<m_aGameCommands.size(); c++ )
|
||||
COMMAND( *m_sprScroll[c][p], int(c) == m_iChoice[p]? "GainFocus":"LoseFocus" );
|
||||
}
|
||||
}
|
||||
@@ -594,7 +594,7 @@ void ScreenSelectMaster::MenuStart( PlayerNumber pn )
|
||||
if( m_bChosen[pn] )
|
||||
return;
|
||||
|
||||
ModeChoice &mc = m_aModeChoices[m_iChoice[pn]];
|
||||
GameCommand &mc = m_aGameCommands[m_iChoice[pn]];
|
||||
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo(ssprintf("%s comment %s",m_sName.c_str(), mc.m_sName.c_str())) );
|
||||
SCREENMAN->PlayStartSound();
|
||||
|
||||
@@ -635,7 +635,7 @@ void ScreenSelectMaster::MenuStart( PlayerNumber pn )
|
||||
*/
|
||||
void ScreenSelectMaster::TweenOnScreen()
|
||||
{
|
||||
for( unsigned c=0; c<m_aModeChoices.size(); c++ )
|
||||
for( unsigned c=0; c<m_aGameCommands.size(); c++ )
|
||||
{
|
||||
for( int i=0; i<NUM_ICON_PARTS; i++ )
|
||||
{
|
||||
@@ -691,7 +691,7 @@ void ScreenSelectMaster::TweenOnScreen()
|
||||
{
|
||||
m_Scroller[0].SetCurrentAndDestinationItem( m_iChoice[0] );
|
||||
SET_XY_AND_ON_COMMAND( m_Scroller[0] );
|
||||
for( unsigned c=0; c<m_aModeChoices.size(); c++ )
|
||||
for( unsigned c=0; c<m_aGameCommands.size(); c++ )
|
||||
COMMAND( *m_sprScroll[c][0], int(c) == m_iChoice[0]? "GainFocus":"LoseFocus" );
|
||||
}
|
||||
else
|
||||
@@ -699,7 +699,7 @@ void ScreenSelectMaster::TweenOnScreen()
|
||||
{
|
||||
m_Scroller[p].SetCurrentAndDestinationItem( m_iChoice[p] );
|
||||
SET_XY_AND_ON_COMMAND( m_Scroller[p] );
|
||||
for( unsigned c=0; c<m_aModeChoices.size(); c++ )
|
||||
for( unsigned c=0; c<m_aGameCommands.size(); c++ )
|
||||
COMMAND( *m_sprScroll[c][p], int(c) == m_iChoice[p]? "GainFocus":"LoseFocus" );
|
||||
}
|
||||
}
|
||||
@@ -733,7 +733,7 @@ void ScreenSelectMaster::TweenOffScreen()
|
||||
OFF_COMMAND( m_sprCursor[i][p] );
|
||||
}
|
||||
|
||||
for( unsigned c=0; c<m_aModeChoices.size(); c++ )
|
||||
for( unsigned c=0; c<m_aGameCommands.size(); c++ )
|
||||
{
|
||||
if( GetPage(c) != GetCurrentPage() )
|
||||
continue; // skip
|
||||
|
||||
@@ -53,9 +53,9 @@ ScreenSelectMode::ScreenSelectMode( CString sClassName ) : ScreenSelect( sClassN
|
||||
m_soundConfirm.Load( THEME->GetPathToS("ScreenSelectMode modeconfirm"));
|
||||
m_soundStart.Load( THEME->GetPathToS("ScreenSelectMode menustart"));
|
||||
|
||||
for( unsigned i=0; i<m_aModeChoices.size(); i++ )
|
||||
for( unsigned i=0; i<m_aGameCommands.size(); i++ )
|
||||
{
|
||||
const ModeChoice& mc = m_aModeChoices[i];
|
||||
const GameCommand& mc = m_aGameCommands[i];
|
||||
|
||||
//
|
||||
// Load Sprite
|
||||
@@ -186,9 +186,9 @@ void ScreenSelectMode::UpdateSelectableChoices()
|
||||
m_iNumChoices = 0;
|
||||
unsigned i=0;
|
||||
unsigned j=0;
|
||||
for( i=0; i<m_aModeChoices.size(); i++ )
|
||||
for( i=0; i<m_aGameCommands.size(); i++ )
|
||||
{
|
||||
const ModeChoice& mc = m_aModeChoices[i];
|
||||
const GameCommand& mc = m_aGameCommands[i];
|
||||
CString modename = mc.m_sName;
|
||||
modename.MakeUpper();
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "Quad.h"
|
||||
#include "ScrollingList.h"
|
||||
#include "GameConstantsAndTypes.h"
|
||||
#include "ModeChoice.h"
|
||||
#include "GameCommand.h"
|
||||
#include "BitmapText.h"
|
||||
#include "RandomSample.h"
|
||||
#include "Character.h"
|
||||
|
||||
@@ -25,9 +25,9 @@ ScreenSelectStyle::ScreenSelectStyle( CString sClassName ) : ScreenSelect( sClas
|
||||
|
||||
LIGHTSMAN->SetLightsMode( LIGHTSMODE_MENU );
|
||||
|
||||
for( unsigned i=0; i<m_aModeChoices.size(); i++ )
|
||||
for( unsigned i=0; i<m_aGameCommands.size(); i++ )
|
||||
{
|
||||
const ModeChoice& mc = m_aModeChoices[i];
|
||||
const GameCommand& mc = m_aGameCommands[i];
|
||||
|
||||
//
|
||||
// Load icon
|
||||
@@ -92,9 +92,9 @@ ScreenSelectStyle::ScreenSelectStyle( CString sClassName ) : ScreenSelect( sClas
|
||||
|
||||
|
||||
// fix Z ordering of Picture and Info so that they draw on top
|
||||
for( unsigned i=0; i<this->m_aModeChoices.size(); i++ )
|
||||
for( unsigned i=0; i<this->m_aGameCommands.size(); i++ )
|
||||
this->MoveToTail( &m_sprPicture[i] );
|
||||
for( unsigned i=0; i<this->m_aModeChoices.size(); i++ )
|
||||
for( unsigned i=0; i<this->m_aGameCommands.size(); i++ )
|
||||
this->MoveToTail( &m_sprInfo[i] );
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ ScreenSelectStyle::ScreenSelectStyle( CString sClassName ) : ScreenSelect( sClas
|
||||
//
|
||||
// TweenOnScreen
|
||||
//
|
||||
for( unsigned i=0; i<m_aModeChoices.size(); i++ )
|
||||
for( unsigned i=0; i<m_aGameCommands.size(); i++ )
|
||||
{
|
||||
SET_XY_AND_ON_COMMAND( m_textIcon[i] );
|
||||
SET_XY_AND_ON_COMMAND( m_sprIcon[i] );
|
||||
@@ -139,7 +139,7 @@ void ScreenSelectStyle::MenuLeft( PlayerNumber pn )
|
||||
int iSwitchToIndex = -1; // -1 means none found
|
||||
for( int i=m_iSelection-1; i>=0; i-- )
|
||||
{
|
||||
if( m_aModeChoices[i].IsPlayable() )
|
||||
if( m_aGameCommands[i].IsPlayable() )
|
||||
{
|
||||
iSwitchToIndex = i;
|
||||
break;
|
||||
@@ -158,9 +158,9 @@ void ScreenSelectStyle::MenuLeft( PlayerNumber pn )
|
||||
void ScreenSelectStyle::MenuRight( PlayerNumber pn )
|
||||
{
|
||||
int iSwitchToIndex = -1; // -1 means none found
|
||||
for( unsigned i=m_iSelection+1; i<m_aModeChoices.size(); i++ )
|
||||
for( unsigned i=m_iSelection+1; i<m_aGameCommands.size(); i++ )
|
||||
{
|
||||
if( m_aModeChoices[i].IsPlayable() )
|
||||
if( m_aGameCommands[i].IsPlayable() )
|
||||
{
|
||||
iSwitchToIndex = i;
|
||||
break;
|
||||
@@ -190,14 +190,14 @@ void ScreenSelectStyle::MenuStart( PlayerNumber pn )
|
||||
SCREENMAN->PlayStartSound();
|
||||
SCREENMAN->SendMessageToTopScreen( SM_AllDoneChoosing );
|
||||
|
||||
const ModeChoice& mc = m_aModeChoices[GetSelectionIndex(pn)];
|
||||
const GameCommand& mc = m_aGameCommands[GetSelectionIndex(pn)];
|
||||
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo(ssprintf("%s comment %s",m_sName.c_str(),mc.m_sName.c_str())) );
|
||||
|
||||
//
|
||||
// TweenOffScreen
|
||||
//
|
||||
|
||||
for( unsigned i=0; i<m_aModeChoices.size(); i++ )
|
||||
for( unsigned i=0; i<m_aGameCommands.size(); i++ )
|
||||
{
|
||||
OFF_COMMAND( m_sprIcon[i] );
|
||||
OFF_COMMAND( m_textIcon[i] );
|
||||
@@ -216,11 +216,11 @@ int ScreenSelectStyle::GetSelectionIndex( PlayerNumber pn )
|
||||
|
||||
void ScreenSelectStyle::UpdateSelectableChoices()
|
||||
{
|
||||
for( unsigned i=0; i<m_aModeChoices.size(); i++ )
|
||||
for( unsigned i=0; i<m_aGameCommands.size(); i++ )
|
||||
{
|
||||
/* If the icon is text, use a dimmer diffuse, or we won't be
|
||||
* able to see the glow. */
|
||||
if( m_aModeChoices[i].IsPlayable() )
|
||||
if( m_aGameCommands[i].IsPlayable() )
|
||||
{
|
||||
m_sprIcon[i].SetDiffuse( RageColor(1,1,1,1) );
|
||||
m_textIcon[i].SetDiffuse( RageColor(0.5f,0.5f,0.5f,1) ); // gray so glow is visible
|
||||
@@ -236,9 +236,9 @@ void ScreenSelectStyle::UpdateSelectableChoices()
|
||||
BeforeChange();
|
||||
|
||||
int iSwitchToStyleIndex = -1; // -1 means none found
|
||||
for( unsigned i=0; i<m_aModeChoices.size(); i++ )
|
||||
for( unsigned i=0; i<m_aGameCommands.size(); i++ )
|
||||
{
|
||||
const ModeChoice& mc = m_aModeChoices[i];
|
||||
const GameCommand& mc = m_aGameCommands[i];
|
||||
if( mc.IsPlayable() )
|
||||
{
|
||||
iSwitchToStyleIndex = i;
|
||||
|
||||
@@ -144,9 +144,9 @@ ScreenTitleMenu::ScreenTitleMenu( CString sClassName ) : ScreenSelect( sClassNam
|
||||
{
|
||||
case COIN_HOME:
|
||||
{
|
||||
for( unsigned i=0; i<m_aModeChoices.size(); i++ )
|
||||
for( unsigned i=0; i<m_aGameCommands.size(); i++ )
|
||||
{
|
||||
ModeChoice &mc = m_aModeChoices[i];
|
||||
GameCommand &mc = m_aGameCommands[i];
|
||||
|
||||
m_textChoice[i].LoadFromFont( THEME->GetPathToF("ScreenTitleMenu choices") );
|
||||
m_textChoice[i].SetHorizAlign( (enum Actor::HorizAlign)MENU_TEXT_ALIGN );
|
||||
@@ -180,7 +180,7 @@ ScreenTitleMenu::ScreenTitleMenu( CString sClassName ) : ScreenSelect( sClassNam
|
||||
|
||||
m_Choice = 0;
|
||||
|
||||
for( unsigned i=0; i<m_aModeChoices.size(); i++ )
|
||||
for( unsigned i=0; i<m_aGameCommands.size(); i++ )
|
||||
if( i != m_Choice )
|
||||
{
|
||||
m_textChoice[i].SetZoom( ZOOM_NOT_SELECTED );
|
||||
@@ -218,7 +218,7 @@ void ScreenTitleMenu::MoveCursor( bool up )
|
||||
TimeToDemonstration.GetDeltaTime(); /* Reset the demonstration timer when a key is pressed. */
|
||||
LoseFocus( m_Choice );
|
||||
m_Choice += (up? -1:+1);
|
||||
wrap( (int&)m_Choice, m_aModeChoices.size() );
|
||||
wrap( (int&)m_Choice, m_aGameCommands.size() );
|
||||
m_soundChange.Play();
|
||||
GainFocus( m_Choice );
|
||||
}
|
||||
@@ -231,7 +231,7 @@ void ScreenTitleMenu::Input( const DeviceInput& DeviceI, const InputEventType ty
|
||||
return;
|
||||
|
||||
/* If the CoinMode was changed, we need to reload this screen
|
||||
* so that the right m_aModeChoices will show */
|
||||
* so that the right m_aGameCommands will show */
|
||||
if( ScreenAttract::ChangeCoinModeInput( DeviceI, type, GameI, MenuI, StyleI ) )
|
||||
{
|
||||
SCREENMAN->SetNewScreen( "ScreenTitleMenu" );
|
||||
@@ -261,7 +261,7 @@ void ScreenTitleMenu::Input( const DeviceInput& DeviceI, const InputEventType ty
|
||||
break;
|
||||
case MENU_BUTTON_START:
|
||||
/* return if the choice is invalid */
|
||||
const ModeChoice &mc = m_aModeChoices[m_Choice];
|
||||
const GameCommand &mc = m_aGameCommands[m_Choice];
|
||||
CString why;
|
||||
if( !mc.IsPlayable( &why ) )
|
||||
{
|
||||
@@ -366,7 +366,7 @@ void ScreenTitleMenu::HandleScreenMessage( const ScreenMessage SM )
|
||||
GAMESTATE->m_PlayerOptions[p].FromString( PREFSMAN->m_sDefaultModifiers );
|
||||
GAMESTATE->m_SongOptions.FromString( PREFSMAN->m_sDefaultModifiers );
|
||||
}
|
||||
m_aModeChoices[m_Choice].ApplyToAllPlayers();
|
||||
m_aGameCommands[m_Choice].ApplyToAllPlayers();
|
||||
break;
|
||||
case SM_GoToAttractLoop:
|
||||
SCREENMAN->SetNewScreen( INITIAL_SCREEN );
|
||||
|
||||
+11
-11
@@ -1,5 +1,5 @@
|
||||
# Microsoft Developer Studio Project File - Name="StepMania" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 60000
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
@@ -62,7 +62,7 @@ IntDir=.\../Debug6
|
||||
TargetDir=\stepmania\stepmania\Program
|
||||
TargetName=StepMania-debug
|
||||
SOURCE="$(InputPath)"
|
||||
PreLink_Cmds=archutils\Win32\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||
PreLink_Cmds=archutils\Win32\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||
PostBuild_Cmds=archutils\Win32\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi
|
||||
# End Special Build Tool
|
||||
|
||||
@@ -99,7 +99,7 @@ IntDir=.\../Release6
|
||||
TargetDir=\stepmania\stepmania\Program
|
||||
TargetName=StepMania
|
||||
SOURCE="$(InputPath)"
|
||||
PreLink_Cmds=archutils\Win32\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||
PreLink_Cmds=archutils\Win32\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||
PostBuild_Cmds=archutils\Win32\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi
|
||||
# End Special Build Tool
|
||||
|
||||
@@ -740,6 +740,14 @@ SOURCE=.\Game.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\GameCommand.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\GameCommand.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\GameConstantsAndTypes.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -804,14 +812,6 @@ SOURCE=.\LyricsLoader.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ModeChoice.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ModeChoice.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\NoteData.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@@ -683,6 +683,12 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)"\
|
||||
<File
|
||||
RelativePath="Game.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="GameCommand.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="GameCommand.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="GameConstantsAndTypes.cpp">
|
||||
</File>
|
||||
@@ -731,12 +737,6 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)"\
|
||||
<File
|
||||
RelativePath="MenuInput.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="ModeChoice.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="ModeChoice.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="NoteData.cpp">
|
||||
</File>
|
||||
@@ -2403,18 +2403,18 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)"\
|
||||
<File
|
||||
RelativePath="UnlockSystem.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="ezsockets.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="ezsockets.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\VirtualKeyboard.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\VirtualKeyboard.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="ezsockets.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="ezsockets.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Crypto"
|
||||
|
||||
Reference in New Issue
Block a user