fix conflicting ScreenMessage IDs by automatically generating unique values
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
#define ROW_VALUE_X( i ) THEME->GetMetricF("EditCoursesMenu",ssprintf("RowValue%dX",i+1))
|
||||
#define ROW_Y( i ) THEME->GetMetricF("EditCoursesMenu",ssprintf("Row%dY",i+1))
|
||||
|
||||
const ScreenMessage SM_BackFromCourseOptionsMenu = (ScreenMessage)(SM_User+1);
|
||||
const AutoScreenMessage SM_BackFromCourseOptionsMenu;
|
||||
|
||||
enum CourseEntryMenuRow
|
||||
{
|
||||
@@ -326,7 +326,7 @@ void EditCoursesMenu::Start()
|
||||
GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions = PlayerOptions();
|
||||
GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions.FromString( pEntry->modifiers );
|
||||
|
||||
SCREENMAN->AddNewScreenToTop( "ScreenPlayerOptions", SM_BackFromPlayerOptions );
|
||||
SCREENMAN->AddNewScreenToTop( "ScreenPlayerOptions" );
|
||||
break;
|
||||
case ROW_ENTRY_SONG_OPTIONS:
|
||||
SCREENMAN->PlayStartSound();
|
||||
@@ -334,7 +334,7 @@ void EditCoursesMenu::Start()
|
||||
GAMESTATE->m_SongOptions = SongOptions();
|
||||
GAMESTATE->m_SongOptions.FromString( pEntry->modifiers );
|
||||
|
||||
SCREENMAN->AddNewScreenToTop( "ScreenSongOptions", SM_BackFromSongOptions );
|
||||
SCREENMAN->AddNewScreenToTop( "ScreenSongOptions" );
|
||||
break;
|
||||
default:
|
||||
SCREENMAN->PlayInvalidSound();
|
||||
@@ -348,9 +348,8 @@ void EditCoursesMenu::HandleScreenMessage( const ScreenMessage SM )
|
||||
Course* pCourse = GetSelectedCourse();
|
||||
CourseEntry* pEntry = GetSelectedEntry();
|
||||
|
||||
switch( SM )
|
||||
if( SM == SM_BackFromCourseOptionsMenu )
|
||||
{
|
||||
case SM_BackFromCourseOptionsMenu:
|
||||
pCourse->m_bRepeat = !!ScreenMiniMenu::s_viLastAnswers[repeat];
|
||||
pCourse->m_bRandomize = !!ScreenMiniMenu::s_viLastAnswers[randomize];
|
||||
pCourse->m_iLives = ScreenMiniMenu::s_viLastAnswers[lives];
|
||||
@@ -358,13 +357,14 @@ void EditCoursesMenu::HandleScreenMessage( const ScreenMessage SM )
|
||||
pCourse->m_iLives = -1;
|
||||
|
||||
OnRowValueChanged( ROW_COURSE_OPTIONS );
|
||||
break;
|
||||
case SM_BackFromPlayerOptions:
|
||||
case SM_BackFromSongOptions:
|
||||
}
|
||||
else if(
|
||||
SM == SM_BackFromPlayerOptions ||
|
||||
SM == SM_BackFromSongOptions )
|
||||
{
|
||||
// coming back from PlayerOptions or SongOptions
|
||||
pEntry->modifiers = GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions.GetString() + "," + GAMESTATE->m_SongOptions.GetString();
|
||||
OnRowValueChanged( ROW_ENTRY_PLAYER_OPTIONS );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
#ifndef GameplayMessages_H
|
||||
#define GameplayMessages_H
|
||||
|
||||
#include "ScreenMessage.h"
|
||||
|
||||
|
||||
// messages sent by Combo
|
||||
const ScreenMessage SM_PlayToasty = ScreenMessage(SM_User+104);
|
||||
|
||||
const ScreenMessage SM_100Combo = ScreenMessage(SM_User+200);
|
||||
const ScreenMessage SM_200Combo = ScreenMessage(SM_User+201);
|
||||
const ScreenMessage SM_300Combo = ScreenMessage(SM_User+202);
|
||||
const ScreenMessage SM_400Combo = ScreenMessage(SM_User+203);
|
||||
const ScreenMessage SM_500Combo = ScreenMessage(SM_User+204);
|
||||
const ScreenMessage SM_600Combo = ScreenMessage(SM_User+205);
|
||||
const ScreenMessage SM_700Combo = ScreenMessage(SM_User+206);
|
||||
const ScreenMessage SM_800Combo = ScreenMessage(SM_User+207);
|
||||
const ScreenMessage SM_900Combo = ScreenMessage(SM_User+208);
|
||||
const ScreenMessage SM_1000Combo = ScreenMessage(SM_User+209);
|
||||
const ScreenMessage SM_ComboStopped = ScreenMessage(SM_User+210);
|
||||
const ScreenMessage SM_ComboContinuing = ScreenMessage(SM_User+211);
|
||||
const ScreenMessage SM_MissComboAborted = ScreenMessage(SM_User+212);
|
||||
|
||||
const ScreenMessage SM_BattleTrickLevel1 = ScreenMessage(SM_User+301);
|
||||
const ScreenMessage SM_BattleTrickLevel2 = ScreenMessage(SM_User+302);
|
||||
const ScreenMessage SM_BattleTrickLevel3 = ScreenMessage(SM_User+303);
|
||||
const ScreenMessage SM_BattleDamageLevel1 = ScreenMessage(SM_User+304);
|
||||
const ScreenMessage SM_BattleDamageLevel2 = ScreenMessage(SM_User+305);
|
||||
const ScreenMessage SM_BattleDamageLevel3 = ScreenMessage(SM_User+306);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* (c) 2001-2002 Chris Danford
|
||||
* All rights reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, and/or sell copies of the Software, and to permit persons to
|
||||
* whom the Software is furnished to do so, provided that the above
|
||||
* copyright notice(s) and this permission notice appear in all copies of
|
||||
* the Software and that both the above copyright notice(s) and this
|
||||
* permission notice appear in supporting documentation.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
||||
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
|
||||
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
|
||||
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
@@ -7,7 +7,6 @@
|
||||
#include "PrefsManager.h"
|
||||
#include "song.h"
|
||||
#include "ScreenManager.h"
|
||||
#include "GameplayMessages.h"
|
||||
#include "StatsManager.h"
|
||||
#include "ThemeMetric.h"
|
||||
#include "PlayerState.h"
|
||||
|
||||
@@ -36,7 +36,7 @@ ScreenGameplay.cpp ScreenGameplay.h ScreenHowToPlay.cpp ScreenHowToPlay.h \
|
||||
ScreenInstructions.cpp ScreenInstructions.h \
|
||||
ScreenJukebox.cpp ScreenJukebox.h \
|
||||
ScreenLogo.cpp ScreenLogo.h ScreenMapControllers.cpp ScreenMapControllers.h \
|
||||
ScreenMessage.h ScreenMiniMenu.cpp ScreenMiniMenu.h ScreenMusicScroll.cpp ScreenMusicScroll.h \
|
||||
ScreenMessage.cpp ScreenMessage.h ScreenMiniMenu.cpp ScreenMiniMenu.h ScreenMusicScroll.cpp ScreenMusicScroll.h \
|
||||
ScreenNameEntry.cpp ScreenNameEntry.h ScreenNameEntryTraditional.cpp ScreenNameEntryTraditional.h \
|
||||
ScreenOptions.cpp ScreenOptions.h ScreenOptionsMaster.cpp ScreenOptionsMaster.h \
|
||||
ScreenOptionsMasterPrefs.cpp ScreenOptionsMasterPrefs.h ScreenPackages.cpp ScreenPackages.h ScreenPlayerOptions.cpp ScreenPlayerOptions.h ScreenNetworkOptions.h \
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
class Course;
|
||||
class Song;
|
||||
|
||||
const ScreenMessage SM_SongChanged = ScreenMessage(SM_User+47); // this should be unique!
|
||||
const ScreenMessage SM_SortOrderChanging= ScreenMessage(SM_User+48);
|
||||
const ScreenMessage SM_SortOrderChanged = ScreenMessage(SM_User+49);
|
||||
const AutoScreenMessage SM_SongChanged; // TODO: Replace this with a Message and MESSAGEMAN
|
||||
const AutoScreenMessage SM_SortOrderChanging;
|
||||
const AutoScreenMessage SM_SortOrderChanged;
|
||||
|
||||
struct CompareSongPointerArrayBySectionName;
|
||||
|
||||
|
||||
@@ -42,11 +42,11 @@ void NetworkSyncManager::SelectUserSong() { }
|
||||
#include "arch/LoadingWindow/LoadingWindow.h"
|
||||
#include "PlayerState.h"
|
||||
|
||||
const ScreenMessage SM_AddToChat = ScreenMessage(SM_User+4);
|
||||
const ScreenMessage SM_ChangeSong = ScreenMessage(SM_User+5);
|
||||
const ScreenMessage SM_GotEval = ScreenMessage(SM_User+6);
|
||||
const ScreenMessage SM_UsersUpdate = ScreenMessage(SM_User+7);
|
||||
const ScreenMessage SM_SMOnlinePack = ScreenMessage(SM_User+8);
|
||||
const AutoScreenMessage SM_AddToChat;
|
||||
const AutoScreenMessage SM_ChangeSong;
|
||||
const AutoScreenMessage SM_GotEval;
|
||||
const AutoScreenMessage SM_UsersUpdate;
|
||||
const AutoScreenMessage SM_SMOnlinePack;
|
||||
|
||||
|
||||
NetworkSyncManager::NetworkSyncManager( LoadingWindow *ld )
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include "RageSoundManager.h"
|
||||
#include "ThemeMetric.h"
|
||||
#include "PlayerState.h"
|
||||
#include "GameplayMessages.h"
|
||||
#include "GameSoundManager.h"
|
||||
#include "Style.h"
|
||||
#include "MessageManager.h"
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include "Steps.h"
|
||||
#include "PrefsManager.h"
|
||||
#include "ScreenManager.h"
|
||||
#include "GameplayMessages.h"
|
||||
#include "GameState.h"
|
||||
#include "Course.h"
|
||||
#include "SongManager.h"
|
||||
|
||||
@@ -54,24 +54,24 @@ void ScreenDemonstration::Init()
|
||||
|
||||
void ScreenDemonstration::HandleScreenMessage( const ScreenMessage SM )
|
||||
{
|
||||
switch( SM )
|
||||
if( SM == SM_NotesEnded ||
|
||||
SM == SM_BeginFadingOut )
|
||||
{
|
||||
case SM_NotesEnded:
|
||||
case SM_BeginFadingOut:
|
||||
if(!m_Out.IsTransitioning())
|
||||
m_Out.StartTransitioning( SM_GoToNextScreen );
|
||||
return;
|
||||
|
||||
case SM_GainFocus:
|
||||
}
|
||||
else if( SM == SM_GainFocus )
|
||||
{
|
||||
if( !GAMESTATE->IsTimeToPlayAttractSounds() )
|
||||
SOUNDMAN->SetPrefs( 0 ); // silent
|
||||
break;
|
||||
|
||||
case SM_LoseFocus:
|
||||
}
|
||||
else if( SM == SM_LoseFocus )
|
||||
{
|
||||
SOUNDMAN->SetPrefs( PREFSMAN->m_fSoundVolume ); // turn volume back on
|
||||
break;
|
||||
|
||||
case SM_GoToNextScreen:
|
||||
}
|
||||
else if( SM == SM_GoToNextScreen )
|
||||
{
|
||||
if( m_pSoundMusic )
|
||||
m_pSoundMusic->Stop();
|
||||
GAMESTATE->Reset();
|
||||
|
||||
+111
-113
@@ -47,22 +47,22 @@ const float RECORD_HOLD_SECONDS = 0.3f;
|
||||
|
||||
#define PLAY_RECORD_HELP_TEXT THEME->GetMetric(m_sName,"PlayRecordHelpText")
|
||||
|
||||
const ScreenMessage SM_BackFromMainMenu = (ScreenMessage)(SM_User+1);
|
||||
const ScreenMessage SM_BackFromAreaMenu = (ScreenMessage)(SM_User+2);
|
||||
const ScreenMessage SM_BackFromStepsInformation = (ScreenMessage)(SM_User+3);
|
||||
const ScreenMessage SM_BackFromEditOptions = (ScreenMessage)(SM_User+4);
|
||||
const ScreenMessage SM_BackFromSongInformation = (ScreenMessage)(SM_User+5);
|
||||
const ScreenMessage SM_BackFromBGChange = (ScreenMessage)(SM_User+6);
|
||||
const ScreenMessage SM_BackFromInsertAttack = (ScreenMessage)(SM_User+9);
|
||||
const ScreenMessage SM_BackFromInsertAttackModifiers= (ScreenMessage)(SM_User+10);
|
||||
const ScreenMessage SM_BackFromPrefs = (ScreenMessage)(SM_User+11);
|
||||
const ScreenMessage SM_BackFromCourseModeMenu = (ScreenMessage)(SM_User+12);
|
||||
const ScreenMessage SM_DoRevertToLastSave = (ScreenMessage)(SM_User+13);
|
||||
const ScreenMessage SM_DoUpdateTextInfo = (ScreenMessage)(SM_User+14);
|
||||
const ScreenMessage SM_BackFromBPMChange = (ScreenMessage)(SM_User+15);
|
||||
const ScreenMessage SM_BackFromStopChange = (ScreenMessage)(SM_User+16);
|
||||
const ScreenMessage SM_DoSaveAndExit = (ScreenMessage)(SM_User+17);
|
||||
const ScreenMessage SM_DoExit = (ScreenMessage)(SM_User+18);
|
||||
const AutoScreenMessage SM_BackFromMainMenu;
|
||||
const AutoScreenMessage SM_BackFromAreaMenu;
|
||||
const AutoScreenMessage SM_BackFromStepsInformation;
|
||||
const AutoScreenMessage SM_BackFromEditOptions;
|
||||
const AutoScreenMessage SM_BackFromSongInformation;
|
||||
const AutoScreenMessage SM_BackFromBGChange;
|
||||
const AutoScreenMessage SM_BackFromInsertAttack;
|
||||
const AutoScreenMessage SM_BackFromInsertAttackModifiers;
|
||||
const AutoScreenMessage SM_BackFromPrefs;
|
||||
const AutoScreenMessage SM_BackFromCourseModeMenu;
|
||||
const AutoScreenMessage SM_DoRevertToLastSave;
|
||||
const AutoScreenMessage SM_DoUpdateTextInfo;
|
||||
const AutoScreenMessage SM_BackFromBPMChange;
|
||||
const AutoScreenMessage SM_BackFromStopChange;
|
||||
const AutoScreenMessage SM_DoSaveAndExit;
|
||||
const AutoScreenMessage SM_DoExit;
|
||||
|
||||
const CString INPUT_TIPS_TEXT =
|
||||
#if !defined(XBOX)
|
||||
@@ -1455,46 +1455,49 @@ void ScreenEdit::TransitionEditMode( EditMode em )
|
||||
|
||||
void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
|
||||
{
|
||||
switch( SM )
|
||||
if( SM == SM_GoToNextScreen )
|
||||
{
|
||||
case SM_GoToNextScreen:
|
||||
SCREENMAN->SetNewScreen( PREV_SCREEN );
|
||||
GAMESTATE->m_bEditing = false;
|
||||
break;
|
||||
case SM_BackFromMainMenu:
|
||||
}
|
||||
else if( SM == SM_BackFromMainMenu )
|
||||
{
|
||||
HandleMainMenuChoice( (MainMenuChoice)ScreenMiniMenu::s_iLastRowCode, ScreenMiniMenu::s_viLastAnswers );
|
||||
break;
|
||||
case SM_BackFromAreaMenu:
|
||||
}
|
||||
else if( SM == SM_BackFromAreaMenu )
|
||||
{
|
||||
HandleAreaMenuChoice( (AreaMenuChoice)ScreenMiniMenu::s_iLastRowCode, ScreenMiniMenu::s_viLastAnswers );
|
||||
break;
|
||||
case SM_BackFromStepsInformation:
|
||||
}
|
||||
else if( SM == SM_BackFromStepsInformation )
|
||||
{
|
||||
HandleStepsInformationChoice( (StepsInformationChoice)ScreenMiniMenu::s_iLastRowCode, ScreenMiniMenu::s_viLastAnswers );
|
||||
break;
|
||||
case SM_BackFromSongInformation:
|
||||
}
|
||||
else if( SM == SM_BackFromSongInformation )
|
||||
{
|
||||
HandleSongInformationChoice( (SongInformationChoice)ScreenMiniMenu::s_iLastRowCode, ScreenMiniMenu::s_viLastAnswers );
|
||||
break;
|
||||
case SM_BackFromBPMChange:
|
||||
{
|
||||
float fBPM = strtof( ScreenTextEntry::s_sLastAnswer, NULL );
|
||||
if( fBPM > 0 )
|
||||
m_pSong->SetBPMAtBeat( GAMESTATE->m_fSongBeat, fBPM );
|
||||
}
|
||||
break;
|
||||
case SM_BackFromStopChange:
|
||||
{
|
||||
float fStop = strtof( ScreenTextEntry::s_sLastAnswer, NULL );
|
||||
if( fStop >= 0 )
|
||||
m_pSong->m_Timing.SetStopAtBeat( GAMESTATE->m_fSongBeat, fStop );
|
||||
}
|
||||
break;
|
||||
case SM_BackFromBGChange:
|
||||
}
|
||||
else if( SM == SM_BackFromBPMChange )
|
||||
{
|
||||
float fBPM = strtof( ScreenTextEntry::s_sLastAnswer, NULL );
|
||||
if( fBPM > 0 )
|
||||
m_pSong->SetBPMAtBeat( GAMESTATE->m_fSongBeat, fBPM );
|
||||
}
|
||||
else if( SM == SM_BackFromStopChange )
|
||||
{
|
||||
float fStop = strtof( ScreenTextEntry::s_sLastAnswer, NULL );
|
||||
if( fStop >= 0 )
|
||||
m_pSong->m_Timing.SetStopAtBeat( GAMESTATE->m_fSongBeat, fStop );
|
||||
}
|
||||
else if( SM == SM_BackFromBGChange )
|
||||
{
|
||||
HandleBGChangeChoice( (BGChangeChoice)ScreenMiniMenu::s_iLastRowCode, ScreenMiniMenu::s_viLastAnswers );
|
||||
break;
|
||||
case SM_BackFromPrefs:
|
||||
}
|
||||
else if( SM == SM_BackFromPrefs )
|
||||
{
|
||||
PREFSMAN->m_bEditorShowBGChangesPlay = !!ScreenMiniMenu::s_viLastAnswers[pref_show_bgs_play];
|
||||
PREFSMAN->SaveGlobalPrefsToDisk();
|
||||
break;
|
||||
case SM_BackFromCourseModeMenu:
|
||||
}
|
||||
else if( SM == SM_BackFromCourseModeMenu )
|
||||
{
|
||||
const int num = ScreenMiniMenu::s_viLastAnswers[0];
|
||||
m_pAttacksFromCourse = NULL;
|
||||
@@ -1504,56 +1507,56 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
|
||||
m_pAttacksFromCourse = SONGMAN->FindCourse( name );
|
||||
ASSERT( m_pAttacksFromCourse );
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SM_BackFromPlayerOptions:
|
||||
case SM_BackFromSongOptions:
|
||||
else if(
|
||||
SM == SM_BackFromPlayerOptions ||
|
||||
SM == SM_BackFromSongOptions )
|
||||
{
|
||||
// coming back from PlayerOptions or SongOptions
|
||||
GAMESTATE->StoreSelectedOptions();
|
||||
|
||||
// stop any music that screen may have been playing
|
||||
SOUND->StopMusic();
|
||||
}
|
||||
else if( SM == SM_BackFromInsertAttack )
|
||||
{
|
||||
int iDurationChoice = ScreenMiniMenu::s_viLastAnswers[0];
|
||||
g_fLastInsertAttackDurationSeconds = strtof( g_InsertAttack.rows[0].choices[iDurationChoice], NULL );
|
||||
GAMESTATE->StoreSelectedOptions(); // save so that we don't lose the options chosen for edit and playback
|
||||
|
||||
break;
|
||||
case SM_BackFromInsertAttack:
|
||||
{
|
||||
int iDurationChoice = ScreenMiniMenu::s_viLastAnswers[0];
|
||||
g_fLastInsertAttackDurationSeconds = strtof( g_InsertAttack.rows[0].choices[iDurationChoice], NULL );
|
||||
GAMESTATE->StoreSelectedOptions(); // save so that we don't lose the options chosen for edit and playback
|
||||
|
||||
// XXX: Fix me
|
||||
//SCREENMAN->AddNewScreenToTop( "ScreenPlayerOptions", SM_BackFromInsertAttackModifiers );
|
||||
}
|
||||
break;
|
||||
case SM_BackFromInsertAttackModifiers:
|
||||
{
|
||||
PlayerOptions poChosen = GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions;
|
||||
CString sMods = poChosen.GetString();
|
||||
const int row = BeatToNoteRow( GAMESTATE->m_fSongBeat );
|
||||
|
||||
TapNote tn(
|
||||
TapNote::attack, TapNote::original,
|
||||
sMods,
|
||||
g_fLastInsertAttackDurationSeconds,
|
||||
false,
|
||||
0 );
|
||||
m_NoteDataEdit.SetTapNote( g_iLastInsertAttackTrack, row, tn );
|
||||
GAMESTATE->RestoreSelectedOptions(); // restore the edit and playback options
|
||||
}
|
||||
break;
|
||||
case SM_DoRevertToLastSave:
|
||||
// XXX: Fix me
|
||||
//SCREENMAN->AddNewScreenToTop( "ScreenPlayerOptions", SM_BackFromInsertAttackModifiers );
|
||||
}
|
||||
else if( SM == SM_BackFromInsertAttackModifiers )
|
||||
{
|
||||
PlayerOptions poChosen = GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions;
|
||||
CString sMods = poChosen.GetString();
|
||||
const int row = BeatToNoteRow( GAMESTATE->m_fSongBeat );
|
||||
|
||||
TapNote tn(
|
||||
TapNote::attack, TapNote::original,
|
||||
sMods,
|
||||
g_fLastInsertAttackDurationSeconds,
|
||||
false,
|
||||
0 );
|
||||
m_NoteDataEdit.SetTapNote( g_iLastInsertAttackTrack, row, tn );
|
||||
GAMESTATE->RestoreSelectedOptions(); // restore the edit and playback options
|
||||
}
|
||||
else if( SM == SM_DoRevertToLastSave )
|
||||
{
|
||||
if( ScreenPrompt::s_LastAnswer == ANSWER_YES )
|
||||
{
|
||||
CopyFromLastSave();
|
||||
m_pSteps->GetNoteData( m_NoteDataEdit );
|
||||
}
|
||||
break;
|
||||
case SM_DoUpdateTextInfo:
|
||||
}
|
||||
else if( SM == SM_DoUpdateTextInfo )
|
||||
{
|
||||
this->PostScreenMessage( SM_DoUpdateTextInfo, 0.5f );
|
||||
UpdateTextInfo();
|
||||
break;
|
||||
|
||||
case SM_DoSaveAndExit: // just asked "save before exiting? yes, no, cancel"
|
||||
}
|
||||
else if( SM == SM_DoSaveAndExit ) // just asked "save before exiting? yes, no, cancel"
|
||||
{
|
||||
switch( ScreenPrompt::s_LastAnswer )
|
||||
{
|
||||
case ANSWER_YES:
|
||||
@@ -1567,61 +1570,56 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
|
||||
case ANSWER_CANCEL:
|
||||
break; // do nothing
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case SM_Success:
|
||||
}
|
||||
else if( SM == SM_Success )
|
||||
{
|
||||
LOG->Trace( "Save successful." );
|
||||
m_pSteps->SetSavedToDisk( true );
|
||||
CopyToLastSave();
|
||||
|
||||
if( m_CurrentAction == save_on_exit )
|
||||
HandleScreenMessage( SM_DoExit );
|
||||
|
||||
break;
|
||||
|
||||
case SM_Failure: // save failed; stay in the editor
|
||||
}
|
||||
else if( SM == SM_Failure ) // save failed; stay in the editor
|
||||
{
|
||||
/* We committed the steps to SongManager. Revert to the last save, and
|
||||
* recommit the reversion to SongManager. */
|
||||
LOG->Trace( "Save failed. Changes uncommitted from memory." );
|
||||
CopyFromLastSave();
|
||||
m_pSteps->SetNoteData( m_NoteDataEdit );
|
||||
}
|
||||
else if( SM == SM_DoExit )
|
||||
{
|
||||
// IMPORTANT: CopyFromLastSave before deleteing the Steps below
|
||||
CopyFromLastSave();
|
||||
|
||||
break;
|
||||
|
||||
case SM_DoExit:
|
||||
// If these steps have never been saved, then we should delete them.
|
||||
// If the user created them in the edit menu and never bothered
|
||||
// to save them, then they aren't wanted.
|
||||
Steps* pSteps = GAMESTATE->m_pCurSteps[PLAYER_1];
|
||||
if( !pSteps->GetSavedToDisk() )
|
||||
{
|
||||
// IMPORTANT: CopyFromLastSave before deleteing the Steps below
|
||||
CopyFromLastSave();
|
||||
|
||||
// If these steps have never been saved, then we should delete them.
|
||||
// If the user created them in the edit menu and never bothered
|
||||
// to save them, then they aren't wanted.
|
||||
Steps* pSteps = GAMESTATE->m_pCurSteps[PLAYER_1];
|
||||
if( !pSteps->GetSavedToDisk() )
|
||||
{
|
||||
Song* pSong = GAMESTATE->m_pCurSong;
|
||||
pSong->RemoveSteps( pSteps );
|
||||
m_pSteps = NULL;
|
||||
GAMESTATE->m_pCurSteps[PLAYER_1].Set( NULL );
|
||||
}
|
||||
Song* pSong = GAMESTATE->m_pCurSong;
|
||||
pSong->RemoveSteps( pSteps );
|
||||
m_pSteps = NULL;
|
||||
GAMESTATE->m_pCurSteps[PLAYER_1].Set( NULL );
|
||||
}
|
||||
|
||||
m_Out.StartTransitioning( SM_GoToNextScreen );
|
||||
break;
|
||||
|
||||
case SM_GainFocus:
|
||||
}
|
||||
else if( SM == SM_GainFocus )
|
||||
{
|
||||
/* We do this ourself. */
|
||||
SOUND->HandleSongTimer( false );
|
||||
|
||||
/* When another screen comes up, RageSounds takes over the sound timer. When we come
|
||||
* back, put the timer back to where it was. */
|
||||
GAMESTATE->m_fSongBeat = m_fTrailingBeat;
|
||||
break;
|
||||
case SM_LoseFocus:
|
||||
}
|
||||
else if( SM == SM_LoseFocus )
|
||||
{
|
||||
/* Snap the trailing beat, in case we lose focus while tweening. */
|
||||
m_fTrailingBeat = GAMESTATE->m_fSongBeat;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#define EXPLANATION_TEXT THEME->GetMetric (m_sName,"ExplanationText")
|
||||
#define HELP_TEXT THEME->GetMetric (m_sName,"HelpText")
|
||||
|
||||
const ScreenMessage SM_RefreshSelector = (ScreenMessage)(SM_User+1);
|
||||
const AutoScreenMessage SM_RefreshSelector;
|
||||
|
||||
REGISTER_SCREEN_CLASS( ScreenEditCoursesMenu );
|
||||
ScreenEditCoursesMenu::ScreenEditCoursesMenu( CString sName ) : ScreenWithMenuElements( sName )
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
#define PREV_SCREEN THEME->GetMetric(m_sName,"PrevScreen")
|
||||
#define EXPLANATION_TEXT( row ) THEME->GetMetric(m_sName,"Explanation"+EditMenuRowToString(row))
|
||||
|
||||
const ScreenMessage SM_RefreshSelector = (ScreenMessage)(SM_User+1);
|
||||
const ScreenMessage SM_BackFromEditDescription = (ScreenMessage)(SM_User+2);
|
||||
const AutoScreenMessage SM_RefreshSelector;
|
||||
const AutoScreenMessage SM_BackFromEditDescription;
|
||||
|
||||
REGISTER_SCREEN_CLASS( ScreenEditMenu );
|
||||
ScreenEditMenu::ScreenEditMenu( CString sName ) : ScreenWithMenuElements( sName )
|
||||
@@ -74,32 +74,35 @@ void DeleteCurSteps( void* pThrowAway )
|
||||
|
||||
void ScreenEditMenu::HandleScreenMessage( const ScreenMessage SM )
|
||||
{
|
||||
switch( SM )
|
||||
if( SM == SM_RefreshSelector )
|
||||
{
|
||||
case SM_RefreshSelector:
|
||||
m_Selector.RefreshAll();
|
||||
RefreshNumStepsLoadedFromProfile();
|
||||
break;
|
||||
case SM_GoToPrevScreen:
|
||||
}
|
||||
else if( SM == SM_GoToPrevScreen )
|
||||
{
|
||||
SCREENMAN->SetNewScreen( PREV_SCREEN );
|
||||
break;
|
||||
case SM_GoToNextScreen:
|
||||
}
|
||||
else if( SM == SM_GoToNextScreen )
|
||||
{
|
||||
SCREENMAN->SetNewScreen( "ScreenEdit" );
|
||||
break;
|
||||
case SM_Success:
|
||||
}
|
||||
else if( SM == SM_Success )
|
||||
{
|
||||
LOG->Trace( "Delete successful; deleting steps from memory" );
|
||||
DeleteCurSteps( NULL );
|
||||
break;
|
||||
case SM_Failure:
|
||||
}
|
||||
else if( SM == SM_Failure )
|
||||
{
|
||||
LOG->Trace( "Delete failed; not deleting steps" );
|
||||
break;
|
||||
case SM_BackFromEditDescription:
|
||||
}
|
||||
else if( SM == SM_BackFromEditDescription )
|
||||
{
|
||||
if( !ScreenTextEntry::s_bCancelledLast )
|
||||
{
|
||||
SOUND->StopMusic();
|
||||
StartTransitioning( SM_GoToNextScreen );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
#include "Transition.h"
|
||||
|
||||
// Sent to ScreenGameplay so it can keep all it's data ready for when we resume play.
|
||||
const ScreenMessage SM_BreakInitiated = ScreenMessage(SM_User+100);
|
||||
const ScreenMessage SM_BreakCompleted = ScreenMessage(SM_User+101);
|
||||
const AutoScreenMessage SM_BreakInitiated;
|
||||
const AutoScreenMessage SM_BreakCompleted;
|
||||
|
||||
class ScreenEndlessBreak : public Screen
|
||||
{
|
||||
|
||||
@@ -83,8 +83,8 @@ const char* STATS_STRING[NUM_STATS_LINES] =
|
||||
|
||||
static const int NUM_SHOWN_RADAR_CATEGORIES = 5;
|
||||
|
||||
const ScreenMessage SM_PlayCheer = ScreenMessage(SM_User+6);
|
||||
const ScreenMessage SM_AddBonus = ScreenMessage(SM_User+7);
|
||||
const AutoScreenMessage SM_PlayCheer;
|
||||
const AutoScreenMessage SM_AddBonus;
|
||||
|
||||
|
||||
REGISTER_SCREEN_CLASS( ScreenEvaluation );
|
||||
@@ -1349,12 +1349,11 @@ void ScreenEvaluation::Input( const DeviceInput& DeviceI, const InputEventType t
|
||||
|
||||
void ScreenEvaluation::HandleScreenMessage( const ScreenMessage SM )
|
||||
{
|
||||
switch( SM )
|
||||
if( SM == SM_MenuTimer )
|
||||
{
|
||||
case SM_MenuTimer:
|
||||
EndScreen();
|
||||
break;
|
||||
case SM_GoToNextScreen:
|
||||
}
|
||||
else if( SM == SM_GoToNextScreen )
|
||||
{
|
||||
if( GAMESTATE->GetEventMode() )
|
||||
{
|
||||
@@ -1369,7 +1368,7 @@ void ScreenEvaluation::HandleScreenMessage( const ScreenMessage SM )
|
||||
if( bReallyFailed )
|
||||
{
|
||||
SCREENMAN->SetNewScreen( FAILED_SCREEN );
|
||||
break;
|
||||
return;
|
||||
}
|
||||
|
||||
/* We passed. If we have another stage to play, go to NEXT_SCREEN. */
|
||||
@@ -1396,12 +1395,13 @@ void ScreenEvaluation::HandleScreenMessage( const ScreenMessage SM )
|
||||
|
||||
if( m_sndPassFail.IsPlaying() )
|
||||
m_sndPassFail.Stop();
|
||||
break;
|
||||
}
|
||||
case SM_PlayCheer:
|
||||
else if( SM == SM_PlayCheer )
|
||||
{
|
||||
SOUND->PlayOnceFromDir( ANNOUNCER->GetPathTo("evaluation cheer") );
|
||||
break;
|
||||
case SM_AddBonus:
|
||||
}
|
||||
else if( SM == SM_AddBonus )
|
||||
{
|
||||
FOREACH_EnabledPlayer( p )
|
||||
{
|
||||
if( STATSMAN->m_CurStageStats.m_player[p].iBonus == 0 )
|
||||
@@ -1421,7 +1421,6 @@ void ScreenEvaluation::HandleScreenMessage( const ScreenMessage SM )
|
||||
if( SHOW_SCORE_AREA )
|
||||
m_textScore[p].SetText( ssprintf("%*.0i", NUM_SCORE_DIGITS, STATSMAN->m_CurStageStats.m_player[p].iScore) );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
|
||||
const float TWEEN_TIME = 0.5f;
|
||||
|
||||
const ScreenMessage SM_NoSongs = ScreenMessage(SM_User+3);
|
||||
const AutoScreenMessage SM_NoSongs;
|
||||
|
||||
REGISTER_SCREEN_CLASS( ScreenEz2SelectMusic );
|
||||
ScreenEz2SelectMusic::ScreenEz2SelectMusic( CString sName ) : ScreenWithMenuElements( sName )
|
||||
@@ -371,12 +371,12 @@ void ScreenEz2SelectMusic::HandleScreenMessage( const ScreenMessage SM )
|
||||
{
|
||||
Screen::HandleScreenMessage( SM );
|
||||
|
||||
switch( SM )
|
||||
if( SM == SM_GoToPrevScreen )
|
||||
{
|
||||
case SM_GoToPrevScreen:
|
||||
SCREENMAN->SetNewScreen( PREV_SCREEN );
|
||||
break;
|
||||
case SM_GoToNextScreen:
|
||||
}
|
||||
else if( SM == SM_GoToNextScreen )
|
||||
{
|
||||
if( m_bGoToOptions )
|
||||
{
|
||||
SCREENMAN->SetNewScreen( "ScreenPlayerOptions" );
|
||||
@@ -386,12 +386,11 @@ void ScreenEz2SelectMusic::HandleScreenMessage( const ScreenMessage SM )
|
||||
SOUND->StopMusic();
|
||||
SCREENMAN->SetNewScreen( "ScreenStage" );
|
||||
}
|
||||
break;
|
||||
case SM_NoSongs:
|
||||
SCREENMAN->SetNewScreen( PREV_SCREEN );
|
||||
break;
|
||||
}
|
||||
|
||||
else if( SM == SM_NoSongs )
|
||||
{
|
||||
SCREENMAN->SetNewScreen( PREV_SCREEN );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
+211
-247
@@ -43,7 +43,6 @@
|
||||
#include "ScreenDimensions.h"
|
||||
#include "ThemeMetric.h"
|
||||
#include "PlayerState.h"
|
||||
#include "GameplayMessages.h"
|
||||
#include "Style.h"
|
||||
#include "LuaManager.h"
|
||||
#include "MemoryCardManager.h"
|
||||
@@ -66,23 +65,24 @@ static ThemeMetric<float> SECONDS_BETWEEN_COMMENTS ("ScreenGameplay","SecondsBet
|
||||
/* Global, so it's accessible from ShowSavePrompt: */
|
||||
static float g_fOldOffset; // used on offset screen to calculate difference
|
||||
|
||||
const ScreenMessage SM_PlayReady = ScreenMessage(SM_User+0);
|
||||
const ScreenMessage SM_PlayGo = ScreenMessage(SM_User+1);
|
||||
|
||||
const AutoScreenMessage SM_PlayReady;
|
||||
const AutoScreenMessage SM_PlayGo;
|
||||
|
||||
// received while STATE_DANCING
|
||||
const ScreenMessage SM_LoadNextSong = ScreenMessage(SM_User+11);
|
||||
const ScreenMessage SM_StartLoadingNextSong = ScreenMessage(SM_User+12);
|
||||
const AutoScreenMessage SM_NotesEnded;
|
||||
const AutoScreenMessage SM_LoadNextSong;
|
||||
const AutoScreenMessage SM_StartLoadingNextSong;
|
||||
|
||||
|
||||
// received while STATE_OUTRO
|
||||
const ScreenMessage SM_SaveChangedBeforeGoingBack = ScreenMessage(SM_User+20);
|
||||
const ScreenMessage SM_GoToScreenAfterBack = ScreenMessage(SM_User+21);
|
||||
const AutoScreenMessage SM_SaveChangedBeforeGoingBack;
|
||||
const AutoScreenMessage SM_GoToScreenAfterBack;
|
||||
|
||||
const ScreenMessage SM_BeginFailed = ScreenMessage(SM_User+30);
|
||||
const AutoScreenMessage SM_BeginFailed;
|
||||
|
||||
// received while STATE_INTRO
|
||||
const ScreenMessage SM_StartHereWeGo = ScreenMessage(SM_User+40);
|
||||
const ScreenMessage SM_StopHereWeGo = ScreenMessage(SM_User+41);
|
||||
const AutoScreenMessage SM_StartHereWeGo;
|
||||
const AutoScreenMessage SM_StopHereWeGo;
|
||||
|
||||
static Preference<float> g_fNetStartOffset( Options, "NetworkStartOffset", -3.0 );
|
||||
|
||||
@@ -2088,14 +2088,13 @@ void ScreenGameplay::StageFinished( bool bBackedOut )
|
||||
void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
|
||||
{
|
||||
CHECKPOINT_M( ssprintf("HandleScreenMessage(%i)", SM) );
|
||||
switch( SM )
|
||||
if( SM == SM_PlayReady )
|
||||
{
|
||||
case SM_PlayReady:
|
||||
SOUND->PlayOnceFromAnnouncer( "gameplay ready" );
|
||||
m_Ready.StartTransitioning( SM_PlayGo );
|
||||
break;
|
||||
|
||||
case SM_PlayGo:
|
||||
}
|
||||
else if( SM == SM_PlayGo )
|
||||
{
|
||||
if( GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2() )
|
||||
SOUND->PlayOnceFromAnnouncer( "gameplay here we go extra" );
|
||||
else if( GAMESTATE->IsFinalStage() )
|
||||
@@ -2106,158 +2105,152 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
|
||||
m_Go.StartTransitioning( SM_None );
|
||||
GAMESTATE->m_bPastHereWeGo = true;
|
||||
m_DancingState = STATE_DANCING; // STATE CHANGE! Now the user is allowed to press Back
|
||||
break;
|
||||
}
|
||||
else if( SM == SM_NotesEnded ) // received while STATE_DANCING
|
||||
{
|
||||
/* Do this in LoadNextSong, so we don't tween off old attacks until
|
||||
* m_NextSong finishes. */
|
||||
// GAMESTATE->RemoveAllActiveAttacks();
|
||||
|
||||
// received while STATE_DANCING
|
||||
case SM_NotesEnded:
|
||||
FOREACH_EnabledPlayer(p)
|
||||
{
|
||||
/* Do this in LoadNextSong, so we don't tween off old attacks until
|
||||
* m_NextSong finishes. */
|
||||
// GAMESTATE->RemoveAllActiveAttacks();
|
||||
|
||||
FOREACH_EnabledPlayer(p)
|
||||
/* If either player's passmark is enabled, check it. */
|
||||
if( GAMESTATE->m_pPlayerState[p]->m_PlayerOptions.m_fPassmark > 0 &&
|
||||
m_pLifeMeter[p] &&
|
||||
m_pLifeMeter[p]->GetLife() < GAMESTATE->m_pPlayerState[p]->m_PlayerOptions.m_fPassmark )
|
||||
{
|
||||
/* If either player's passmark is enabled, check it. */
|
||||
if( GAMESTATE->m_pPlayerState[p]->m_PlayerOptions.m_fPassmark > 0 &&
|
||||
m_pLifeMeter[p] &&
|
||||
m_pLifeMeter[p]->GetLife() < GAMESTATE->m_pPlayerState[p]->m_PlayerOptions.m_fPassmark )
|
||||
{
|
||||
LOG->Trace("Player %i failed: life %f is under %f",
|
||||
p+1, m_pLifeMeter[p]->GetLife(), GAMESTATE->m_pPlayerState[p]->m_PlayerOptions.m_fPassmark );
|
||||
STATSMAN->m_CurStageStats.m_player[p].bFailed = true;
|
||||
}
|
||||
|
||||
/* Mark failure. This hasn't been done yet if m_bTwoPlayerRecovery is set. */
|
||||
if( GAMESTATE->m_SongOptions.m_FailType != SongOptions::FAIL_OFF &&
|
||||
(m_pLifeMeter[p] && m_pLifeMeter[p]->IsFailing()) ||
|
||||
(m_pCombinedLifeMeter && m_pCombinedLifeMeter->IsFailing(p)) )
|
||||
STATSMAN->m_CurStageStats.m_player[p].bFailed = true;
|
||||
|
||||
if( !STATSMAN->m_CurStageStats.m_player[p].bFailed )
|
||||
STATSMAN->m_CurStageStats.m_player[p].iSongsPassed++;
|
||||
LOG->Trace("Player %i failed: life %f is under %f",
|
||||
p+1, m_pLifeMeter[p]->GetLife(), GAMESTATE->m_pPlayerState[p]->m_PlayerOptions.m_fPassmark );
|
||||
STATSMAN->m_CurStageStats.m_player[p].bFailed = true;
|
||||
}
|
||||
|
||||
/* If all players have *really* failed (bFailed, not the life meter or
|
||||
* bFailedEarlier): */
|
||||
const bool bAllReallyFailed = STATSMAN->m_CurStageStats.AllFailed();
|
||||
/* Mark failure. This hasn't been done yet if m_bTwoPlayerRecovery is set. */
|
||||
if( GAMESTATE->m_SongOptions.m_FailType != SongOptions::FAIL_OFF &&
|
||||
(m_pLifeMeter[p] && m_pLifeMeter[p]->IsFailing()) ||
|
||||
(m_pCombinedLifeMeter && m_pCombinedLifeMeter->IsFailing(p)) )
|
||||
STATSMAN->m_CurStageStats.m_player[p].bFailed = true;
|
||||
|
||||
if( !bAllReallyFailed && !IsLastSong() )
|
||||
{
|
||||
/* Load the next course song. First, fade out and stop the music. */
|
||||
float fFadeLengthSeconds = MUSIC_FADE_OUT_SECONDS;
|
||||
RageSoundParams p = m_pSoundMusic->GetParams();
|
||||
p.m_FadeLength = fFadeLengthSeconds;
|
||||
p.m_LengthSeconds = GAMESTATE->m_fMusicSeconds + fFadeLengthSeconds;
|
||||
m_pSoundMusic->SetParams(p);
|
||||
if( !STATSMAN->m_CurStageStats.m_player[p].bFailed )
|
||||
STATSMAN->m_CurStageStats.m_player[p].iSongsPassed++;
|
||||
}
|
||||
|
||||
SCREENMAN->PostMessageToTopScreen( SM_StartLoadingNextSong, fFadeLengthSeconds );
|
||||
return;
|
||||
}
|
||||
/* If all players have *really* failed (bFailed, not the life meter or
|
||||
* bFailedEarlier): */
|
||||
const bool bAllReallyFailed = STATSMAN->m_CurStageStats.AllFailed();
|
||||
|
||||
// update dancing characters for win / lose
|
||||
DancingCharacters *Dancers = m_SongBackground.GetDancingCharacters();
|
||||
if( Dancers )
|
||||
|
||||
if( !bAllReallyFailed && !IsLastSong() )
|
||||
{
|
||||
/* Load the next course song. First, fade out and stop the music. */
|
||||
float fFadeLengthSeconds = MUSIC_FADE_OUT_SECONDS;
|
||||
RageSoundParams p = m_pSoundMusic->GetParams();
|
||||
p.m_FadeLength = fFadeLengthSeconds;
|
||||
p.m_LengthSeconds = GAMESTATE->m_fMusicSeconds + fFadeLengthSeconds;
|
||||
m_pSoundMusic->SetParams(p);
|
||||
SCREENMAN->PostMessageToTopScreen( SM_StartLoadingNextSong, fFadeLengthSeconds );
|
||||
return;
|
||||
}
|
||||
|
||||
// update dancing characters for win / lose
|
||||
DancingCharacters *Dancers = m_SongBackground.GetDancingCharacters();
|
||||
if( Dancers )
|
||||
FOREACH_EnabledPlayer(p)
|
||||
{
|
||||
/* XXX: In battle modes, switch( GAMESTATE->GetStageResult(p) ). */
|
||||
if( STATSMAN->m_CurStageStats.m_player[p].bFailed )
|
||||
Dancers->Change2DAnimState( p, AS2D_FAIL ); // fail anim
|
||||
else if( m_pLifeMeter[p] && m_pLifeMeter[p]->GetLife() == 1.0f ) // full life
|
||||
Dancers->Change2DAnimState( p, AS2D_WINFEVER ); // full life pass anim
|
||||
else
|
||||
Dancers->Change2DAnimState( p, AS2D_WIN ); // pass anim
|
||||
}
|
||||
|
||||
/* End round. */
|
||||
if( m_DancingState == STATE_OUTRO ) // ScreenGameplay already ended
|
||||
return; // ignore
|
||||
m_DancingState = STATE_OUTRO;
|
||||
AbortGiveUp( false );
|
||||
|
||||
GAMESTATE->RemoveAllActiveAttacks();
|
||||
FOREACH_EnabledPlayer( p )
|
||||
m_ActiveAttackList[p].Refresh();
|
||||
|
||||
LIGHTSMAN->SetLightsMode( LIGHTSMODE_ALL_CLEARED );
|
||||
|
||||
|
||||
if( bAllReallyFailed )
|
||||
{
|
||||
this->PostScreenMessage( SM_BeginFailed, 0 );
|
||||
return;
|
||||
}
|
||||
|
||||
// do they deserve an extra stage?
|
||||
if( GAMESTATE->HasEarnedExtraStage() )
|
||||
{
|
||||
TweenOffScreen();
|
||||
m_Extra.StartTransitioning( SM_GoToNextScreen );
|
||||
SOUND->PlayOnceFromAnnouncer( "gameplay extra" );
|
||||
}
|
||||
else
|
||||
{
|
||||
TweenOffScreen();
|
||||
|
||||
switch( GAMESTATE->m_PlayMode )
|
||||
{
|
||||
case PLAY_MODE_BATTLE:
|
||||
case PLAY_MODE_RAVE:
|
||||
{
|
||||
PlayerNumber winner = GAMESTATE->GetBestPlayer();
|
||||
switch( winner )
|
||||
{
|
||||
case PLAYER_INVALID:
|
||||
m_Draw.StartTransitioning( SM_GoToNextScreen );
|
||||
break;
|
||||
default:
|
||||
m_Win[winner].StartTransitioning( SM_GoToNextScreen );
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
m_Cleared.StartTransitioning( SM_GoToNextScreen );
|
||||
break;
|
||||
}
|
||||
|
||||
SOUND->PlayOnceFromAnnouncer( "gameplay cleared" );
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case SM_StartLoadingNextSong:
|
||||
{
|
||||
m_pSoundMusic->Stop();
|
||||
|
||||
/* Next song. */
|
||||
FOREACH_EnabledPlayer(p)
|
||||
{
|
||||
if( !STATSMAN->m_CurStageStats.m_player[p].bFailed )
|
||||
{
|
||||
// give a little life back between stages
|
||||
if( m_pLifeMeter[p] )
|
||||
m_pLifeMeter[p]->OnSongEnded();
|
||||
if( m_pCombinedLifeMeter )
|
||||
m_pCombinedLifeMeter->OnSongEnded();
|
||||
}
|
||||
}
|
||||
|
||||
int iPlaySongIndex = GAMESTATE->GetCourseSongIndex()+1;
|
||||
iPlaySongIndex %= m_apSongsQueue.size();
|
||||
m_apSongsQueue[iPlaySongIndex]->PushSelf( LUA->L );
|
||||
GAMESTATE->m_Environment->Set( "NextSong" );
|
||||
MESSAGEMAN->Broadcast( "NextCourseSong" );
|
||||
GAMESTATE->m_Environment->Unset( "NextSong" );
|
||||
|
||||
m_NextSong.PlayCommand( "Start" );
|
||||
m_NextSong.Reset();
|
||||
m_NextSong.StartTransitioning( SM_LoadNextSong );
|
||||
LoadCourseSongNumber( GAMESTATE->GetCourseSongIndex()+1 );
|
||||
COMMAND( m_sprCourseSongNumber, "ChangeIn" );
|
||||
/* XXX: In battle modes, switch( GAMESTATE->GetStageResult(p) ). */
|
||||
if( STATSMAN->m_CurStageStats.m_player[p].bFailed )
|
||||
Dancers->Change2DAnimState( p, AS2D_FAIL ); // fail anim
|
||||
else if( m_pLifeMeter[p] && m_pLifeMeter[p]->GetLife() == 1.0f ) // full life
|
||||
Dancers->Change2DAnimState( p, AS2D_WINFEVER ); // full life pass anim
|
||||
else
|
||||
Dancers->Change2DAnimState( p, AS2D_WIN ); // pass anim
|
||||
}
|
||||
break;
|
||||
|
||||
case SM_LoadNextSong:
|
||||
/* End round. */
|
||||
if( m_DancingState == STATE_OUTRO ) // ScreenGameplay already ended
|
||||
return; // ignore
|
||||
m_DancingState = STATE_OUTRO;
|
||||
AbortGiveUp( false );
|
||||
|
||||
GAMESTATE->RemoveAllActiveAttacks();
|
||||
FOREACH_EnabledPlayer( p )
|
||||
m_ActiveAttackList[p].Refresh();
|
||||
|
||||
LIGHTSMAN->SetLightsMode( LIGHTSMODE_ALL_CLEARED );
|
||||
|
||||
|
||||
if( bAllReallyFailed )
|
||||
{
|
||||
this->PostScreenMessage( SM_BeginFailed, 0 );
|
||||
return;
|
||||
}
|
||||
|
||||
// do they deserve an extra stage?
|
||||
if( GAMESTATE->HasEarnedExtraStage() )
|
||||
{
|
||||
TweenOffScreen();
|
||||
m_Extra.StartTransitioning( SM_GoToNextScreen );
|
||||
SOUND->PlayOnceFromAnnouncer( "gameplay extra" );
|
||||
}
|
||||
else
|
||||
{
|
||||
TweenOffScreen();
|
||||
|
||||
switch( GAMESTATE->m_PlayMode )
|
||||
{
|
||||
case PLAY_MODE_BATTLE:
|
||||
case PLAY_MODE_RAVE:
|
||||
{
|
||||
PlayerNumber winner = GAMESTATE->GetBestPlayer();
|
||||
switch( winner )
|
||||
{
|
||||
case PLAYER_INVALID:
|
||||
m_Draw.StartTransitioning( SM_GoToNextScreen );
|
||||
break;
|
||||
default:
|
||||
m_Win[winner].StartTransitioning( SM_GoToNextScreen );
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
m_Cleared.StartTransitioning( SM_GoToNextScreen );
|
||||
break;
|
||||
}
|
||||
|
||||
SOUND->PlayOnceFromAnnouncer( "gameplay cleared" );
|
||||
}
|
||||
}
|
||||
else if( SM == SM_StartLoadingNextSong )
|
||||
{
|
||||
m_pSoundMusic->Stop();
|
||||
|
||||
/* Next song. */
|
||||
FOREACH_EnabledPlayer(p)
|
||||
{
|
||||
if( !STATSMAN->m_CurStageStats.m_player[p].bFailed )
|
||||
{
|
||||
// give a little life back between stages
|
||||
if( m_pLifeMeter[p] )
|
||||
m_pLifeMeter[p]->OnSongEnded();
|
||||
if( m_pCombinedLifeMeter )
|
||||
m_pCombinedLifeMeter->OnSongEnded();
|
||||
}
|
||||
}
|
||||
|
||||
int iPlaySongIndex = GAMESTATE->GetCourseSongIndex()+1;
|
||||
iPlaySongIndex %= m_apSongsQueue.size();
|
||||
m_apSongsQueue[iPlaySongIndex]->PushSelf( LUA->L );
|
||||
GAMESTATE->m_Environment->Set( "NextSong" );
|
||||
MESSAGEMAN->Broadcast( "NextCourseSong" );
|
||||
GAMESTATE->m_Environment->Unset( "NextSong" );
|
||||
m_NextSong.PlayCommand( "Start" );
|
||||
m_NextSong.Reset();
|
||||
m_NextSong.StartTransitioning( SM_LoadNextSong );
|
||||
LoadCourseSongNumber( GAMESTATE->GetCourseSongIndex()+1 );
|
||||
COMMAND( m_sprCourseSongNumber, "ChangeIn" );
|
||||
}
|
||||
else if( SM == SM_LoadNextSong )
|
||||
{
|
||||
SongFinished();
|
||||
|
||||
COMMAND( m_sprCourseSongNumber, "ChangeOut" );
|
||||
@@ -2272,86 +2265,57 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
|
||||
/* We're fading in, so don't hit any notes for a few seconds; they'll be
|
||||
* obscured by the fade. */
|
||||
StartPlayingSong( m_NextSong.GetLengthSeconds()+2, 0 );
|
||||
break;
|
||||
|
||||
case SM_PlayToasty:
|
||||
}
|
||||
else if( SM == SM_PlayToasty )
|
||||
{
|
||||
if( PREFSMAN->m_bEasterEggs )
|
||||
if( !m_Toasty.IsTransitioning() && !m_Toasty.IsFinished() ) // don't play if we've already played it once
|
||||
m_Toasty.StartTransitioning();
|
||||
break;
|
||||
|
||||
#define SECS_SINCE_LAST_COMMENT (SECONDS_BETWEEN_COMMENTS-m_fTimeLeftBeforeDancingComment)
|
||||
case SM_100Combo:
|
||||
PlayAnnouncer( "gameplay 100 combo", 2 );
|
||||
break;
|
||||
case SM_200Combo:
|
||||
PlayAnnouncer( "gameplay 200 combo", 2 );
|
||||
break;
|
||||
case SM_300Combo:
|
||||
PlayAnnouncer( "gameplay 300 combo", 2 );
|
||||
break;
|
||||
case SM_400Combo:
|
||||
PlayAnnouncer( "gameplay 400 combo", 2 );
|
||||
break;
|
||||
case SM_500Combo:
|
||||
PlayAnnouncer( "gameplay 500 combo", 2 );
|
||||
break;
|
||||
case SM_600Combo:
|
||||
PlayAnnouncer( "gameplay 600 combo", 2 );
|
||||
break;
|
||||
case SM_700Combo:
|
||||
PlayAnnouncer( "gameplay 700 combo", 2 );
|
||||
break;
|
||||
case SM_800Combo:
|
||||
PlayAnnouncer( "gameplay 800 combo", 2 );
|
||||
break;
|
||||
case SM_900Combo:
|
||||
PlayAnnouncer( "gameplay 900 combo", 2 );
|
||||
break;
|
||||
case SM_1000Combo:
|
||||
PlayAnnouncer( "gameplay 1000 combo", 2 );
|
||||
break;
|
||||
case SM_ComboStopped:
|
||||
}
|
||||
else if( SM >= SM_100Combo && SM <= SM_1000Combo )
|
||||
{
|
||||
int iCombo = (SM-SM_100Combo+1)*100;
|
||||
PlayAnnouncer( ssprintf("gameplay %d combo",iCombo), 2 );
|
||||
}
|
||||
else if( SM == SM_ComboStopped )
|
||||
{
|
||||
PlayAnnouncer( "gameplay combo stopped", 2 );
|
||||
break;
|
||||
case SM_ComboContinuing:
|
||||
}
|
||||
else if( SM == SM_ComboContinuing )
|
||||
{
|
||||
PlayAnnouncer( "gameplay combo overflow", 2 );
|
||||
break;
|
||||
case SM_BattleTrickLevel1:
|
||||
PlayAnnouncer( "gameplay battle trick level1", 3 );
|
||||
m_soundBattleTrickLevel1.Play();
|
||||
break;
|
||||
case SM_BattleTrickLevel2:
|
||||
PlayAnnouncer( "gameplay battle trick level2", 3 );
|
||||
m_soundBattleTrickLevel2.Play();
|
||||
break;
|
||||
case SM_BattleTrickLevel3:
|
||||
PlayAnnouncer( "gameplay battle trick level3", 3 );
|
||||
m_soundBattleTrickLevel3.Play();
|
||||
break;
|
||||
|
||||
case SM_BattleDamageLevel1:
|
||||
PlayAnnouncer( "gameplay battle damage level1", 3 );
|
||||
break;
|
||||
case SM_BattleDamageLevel2:
|
||||
PlayAnnouncer( "gameplay battle damage level2", 3 );
|
||||
break;
|
||||
case SM_BattleDamageLevel3:
|
||||
PlayAnnouncer( "gameplay battle damage level3", 3 );
|
||||
break;
|
||||
|
||||
case SM_SaveChangedBeforeGoingBack:
|
||||
}
|
||||
else if( SM >= SM_BattleTrickLevel1 && SM <= SM_BattleTrickLevel3 )
|
||||
{
|
||||
int iTrickLevel = SM-SM_BattleTrickLevel1+1;
|
||||
PlayAnnouncer( ssprintf("gameplay battle trick level%d",iTrickLevel), 3 );
|
||||
switch( SM )
|
||||
{
|
||||
case SM_BattleTrickLevel1: m_soundBattleTrickLevel1.Play(); break;
|
||||
case SM_BattleTrickLevel2: m_soundBattleTrickLevel2.Play(); break;
|
||||
case SM_BattleTrickLevel3: m_soundBattleTrickLevel3.Play(); break;
|
||||
default: ASSERT(0);
|
||||
}
|
||||
}
|
||||
else if( SM >= SM_BattleDamageLevel1 && SM <= SM_BattleDamageLevel3 )
|
||||
{
|
||||
int iDamageLevel = SM-SM_BattleDamageLevel1+1;
|
||||
PlayAnnouncer( ssprintf("gameplay battle damage level%d",iDamageLevel), 3 );
|
||||
}
|
||||
else if( SM == SM_SaveChangedBeforeGoingBack )
|
||||
{
|
||||
if( m_bChangedOffsetOrBPM )
|
||||
{
|
||||
m_bChangedOffsetOrBPM = false;
|
||||
ShowSavePrompt( SM_GoToScreenAfterBack );
|
||||
break;
|
||||
}
|
||||
|
||||
HandleScreenMessage( SM_GoToScreenAfterBack );
|
||||
break;
|
||||
|
||||
case SM_GoToScreenAfterBack:
|
||||
else
|
||||
{
|
||||
HandleScreenMessage( SM_GoToScreenAfterBack );
|
||||
}
|
||||
}
|
||||
else if( SM == SM_GoToScreenAfterBack )
|
||||
{
|
||||
SongFinished();
|
||||
StageFinished( true );
|
||||
|
||||
@@ -2359,28 +2323,29 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
|
||||
|
||||
SCREENMAN->DeletePreparedScreens();
|
||||
SCREENMAN->SetNewScreen( PREV_SCREEN );
|
||||
break;
|
||||
|
||||
case SM_GoToNextScreen:
|
||||
}
|
||||
else if( SM == SM_GoToNextScreen )
|
||||
{
|
||||
if( m_bChangedOffsetOrBPM )
|
||||
{
|
||||
m_bChangedOffsetOrBPM = false;
|
||||
ShowSavePrompt( SM_GoToNextScreen );
|
||||
break;
|
||||
}
|
||||
|
||||
SongFinished();
|
||||
StageFinished( false );
|
||||
else
|
||||
{
|
||||
SongFinished();
|
||||
StageFinished( false );
|
||||
|
||||
SCREENMAN->SetNewScreen( NEXT_SCREEN );
|
||||
break;
|
||||
|
||||
case SM_LoseFocus:
|
||||
SCREENMAN->SetNewScreen( NEXT_SCREEN );
|
||||
}
|
||||
}
|
||||
else if( SM == SM_LoseFocus )
|
||||
{
|
||||
/* We might have turned the song timer off. Be sure to turn it back on. */
|
||||
SOUND->HandleSongTimer( true );
|
||||
break;
|
||||
|
||||
case SM_BeginFailed:
|
||||
}
|
||||
else if( SM == SM_BeginFailed )
|
||||
{
|
||||
m_DancingState = STATE_OUTRO;
|
||||
AbortGiveUp( false );
|
||||
m_pSoundMusic->StopPlaying();
|
||||
@@ -2406,20 +2371,19 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
|
||||
SOUND->PlayOnceFromAnnouncer( "gameplay oni failed" );
|
||||
else
|
||||
SOUND->PlayOnceFromAnnouncer( "gameplay failed" );
|
||||
break;
|
||||
|
||||
case SM_StopMusic:
|
||||
}
|
||||
else if( SM == SM_StopMusic )
|
||||
{
|
||||
m_pSoundMusic->Stop();
|
||||
break;
|
||||
|
||||
case SM_Pause:
|
||||
}
|
||||
else if( SM == SM_Pause )
|
||||
{
|
||||
/* Ignore SM_Pause when in demonstration. */
|
||||
if( GAMESTATE->m_bDemonstrationOrJukebox )
|
||||
return;
|
||||
|
||||
if( !m_bPaused )
|
||||
PauseGame( true );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ class Inventory;
|
||||
#include "AutoKeysounds.h"
|
||||
#include "ThemeMetric.h"
|
||||
|
||||
const ScreenMessage SM_NotesEnded = ScreenMessage(SM_User+10);
|
||||
extern const AutoScreenMessage SM_NotesEnded;
|
||||
|
||||
class LyricsLoader;
|
||||
class ScreenGameplay : public Screen
|
||||
|
||||
@@ -29,12 +29,12 @@
|
||||
|
||||
|
||||
// received while STATE_DANCING
|
||||
const ScreenMessage SM_NotesEnded = ScreenMessage(SM_User+10);
|
||||
const AutoScreenMessage SM_NotesEnded;
|
||||
|
||||
const ScreenMessage SM_Ready = ScreenMessage(SM_User+12);
|
||||
const AutoScreenMessage SM_Ready;
|
||||
|
||||
const ScreenMessage SM_GoToStateAfterCleared= ScreenMessage(SM_User+22);
|
||||
const ScreenMessage SM_GoToScreenAfterBack = ScreenMessage(SM_User+23);
|
||||
const AutoScreenMessage SM_GoToStateAfterCleared;
|
||||
const AutoScreenMessage SM_GoToScreenAfterBack;
|
||||
|
||||
|
||||
REGISTER_SCREEN_CLASS( ScreenGameplayMultiplayer );
|
||||
@@ -606,30 +606,28 @@ void ScreenGameplayMultiplayer::StageFinished( bool bBackedOut )
|
||||
void ScreenGameplayMultiplayer::HandleScreenMessage( const ScreenMessage SM )
|
||||
{
|
||||
CHECKPOINT_M( ssprintf("HandleScreenMessage(%i)", SM) );
|
||||
switch( SM )
|
||||
if( SM == SM_Ready )
|
||||
{
|
||||
case SM_Ready:
|
||||
GAMESTATE->m_bPastHereWeGo = true;
|
||||
break;
|
||||
|
||||
case SM_NotesEnded:
|
||||
}
|
||||
else if( SM == SM_NotesEnded )
|
||||
{
|
||||
m_Out.StartTransitioning( SM_GoToStateAfterCleared );
|
||||
break;
|
||||
|
||||
case SM_GoToScreenAfterBack:
|
||||
}
|
||||
else if( SM == SM_GoToScreenAfterBack )
|
||||
{
|
||||
StageFinished( true );
|
||||
|
||||
GAMESTATE->CancelStage();
|
||||
|
||||
SCREENMAN->DeletePreparedScreens();
|
||||
SCREENMAN->SetNewScreen( PREV_SCREEN );
|
||||
break;
|
||||
|
||||
case SM_GoToStateAfterCleared:
|
||||
}
|
||||
else if( SM == SM_GoToStateAfterCleared )
|
||||
{
|
||||
StageFinished( false );
|
||||
|
||||
SCREENMAN->SetNewScreen( NEXT_SCREEN );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -220,14 +220,15 @@ void ScreenJukebox::Input( const DeviceInput& DeviceI, const InputEventType type
|
||||
|
||||
void ScreenJukebox::HandleScreenMessage( const ScreenMessage SM )
|
||||
{
|
||||
switch( SM )
|
||||
if( SM == SM_NotesEnded )
|
||||
{
|
||||
case SM_NotesEnded:
|
||||
if( m_Out.IsTransitioning() || m_Out.IsFinished() )
|
||||
return; // ignore - we're already fading or faded
|
||||
m_Out.StartTransitioning( SM_GoToNextScreen );
|
||||
return;
|
||||
case SM_GoToNextScreen:
|
||||
}
|
||||
else if( SM == SM_GoToNextScreen )
|
||||
{
|
||||
if( m_pSoundMusic )
|
||||
m_pSoundMusic->Stop();
|
||||
SCREENMAN->SetNewScreen( "ScreenJukebox" );
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
#include "global.h"
|
||||
#include "ScreenMessage.h"
|
||||
|
||||
AutoScreenMessage::AutoScreenMessage()
|
||||
{
|
||||
static int s_NextID = 100; // a value larger than all the values in the ScreenMessageEnum
|
||||
m_sm = (ScreenMessage)s_NextID;
|
||||
s_NextID++;
|
||||
}
|
||||
|
||||
/*
|
||||
* (c) 2001-2004 Chris Danford, Glenn Maynard
|
||||
* All rights reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, and/or sell copies of the Software, and to permit persons to
|
||||
* whom the Software is furnished to do so, provided that the above
|
||||
* copyright notice(s) and this permission notice appear in all copies of
|
||||
* the Software and that both the above copyright notice(s) and this
|
||||
* permission notice appear in supporting documentation.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
||||
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
|
||||
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
|
||||
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
@@ -19,7 +19,39 @@ enum ScreenMessage {
|
||||
SM_Pause,
|
||||
SM_Success,
|
||||
SM_Failure,
|
||||
SM_User = 100
|
||||
|
||||
// messages sent by Combo
|
||||
SM_PlayToasty,
|
||||
SM_100Combo,
|
||||
SM_200Combo,
|
||||
SM_300Combo,
|
||||
SM_400Combo,
|
||||
SM_500Combo,
|
||||
SM_600Combo,
|
||||
SM_700Combo,
|
||||
SM_800Combo,
|
||||
SM_900Combo,
|
||||
SM_1000Combo,
|
||||
SM_ComboStopped,
|
||||
SM_ComboContinuing,
|
||||
SM_MissComboAborted,
|
||||
|
||||
SM_BattleTrickLevel1,
|
||||
SM_BattleTrickLevel2,
|
||||
SM_BattleTrickLevel3,
|
||||
SM_BattleDamageLevel1,
|
||||
SM_BattleDamageLevel2,
|
||||
SM_BattleDamageLevel3,
|
||||
};
|
||||
|
||||
// Automatically generate a unique ScreenMessage value
|
||||
class AutoScreenMessage
|
||||
{
|
||||
public:
|
||||
AutoScreenMessage();
|
||||
operator ScreenMessage() const { return m_sm; }
|
||||
protected:
|
||||
ScreenMessage m_sm;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
#include "CommonMetrics.h"
|
||||
#include "GameState.h"
|
||||
|
||||
const ScreenMessage SM_GoToOK = (ScreenMessage)(SM_User+1);
|
||||
const ScreenMessage SM_GoToCancel = (ScreenMessage)(SM_User+2);
|
||||
const AutoScreenMessage SM_GoToOK;
|
||||
const AutoScreenMessage SM_GoToCancel;
|
||||
|
||||
int ScreenMiniMenu::s_iLastRowCode = -1;
|
||||
vector<int> ScreenMiniMenu::s_viLastAnswers;
|
||||
|
||||
@@ -36,7 +36,7 @@ static const ThemeMetric<apActorCommands> OK_INIT_COMMMAND ("ScreenNameEntryTra
|
||||
if( !actor.GetName().empty() ) \
|
||||
COMMAND( actor, command_name );
|
||||
|
||||
const ScreenMessage SM_ChangeDisplayedFeat = ScreenMessage(SM_User+0);
|
||||
const AutoScreenMessage SM_ChangeDisplayedFeat;
|
||||
|
||||
static const int CHAR_OK = -1;
|
||||
static const int CHAR_BACK = -2;
|
||||
@@ -540,24 +540,23 @@ void ScreenNameEntryTraditional::HandleScreenMessage( const ScreenMessage SM )
|
||||
{
|
||||
LOG->Trace( "ScreenNameEntryTraditional::HandleScreenMessage( %d )", SM );
|
||||
|
||||
switch( SM )
|
||||
if( SM == SM_MenuTimer )
|
||||
{
|
||||
case SM_MenuTimer:
|
||||
if( !m_Out.IsTransitioning() )
|
||||
{
|
||||
FOREACH_PlayerNumber( p )
|
||||
Finish( p );
|
||||
MenuStart( PLAYER_INVALID, IET_FIRST_PRESS );
|
||||
}
|
||||
break;
|
||||
case SM_ChangeDisplayedFeat:
|
||||
}
|
||||
else if( SM == SM_ChangeDisplayedFeat )
|
||||
{
|
||||
ChangeDisplayedFeat();
|
||||
this->PostScreenMessage( SM_ChangeDisplayedFeat, FEAT_INTERVAL );
|
||||
break;
|
||||
|
||||
case SM_GoToNextScreen:
|
||||
}
|
||||
else if( SM == SM_GoToNextScreen )
|
||||
{
|
||||
SCREENMAN->SetNewScreen( NEXT_SCREEN );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ const int NUM_SCORE_DIGITS = 9;
|
||||
|
||||
#define MAX_COMBO_NUM_DIGITS THEME->GetMetricI("ScreenEvaluation","MaxComboNumDigits")
|
||||
|
||||
const ScreenMessage SM_GotEval = ScreenMessage(SM_User+6);
|
||||
const AutoScreenMessage SM_GotEval;
|
||||
|
||||
REGISTER_SCREEN_CLASS( ScreenNetEvaluation );
|
||||
ScreenNetEvaluation::ScreenNetEvaluation (const CString & sClassName) : ScreenEvaluation( sClassName )
|
||||
@@ -124,9 +124,8 @@ void ScreenNetEvaluation::MenuDown( PlayerNumber pn, const InputEventType type )
|
||||
|
||||
void ScreenNetEvaluation::HandleScreenMessage( const ScreenMessage SM )
|
||||
{
|
||||
switch( SM )
|
||||
if( SM == SM_GotEval )
|
||||
{
|
||||
case SM_GotEval:
|
||||
m_bHasStats = true;
|
||||
|
||||
LOG->Trace("SMNETDebug:%d,%d",m_iActivePlayers,NSMAN->m_ActivePlayers);
|
||||
@@ -167,9 +166,10 @@ void ScreenNetEvaluation::HandleScreenMessage( const ScreenMessage SM )
|
||||
LOG->Trace("SMNETCheckpoint%d",i);
|
||||
}
|
||||
return; //no need to let ScreenEvaluation get ahold of this.
|
||||
case SM_GoToNextScreen:
|
||||
}
|
||||
else if( SM == SM_GoToNextScreen )
|
||||
{
|
||||
NSMAN->ReportNSSOnOff( 4 );
|
||||
break;
|
||||
}
|
||||
ScreenEvaluation::HandleScreenMessage( SM );
|
||||
}
|
||||
|
||||
@@ -21,9 +21,9 @@
|
||||
#define ROOMLOWERBOUND THEME->GetMetricF(m_sName,"RoomsLowerBound")
|
||||
#define ROOMUPPERBOUND THEME->GetMetricF(m_sName,"RoomsUpperBound")
|
||||
|
||||
const ScreenMessage SM_SMOnlinePack = ScreenMessage(SM_User+8); //Unused, but should be known
|
||||
const ScreenMessage SM_BackFromRoomName = ScreenMessage(SM_User+15);
|
||||
const ScreenMessage SM_BackFromRoomDesc = ScreenMessage(SM_User+16);
|
||||
const AutoScreenMessage SM_SMOnlinePack; // Unused, but should be known
|
||||
const AutoScreenMessage SM_BackFromRoomName;
|
||||
const AutoScreenMessage SM_BackFromRoomDesc;
|
||||
|
||||
REGISTER_SCREEN_CLASS( ScreenNetRoom );
|
||||
ScreenNetRoom::ScreenNetRoom( const CString& sName ) : ScreenNetSelectBase( sName )
|
||||
@@ -94,16 +94,18 @@ void ScreenNetRoom::Input( const DeviceInput& DeviceI, const InputEventType type
|
||||
|
||||
void ScreenNetRoom::HandleScreenMessage( const ScreenMessage SM )
|
||||
{
|
||||
switch( SM )
|
||||
if( SM == SM_GoToPrevScreen )
|
||||
{
|
||||
case SM_GoToPrevScreen:
|
||||
SCREENMAN->SetNewScreen( THEME->GetMetric (m_sName, "PrevScreen") );
|
||||
break;
|
||||
case SM_GoToNextScreen:
|
||||
}
|
||||
else if( SM == SM_GoToNextScreen )
|
||||
{
|
||||
SCREENMAN->SetNewScreen( THEME->GetMetric (m_sName, "NextScreen") );
|
||||
break;
|
||||
case SM_SMOnlinePack:
|
||||
}
|
||||
else if( SM == SM_SMOnlinePack )
|
||||
{
|
||||
if ( NSMAN->m_SMOnlinePacket.Read1() == 1 )
|
||||
{
|
||||
switch ( NSMAN->m_SMOnlinePacket.Read1() )
|
||||
{
|
||||
case 0: //Room title Change
|
||||
@@ -141,21 +143,23 @@ void ScreenNetRoom::HandleScreenMessage( const ScreenMessage SM )
|
||||
UpdateRoomsList();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SM_BackFromRoomName:
|
||||
}
|
||||
}
|
||||
else if ( SM == SM_BackFromRoomName )
|
||||
{
|
||||
if ( !ScreenTextEntry::s_bCancelledLast )
|
||||
{
|
||||
m_newRoomName = ScreenTextEntry::s_sLastAnswer;
|
||||
SCREENMAN->TextEntry( SM_BackFromRoomDesc, "Enter Room Description:", "", 255 );
|
||||
}
|
||||
break;
|
||||
case SM_BackFromRoomDesc:
|
||||
}
|
||||
else if( SM == SM_BackFromRoomDesc )
|
||||
{
|
||||
if ( !ScreenTextEntry::s_bCancelledLast )
|
||||
{
|
||||
m_newRoomDesc = ScreenTextEntry::s_sLastAnswer;
|
||||
CreateNewRoom( m_newRoomName, m_newRoomDesc);
|
||||
}
|
||||
break;
|
||||
}
|
||||
ScreenNetSelectBase::HandleScreenMessage( SM );
|
||||
}
|
||||
|
||||
@@ -25,9 +25,9 @@
|
||||
#define USERS_Y THEME->GetMetricF(m_sName,"UsersY")
|
||||
#define USERS_X THEME->GetMetricF(m_sName,"UsersX")
|
||||
|
||||
const ScreenMessage SM_AddToChat = ScreenMessage(SM_User+4);
|
||||
const ScreenMessage SM_UsersUpdate = ScreenMessage(SM_User+7);
|
||||
const ScreenMessage SM_SMOnlinePack = ScreenMessage(SM_User+8); //Unused, but should be known
|
||||
const AutoScreenMessage SM_AddToChat;
|
||||
const AutoScreenMessage SM_UsersUpdate;
|
||||
const AutoScreenMessage SM_SMOnlinePack; //Unused, but should be known
|
||||
|
||||
REGISTER_SCREEN_CLASS( ScreenNetSelectBase );
|
||||
ScreenNetSelectBase::ScreenNetSelectBase( const CString& sName ) : ScreenWithMenuElements( sName )
|
||||
@@ -179,30 +179,29 @@ void ScreenNetSelectBase::Input( const DeviceInput& DeviceI, const InputEventTyp
|
||||
void ScreenNetSelectBase::HandleScreenMessage( const ScreenMessage SM )
|
||||
{
|
||||
Screen::HandleScreenMessage( SM );
|
||||
switch( SM )
|
||||
|
||||
if( SM == SM_GoToPrevScreen )
|
||||
{
|
||||
case SM_GoToPrevScreen:
|
||||
SCREENMAN->SetNewScreen( THEME->GetMetric (m_sName, "PrevScreen") );
|
||||
break;
|
||||
case SM_GoToNextScreen:
|
||||
}
|
||||
else if( SM == SM_GoToNextScreen )
|
||||
{
|
||||
SOUND->StopMusic();
|
||||
SCREENMAN->SetNewScreen( THEME->GetMetric (m_sName, "NextScreen") );
|
||||
break;
|
||||
case SM_AddToChat:
|
||||
{
|
||||
m_textOutHidden.SetText( NSMAN->m_sChatText );
|
||||
vector <wstring> wLines;
|
||||
m_textOutHidden.GetLines( wLines );
|
||||
m_actualText = "";
|
||||
for (unsigned i = max(int(wLines.size()) - SHOW_CHAT_LINES, 0 ) ; i < wLines.size() ; ++i)
|
||||
m_actualText += WStringToCString( wLines[i] )+'\n';
|
||||
m_textChatOutput.SetText( m_actualText );
|
||||
break;
|
||||
}
|
||||
case SM_UsersUpdate:
|
||||
}
|
||||
else if( SM == SM_AddToChat )
|
||||
{
|
||||
m_textOutHidden.SetText( NSMAN->m_sChatText );
|
||||
vector <wstring> wLines;
|
||||
m_textOutHidden.GetLines( wLines );
|
||||
m_actualText = "";
|
||||
for (unsigned i = max(int(wLines.size()) - SHOW_CHAT_LINES, 0 ) ; i < wLines.size() ; ++i)
|
||||
m_actualText += WStringToCString( wLines[i] )+'\n';
|
||||
m_textChatOutput.SetText( m_actualText );
|
||||
}
|
||||
else if( SM == SM_UsersUpdate )
|
||||
{
|
||||
UpdateUsers();
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
#include "RageLog.h"
|
||||
#include "ScreenPlayerOptions.h" // for SM_BackFromPlayerOptions
|
||||
|
||||
const ScreenMessage SM_NoSongs = ScreenMessage(SM_User+3);
|
||||
const ScreenMessage SM_ChangeSong = ScreenMessage(SM_User+5);
|
||||
const ScreenMessage SM_SMOnlinePack = ScreenMessage(SM_User+8); //Unused, but should be known
|
||||
const ScreenMessage SM_SetWheelSong = ScreenMessage(SM_User+19);
|
||||
const ScreenMessage SM_RefreshWheelLocation = ScreenMessage(SM_User+20);
|
||||
const AutoScreenMessage SM_NoSongs;
|
||||
const AutoScreenMessage SM_ChangeSong;
|
||||
const AutoScreenMessage SM_SMOnlinePack; //Unused, but should be known
|
||||
const AutoScreenMessage SM_SetWheelSong;
|
||||
const AutoScreenMessage SM_RefreshWheelLocation;
|
||||
|
||||
const CString AllGroups = "[ALL MUSIC]";
|
||||
|
||||
@@ -147,117 +147,119 @@ void ScreenNetSelectMusic::Input( const DeviceInput& DeviceI, const InputEventTy
|
||||
|
||||
void ScreenNetSelectMusic::HandleScreenMessage( const ScreenMessage SM )
|
||||
{
|
||||
switch( SM )
|
||||
if( SM == SM_GoToPrevScreen )
|
||||
{
|
||||
case SM_GoToPrevScreen:
|
||||
SCREENMAN->SetNewScreen( THEME->GetMetric (m_sName, "PrevScreen") );
|
||||
break;
|
||||
case SM_GoToNextScreen:
|
||||
}
|
||||
else if( SM == SM_GoToNextScreen )
|
||||
{
|
||||
SOUND->StopMusic();
|
||||
SCREENMAN->SetNewScreen( THEME->GetMetric (m_sName, "NextScreen") );
|
||||
break;
|
||||
case SM_NoSongs:
|
||||
}
|
||||
else if( SM == SM_NoSongs )
|
||||
{
|
||||
SCREENMAN->SetNewScreen( THEME->GetMetric (m_sName, "NoSongsScreen") );
|
||||
break;
|
||||
case SM_ChangeSong:
|
||||
}
|
||||
else if( SM_ChangeSong )
|
||||
{
|
||||
//First check to see if this song is already selected.
|
||||
//This is so that if you multiple copies of the "same" song
|
||||
//you can chose which copy to play.
|
||||
Song* CurSong = m_MusicWheel.GetSelectedSong();
|
||||
|
||||
if (CurSong != NULL )
|
||||
|
||||
if ( ( !CurSong->GetTranslitArtist().CompareNoCase( NSMAN->m_sArtist ) ) &&
|
||||
( !CurSong->GetTranslitMainTitle().CompareNoCase( NSMAN->m_sMainTitle ) ) &&
|
||||
( !CurSong->GetTranslitSubTitle().CompareNoCase( NSMAN->m_sSubTitle ) ) )
|
||||
{
|
||||
//First check to see if this song is already selected.
|
||||
//This is so that if you multiple copies of the "same" song
|
||||
//you can chose which copy to play.
|
||||
Song* CurSong = m_MusicWheel.GetSelectedSong();
|
||||
|
||||
if (CurSong != NULL )
|
||||
|
||||
if ( ( !CurSong->GetTranslitArtist().CompareNoCase( NSMAN->m_sArtist ) ) &&
|
||||
( !CurSong->GetTranslitMainTitle().CompareNoCase( NSMAN->m_sMainTitle ) ) &&
|
||||
( !CurSong->GetTranslitSubTitle().CompareNoCase( NSMAN->m_sSubTitle ) ) )
|
||||
switch ( NSMAN->m_iSelectMode )
|
||||
{
|
||||
switch ( NSMAN->m_iSelectMode )
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
NSMAN->m_iSelectMode = 0;
|
||||
NSMAN->SelectUserSong();
|
||||
break;
|
||||
case 2: //Proper starting of song
|
||||
case 3: //Blind starting of song
|
||||
StartSelectedSong();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
vector <Song *> AllSongs = SONGMAN->GetAllSongs();
|
||||
unsigned i;
|
||||
for( i=0; i < AllSongs.size(); i++ )
|
||||
{
|
||||
m_cSong = AllSongs[i];
|
||||
if ( ( !m_cSong->GetTranslitArtist().CompareNoCase( NSMAN->m_sArtist ) ) &&
|
||||
( !m_cSong->GetTranslitMainTitle().CompareNoCase( NSMAN->m_sMainTitle ) ) &&
|
||||
( !m_cSong->GetTranslitSubTitle().CompareNoCase( NSMAN->m_sSubTitle ) ) )
|
||||
break;
|
||||
}
|
||||
|
||||
bool haveSong = i != AllSongs.size();
|
||||
|
||||
switch (NSMAN->m_iSelectMode)
|
||||
{
|
||||
case 3:
|
||||
StartSelectedSong();
|
||||
break;
|
||||
case 2: //We need to do cmd 1 as well here
|
||||
if (haveSong)
|
||||
{
|
||||
if (!m_MusicWheel.SelectSong( m_cSong ) )
|
||||
{
|
||||
m_MusicWheel.ChangeSort( SORT_GROUP );
|
||||
m_MusicWheel.FinishTweening();
|
||||
SCREENMAN->PostMessageToTopScreen( SM_SetWheelSong, 0.710f );
|
||||
}
|
||||
m_MusicWheel.Select();
|
||||
m_MusicWheel.Move(-1);
|
||||
m_MusicWheel.Move(1);
|
||||
StartSelectedSong();
|
||||
m_MusicWheel.Select();
|
||||
}
|
||||
break;
|
||||
case 1: //Scroll to song as well
|
||||
if (haveSong)
|
||||
{
|
||||
if (!m_MusicWheel.SelectSong( m_cSong ) )
|
||||
{
|
||||
//m_MusicWheel.ChangeSort( SORT_GROUP );
|
||||
//m_MusicWheel.FinishTweening();
|
||||
//SCREENMAN->PostMessageToTopScreen( SM_SetWheelSong, 0.710f );
|
||||
m_MusicWheel.SetOpenGroup( "", SORT_GROUP );
|
||||
}
|
||||
m_MusicWheel.SelectSong( m_cSong );
|
||||
m_MusicWheel.Select();
|
||||
m_MusicWheel.Move(-1);
|
||||
m_MusicWheel.Move(1);
|
||||
m_MusicWheel.Select();
|
||||
}
|
||||
//don't break here
|
||||
case 0: //See if client has song
|
||||
if (haveSong)
|
||||
NSMAN->m_iSelectMode = 0;
|
||||
else
|
||||
NSMAN->m_iSelectMode = 1;
|
||||
case 0:
|
||||
case 1:
|
||||
NSMAN->m_iSelectMode = 0;
|
||||
NSMAN->SelectUserSong();
|
||||
break;
|
||||
case 2: //Proper starting of song
|
||||
case 3: //Blind starting of song
|
||||
StartSelectedSong();
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
break;
|
||||
//After we're done the sort on wheel, select song.
|
||||
case SM_SetWheelSong:
|
||||
|
||||
vector <Song *> AllSongs = SONGMAN->GetAllSongs();
|
||||
unsigned i;
|
||||
for( i=0; i < AllSongs.size(); i++ )
|
||||
{
|
||||
m_cSong = AllSongs[i];
|
||||
if ( ( !m_cSong->GetTranslitArtist().CompareNoCase( NSMAN->m_sArtist ) ) &&
|
||||
( !m_cSong->GetTranslitMainTitle().CompareNoCase( NSMAN->m_sMainTitle ) ) &&
|
||||
( !m_cSong->GetTranslitSubTitle().CompareNoCase( NSMAN->m_sSubTitle ) ) )
|
||||
break;
|
||||
}
|
||||
|
||||
bool haveSong = i != AllSongs.size();
|
||||
|
||||
switch (NSMAN->m_iSelectMode)
|
||||
{
|
||||
case 3:
|
||||
StartSelectedSong();
|
||||
break;
|
||||
case 2: //We need to do cmd 1 as well here
|
||||
if (haveSong)
|
||||
{
|
||||
if (!m_MusicWheel.SelectSong( m_cSong ) )
|
||||
{
|
||||
m_MusicWheel.ChangeSort( SORT_GROUP );
|
||||
m_MusicWheel.FinishTweening();
|
||||
SCREENMAN->PostMessageToTopScreen( SM_SetWheelSong, 0.710f );
|
||||
}
|
||||
m_MusicWheel.Select();
|
||||
m_MusicWheel.Move(-1);
|
||||
m_MusicWheel.Move(1);
|
||||
StartSelectedSong();
|
||||
m_MusicWheel.Select();
|
||||
}
|
||||
break;
|
||||
case 1: //Scroll to song as well
|
||||
if (haveSong)
|
||||
{
|
||||
if (!m_MusicWheel.SelectSong( m_cSong ) )
|
||||
{
|
||||
//m_MusicWheel.ChangeSort( SORT_GROUP );
|
||||
//m_MusicWheel.FinishTweening();
|
||||
//SCREENMAN->PostMessageToTopScreen( SM_SetWheelSong, 0.710f );
|
||||
m_MusicWheel.SetOpenGroup( "", SORT_GROUP );
|
||||
}
|
||||
m_MusicWheel.SelectSong( m_cSong );
|
||||
m_MusicWheel.Select();
|
||||
m_MusicWheel.Move(-1);
|
||||
m_MusicWheel.Move(1);
|
||||
m_MusicWheel.Select();
|
||||
}
|
||||
//don't break here
|
||||
case 0: //See if client has song
|
||||
if (haveSong)
|
||||
NSMAN->m_iSelectMode = 0;
|
||||
else
|
||||
NSMAN->m_iSelectMode = 1;
|
||||
NSMAN->SelectUserSong();
|
||||
}
|
||||
}
|
||||
else if( SM == SM_SetWheelSong ) //After we're done the sort on wheel, select song.
|
||||
{
|
||||
m_MusicWheel.SelectSong( m_cSong );
|
||||
case SM_RefreshWheelLocation:
|
||||
}
|
||||
else if( SM == SM_RefreshWheelLocation )
|
||||
{
|
||||
m_MusicWheel.Select();
|
||||
m_MusicWheel.Move(-1);
|
||||
m_MusicWheel.Move(1);
|
||||
m_MusicWheel.Select();
|
||||
m_bAllowInput = true;
|
||||
break;
|
||||
case SM_BackFromPlayerOptions:
|
||||
}
|
||||
else if( SM == SM_BackFromPlayerOptions )
|
||||
{
|
||||
//XXX: HACK: This will causes ScreenSelectOptions to go back here.
|
||||
NSMAN->ReportNSSOnOff(1);
|
||||
GAMESTATE->m_bEditing = false;
|
||||
@@ -269,13 +271,16 @@ void ScreenNetSelectMusic::HandleScreenMessage( const ScreenMessage SM )
|
||||
m_OptionIconRow[p].Load( p );
|
||||
m_OptionIconRow[p].Refresh();
|
||||
}
|
||||
break;
|
||||
case SM_SongChanged:
|
||||
}
|
||||
else if( SM == SM_SongChanged )
|
||||
{
|
||||
GAMESTATE->m_pCurSong.Set( m_MusicWheel.GetSelectedSong() );
|
||||
MusicChanged();
|
||||
break;
|
||||
case SM_SMOnlinePack:
|
||||
}
|
||||
else if( SM == SM_SMOnlinePack )
|
||||
{
|
||||
if ( NSMAN->m_SMOnlinePacket.Read1() == 1 )
|
||||
{
|
||||
switch ( NSMAN->m_SMOnlinePacket.Read1() )
|
||||
{
|
||||
case 0: //Room title Change
|
||||
@@ -291,8 +296,11 @@ void ScreenNetSelectMusic::HandleScreenMessage( const ScreenMessage SM )
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
done:
|
||||
|
||||
//Must be at end, as so it is last resort for SMOnline packets.
|
||||
//If it doens't know what to do, then it'll just remove them.
|
||||
ScreenNetSelectBase::HandleScreenMessage( SM );
|
||||
|
||||
@@ -28,8 +28,8 @@ OptionRowDefinition g_NetworkOptionsLines[NUM_NETWORK_OPTIONS_LINES] = {
|
||||
OptionRowDefinition( "Server", true, "PRESS START" )
|
||||
};
|
||||
|
||||
const ScreenMessage SM_DoneConnecting = ScreenMessage(SM_User+1);
|
||||
const ScreenMessage SM_ServerNameEnter = ScreenMessage(SM_User+2);
|
||||
const AutoScreenMessage SM_DoneConnecting;
|
||||
const AutoScreenMessage SM_ServerNameEnter;
|
||||
|
||||
static Preference<CString> g_sLastServer( Options, "LastConnectedServer", "" );
|
||||
|
||||
@@ -81,9 +81,8 @@ void ScreenNetworkOptions::GoToNextScreen()
|
||||
|
||||
void ScreenNetworkOptions::HandleScreenMessage( const ScreenMessage SM )
|
||||
{
|
||||
switch( SM )
|
||||
if( SM == SM_DoneConnecting )
|
||||
{
|
||||
case SM_DoneConnecting:
|
||||
if( !ScreenTextEntry::s_bCancelledLast )
|
||||
{
|
||||
CString sNewName = ScreenTextEntry::s_sLastAnswer;
|
||||
@@ -92,8 +91,9 @@ void ScreenNetworkOptions::HandleScreenMessage( const ScreenMessage SM )
|
||||
UpdateConnectStatus( );
|
||||
g_sLastServer = ScreenTextEntry::s_sLastAnswer;
|
||||
}
|
||||
break;
|
||||
case SM_ServerNameEnter:
|
||||
}
|
||||
else if( SM == SM_ServerNameEnter )
|
||||
{
|
||||
if( !ScreenTextEntry::s_bCancelledLast )
|
||||
{
|
||||
if ( NSMAN->LANserver == NULL)
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#define NUM_PACKAGES_SHOW THEME->GetMetricI(m_sName,"NumPackagesShow")
|
||||
#define NUM_LINKS_SHOW THEME->GetMetricI(m_sName,"NumLinksShow")
|
||||
|
||||
const ScreenMessage SM_BackFromURL = ScreenMessage(SM_User+2);
|
||||
const AutoScreenMessage SM_BackFromURL;
|
||||
|
||||
REGISTER_SCREEN_CLASS( ScreenPackages );
|
||||
ScreenPackages::ScreenPackages( CString sClassName ) : ScreenWithMenuElements( sClassName )
|
||||
@@ -120,18 +120,18 @@ void ScreenPackages::Init()
|
||||
|
||||
void ScreenPackages::HandleScreenMessage( const ScreenMessage SM )
|
||||
{
|
||||
switch( SM )
|
||||
if( SM == SM_GoToPrevScreen )
|
||||
{
|
||||
case SM_GoToPrevScreen:
|
||||
SCREENMAN->SetNewScreen( THEME->GetMetric (m_sName, "PrevScreen") );
|
||||
break;
|
||||
case SM_GoToNextScreen:
|
||||
}
|
||||
else if( SM ==SM_GoToNextScreen )
|
||||
{
|
||||
SCREENMAN->SetNewScreen( THEME->GetMetric (m_sName, "NextScreen") );
|
||||
break;
|
||||
case SM_BackFromURL:
|
||||
}
|
||||
else if( SM == SM_BackFromURL )
|
||||
{
|
||||
if ( !ScreenTextEntry::s_bCancelledLast )
|
||||
EnterURL( ScreenTextEntry::s_sLastAnswer );
|
||||
break;
|
||||
}
|
||||
ScreenWithMenuElements::HandleScreenMessage( SM );
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "PlayerState.h"
|
||||
#include "Foreach.h"
|
||||
|
||||
const AutoScreenMessage SM_BackFromPlayerOptions;
|
||||
|
||||
#define PREV_SCREEN THEME->GetMetric ("ScreenPlayerOptions","PrevScreen")
|
||||
#define NEXT_SCREEN THEME->GetMetric ("ScreenPlayerOptions","NextScreen")
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "ScreenOptionsMaster.h"
|
||||
|
||||
const ScreenMessage SM_BackFromPlayerOptions = (ScreenMessage)(SM_User+3);
|
||||
extern const AutoScreenMessage SM_BackFromPlayerOptions;
|
||||
|
||||
class ScreenPlayerOptions : public ScreenOptionsMaster
|
||||
{
|
||||
|
||||
@@ -32,9 +32,9 @@ OptionRowDefinition g_ProfileOptionsLines[NUM_PROFILE_OPTIONS_LINES] = {
|
||||
OptionRowDefinition( "OsMountPlayer2", true, "" ),
|
||||
};
|
||||
|
||||
const ScreenMessage SM_DoneCreating = ScreenMessage(SM_User+1);
|
||||
const ScreenMessage SM_DoneRenaming = ScreenMessage(SM_User+2);
|
||||
const ScreenMessage SM_DoneDeleting = ScreenMessage(SM_User+3);
|
||||
const AutoScreenMessage SM_DoneCreating;
|
||||
const AutoScreenMessage SM_DoneRenaming;
|
||||
const AutoScreenMessage SM_DoneDeleting;
|
||||
|
||||
REGISTER_SCREEN_CLASS( ScreenProfileOptions );
|
||||
ScreenProfileOptions::ScreenProfileOptions( CString sClassName ) : ScreenOptions( sClassName )
|
||||
@@ -147,9 +147,8 @@ void ScreenProfileOptions::GoToNextScreen()
|
||||
|
||||
void ScreenProfileOptions::HandleScreenMessage( const ScreenMessage SM )
|
||||
{
|
||||
switch( SM )
|
||||
if( SM == SM_DoneCreating)
|
||||
{
|
||||
case SM_DoneCreating:
|
||||
if( !ScreenTextEntry::s_bCancelledLast && ScreenTextEntry::s_sLastAnswer != "" )
|
||||
{
|
||||
CString sNewName = ScreenTextEntry::s_sLastAnswer;
|
||||
@@ -159,8 +158,9 @@ void ScreenProfileOptions::HandleScreenMessage( const ScreenMessage SM )
|
||||
else
|
||||
SCREENMAN->Prompt( SM_None, ssprintf("Error creating profile '%s'.", sNewName.c_str()) );
|
||||
}
|
||||
break;
|
||||
case SM_DoneRenaming:
|
||||
}
|
||||
else if( SM == SM_DoneRenaming )
|
||||
{
|
||||
if( !ScreenTextEntry::s_bCancelledLast )
|
||||
{
|
||||
CString sProfileID = GetSelectedProfileID();
|
||||
@@ -172,8 +172,9 @@ void ScreenProfileOptions::HandleScreenMessage( const ScreenMessage SM )
|
||||
else
|
||||
SCREENMAN->Prompt( SM_None, ssprintf("Error renaming profile %s '%s'\nto '%s'.", sProfileID.c_str(), sName.c_str(), sNewName.c_str()) );
|
||||
}
|
||||
break;
|
||||
case SM_DoneDeleting:
|
||||
}
|
||||
else if ( SM == SM_DoneDeleting )
|
||||
{
|
||||
if( ScreenPrompt::s_LastAnswer == ANSWER_YES )
|
||||
{
|
||||
CString sProfileID = GetSelectedProfileID();
|
||||
@@ -184,7 +185,6 @@ void ScreenProfileOptions::HandleScreenMessage( const ScreenMessage SM )
|
||||
else
|
||||
SCREENMAN->Prompt( SM_None, ssprintf("Error deleting profile %s '%s'.", sName.c_str(), sProfileID.c_str()) );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
ScreenOptions::HandleScreenMessage( SM );
|
||||
|
||||
@@ -43,8 +43,8 @@ XToString( PageType, NUM_PAGE_TYPES );
|
||||
#define COURSE_DIFFICULTY_X(col) (COURSE_DIFFICULTY_START_X+COL_SPACING_X*col)
|
||||
#define COURSE_SCORE_OFFSET_X(col) (COURSE_SCORE_OFFSET_START_X+COL_SPACING_X*col)
|
||||
|
||||
const ScreenMessage SM_ShowNextPage = (ScreenMessage)(SM_User+67);
|
||||
const ScreenMessage SM_HidePage = (ScreenMessage)(SM_User+68);
|
||||
const AutoScreenMessage SM_ShowNextPage;
|
||||
const AutoScreenMessage SM_HidePage;
|
||||
|
||||
|
||||
CString STEPS_TYPE_COLOR_NAME( size_t i ) { return ssprintf("StepsTypeColor%d",i+1); }
|
||||
@@ -422,9 +422,8 @@ void ScreenRanking::MenuBack( PlayerNumber pn )
|
||||
|
||||
void ScreenRanking::HandleScreenMessage( const ScreenMessage SM )
|
||||
{
|
||||
switch( SM )
|
||||
if( SM == SM_ShowNextPage )
|
||||
{
|
||||
case SM_ShowNextPage:
|
||||
if( m_vPagesToShow.size() > 0 )
|
||||
{
|
||||
float fSecsToShow = SetPage( m_vPagesToShow[0] );
|
||||
@@ -439,11 +438,11 @@ void ScreenRanking::HandleScreenMessage( const ScreenMessage SM )
|
||||
{
|
||||
StartTransitioning(SM_GoToNextScreen);
|
||||
}
|
||||
break;
|
||||
case SM_HidePage:
|
||||
}
|
||||
else if( SM == SM_HidePage )
|
||||
{
|
||||
TweenPageOffScreen();
|
||||
this->PostScreenMessage( SM_ShowNextPage, PAGE_FADE_SECONDS );
|
||||
break;
|
||||
}
|
||||
|
||||
ScreenAttract::HandleScreenMessage( SM );
|
||||
|
||||
@@ -18,8 +18,8 @@ REGISTER_SCREEN_CLASS(ScreenSMOnlineLogin);
|
||||
|
||||
#define PREV_SCREEN THEME->GetMetric (m_sName,"PrevScreen")
|
||||
#define NEXT_SCREEN THEME->GetMetric (m_sName,"NextScreen")
|
||||
const ScreenMessage SM_SMOnlinePack = ScreenMessage(SM_User+8);
|
||||
const ScreenMessage SM_PasswordDone = ScreenMessage(SM_User+9);
|
||||
const AutoScreenMessage SM_SMOnlinePack;
|
||||
const AutoScreenMessage SM_PasswordDone;
|
||||
OptionRowDefinition g_ProfileLine[1] = {
|
||||
OptionRowDefinition("Profile",false)
|
||||
};
|
||||
@@ -136,36 +136,34 @@ void ScreenSMOnlineLogin::GoToNextScreen()
|
||||
|
||||
void ScreenSMOnlineLogin::HandleScreenMessage(const ScreenMessage SM)
|
||||
{
|
||||
switch(SM)
|
||||
if( SM == SM_PasswordDone )
|
||||
{
|
||||
case SM_PasswordDone:
|
||||
if(!ScreenTextEntry::s_bCancelledLast)
|
||||
SendLogin(ScreenTextEntry::s_sLastAnswer);
|
||||
else
|
||||
SCREENMAN->SetNewScreen(PREV_SCREEN);
|
||||
break;
|
||||
|
||||
case SM_SMOnlinePack:
|
||||
}
|
||||
else if( SM == SM_SMOnlinePack )
|
||||
{
|
||||
int ResponceCode = NSMAN->m_SMOnlinePacket.Read1();
|
||||
if (ResponceCode == 0)
|
||||
{
|
||||
int Status = NSMAN->m_SMOnlinePacket.Read1();
|
||||
if(Status == 0)
|
||||
{
|
||||
NSMAN->isSMOLoggedIn[m_iPlayer] = true;
|
||||
m_iPlayer++;
|
||||
if( GAMESTATE->IsPlayerEnabled((PlayerNumber) m_iPlayer) && m_iPlayer < NUM_PLAYERS )
|
||||
SCREENMAN->Password(SM_PasswordDone, "You are logging on as:\n" + GAMESTATE->GetPlayerDisplayName((PlayerNumber) m_iPlayer) + "\n\nPlease enter you password.", NULL );
|
||||
else
|
||||
SCREENMAN->SetNewScreen(NEXT_SCREEN);
|
||||
}
|
||||
if(Status == 0)
|
||||
{
|
||||
NSMAN->isSMOLoggedIn[m_iPlayer] = true;
|
||||
m_iPlayer++;
|
||||
if( GAMESTATE->IsPlayerEnabled((PlayerNumber) m_iPlayer) && m_iPlayer < NUM_PLAYERS )
|
||||
SCREENMAN->Password(SM_PasswordDone, "You are logging on as:\n" + GAMESTATE->GetPlayerDisplayName((PlayerNumber) m_iPlayer) + "\n\nPlease enter you password.", NULL );
|
||||
else
|
||||
{
|
||||
CString Responce = NSMAN->m_SMOnlinePacket.ReadNT();
|
||||
SCREENMAN->Password( SM_PasswordDone, Responce + "\n\nYou are logging on as:\n" + GAMESTATE->GetPlayerDisplayName((PlayerNumber) m_iPlayer) + "\n\nPlease enter you password.", NULL );
|
||||
}
|
||||
SCREENMAN->SetNewScreen(NEXT_SCREEN);
|
||||
}
|
||||
else
|
||||
{
|
||||
CString Responce = NSMAN->m_SMOnlinePacket.ReadNT();
|
||||
SCREENMAN->Password( SM_PasswordDone, Responce + "\n\nYou are logging on as:\n" + GAMESTATE->GetPlayerDisplayName((PlayerNumber) m_iPlayer) + "\n\nPlease enter you password.", NULL );
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
ScreenOptions::HandleScreenMessage(SM);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "LightsManager.h"
|
||||
#include "Command.h"
|
||||
|
||||
const AutoScreenMessage SM_AllDoneChoosing;
|
||||
|
||||
#define CHOICE_NAMES THEME->GetMetric (m_sName,"ChoiceNames")
|
||||
#define CHOICE( sChoiceName ) THEME->GetMetricM(m_sName,ssprintf("Choice%s",sChoiceName.c_str()))
|
||||
@@ -181,69 +182,63 @@ void ScreenSelect::Input( const DeviceInput& DeviceI, const InputEventType type,
|
||||
|
||||
void ScreenSelect::HandleScreenMessage( const ScreenMessage SM )
|
||||
{
|
||||
switch( SM )
|
||||
if( SM == SM_BeginFadingOut ) /* Screen is starting to tween out. */
|
||||
{
|
||||
/* Screen is starting to tween out. */
|
||||
case SM_BeginFadingOut:
|
||||
/* At this point, we're tweening out; we can't change the selection.
|
||||
* We don't want to allow players to join if the style will be set,
|
||||
* since that can change the available selection and is likely to
|
||||
* invalidate the choice we've already made. Hack: apply the style.
|
||||
* (Applying the style may have other side-effects, so it'll be re-applied
|
||||
* in SM_GoToNextScreen.) */
|
||||
FOREACH_HumanPlayer( p )
|
||||
{
|
||||
/* At this point, we're tweening out; we can't change the selection.
|
||||
* We don't want to allow players to join if the style will be set,
|
||||
* since that can change the available selection and is likely to
|
||||
* invalidate the choice we've already made. Hack: apply the style.
|
||||
* (Applying the style may have other side-effects, so it'll be re-applied
|
||||
* in SM_GoToNextScreen.) */
|
||||
FOREACH_HumanPlayer( p )
|
||||
{
|
||||
const int sel = GetSelectionIndex( p );
|
||||
if( m_aGameCommands[sel].m_pStyle )
|
||||
GAMESTATE->m_pCurStyle = m_aGameCommands[sel].m_pStyle;
|
||||
}
|
||||
SCREENMAN->RefreshCreditsMessages();
|
||||
const int sel = GetSelectionIndex( p );
|
||||
if( m_aGameCommands[sel].m_pStyle )
|
||||
GAMESTATE->m_pCurStyle = m_aGameCommands[sel].m_pStyle;
|
||||
}
|
||||
break;
|
||||
|
||||
/* It's our turn to tween out. */
|
||||
case SM_AllDoneChoosing:
|
||||
SCREENMAN->RefreshCreditsMessages();
|
||||
}
|
||||
else if( SM == SM_AllDoneChoosing ) /* It's our turn to tween out. */
|
||||
{
|
||||
if( !IsTransitioning() )
|
||||
StartTransitioning( SM_GoToNextScreen );
|
||||
break;
|
||||
case SM_GoToNextScreen:
|
||||
}
|
||||
else if( SM == SM_GoToNextScreen )
|
||||
{
|
||||
/* Apply here, not in SM_AllDoneChoosing, because applying can take a very
|
||||
* long time (200+ms), and at SM_AllDoneChoosing, we're still tweening stuff
|
||||
* off-screen.
|
||||
*
|
||||
* Hack: only apply one Screen. */
|
||||
CString sScreen;
|
||||
FOREACH_HumanPlayer( p )
|
||||
{
|
||||
/* Apply here, not in SM_AllDoneChoosing, because applying can take a very
|
||||
* long time (200+ms), and at SM_AllDoneChoosing, we're still tweening stuff
|
||||
* off-screen.
|
||||
*
|
||||
* Hack: only apply one Screen. */
|
||||
CString sScreen;
|
||||
FOREACH_HumanPlayer( p )
|
||||
{
|
||||
GameCommand gc = m_aGameCommands[this->GetSelectionIndex(p)];
|
||||
if( sScreen == "" )
|
||||
sScreen = gc.m_sScreen;
|
||||
gc.m_sScreen = "";
|
||||
gc.Apply( p );
|
||||
}
|
||||
GameCommand gc = m_aGameCommands[this->GetSelectionIndex(p)];
|
||||
if( sScreen == "" )
|
||||
sScreen = gc.m_sScreen;
|
||||
gc.m_sScreen = "";
|
||||
gc.Apply( p );
|
||||
}
|
||||
|
||||
//
|
||||
// Finalize players if we set a style on this screen.
|
||||
//
|
||||
FOREACH_HumanPlayer( p )
|
||||
//
|
||||
// Finalize players if we set a style on this screen.
|
||||
//
|
||||
FOREACH_HumanPlayer( p )
|
||||
{
|
||||
const int sel = GetSelectionIndex( p );
|
||||
if( m_aGameCommands[sel].m_pStyle )
|
||||
{
|
||||
const int sel = GetSelectionIndex( p );
|
||||
if( m_aGameCommands[sel].m_pStyle )
|
||||
{
|
||||
GAMESTATE->PlayersFinalized();
|
||||
break;
|
||||
}
|
||||
GAMESTATE->PlayersFinalized();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( sScreen != "" )
|
||||
SCREENMAN->SetNewScreen( sScreen );
|
||||
else
|
||||
{
|
||||
const int iSelectionIndex = GetSelectionIndex(GAMESTATE->m_MasterPlayerNumber);
|
||||
SCREENMAN->SetNewScreen( NEXT_SCREEN(iSelectionIndex) );
|
||||
}
|
||||
if( sScreen != "" )
|
||||
SCREENMAN->SetNewScreen( sScreen );
|
||||
else
|
||||
{
|
||||
const int iSelectionIndex = GetSelectionIndex(GAMESTATE->m_MasterPlayerNumber);
|
||||
SCREENMAN->SetNewScreen( NEXT_SCREEN(iSelectionIndex) );
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "ThemeMetric.h"
|
||||
|
||||
// Derived classes must send this when done
|
||||
const ScreenMessage SM_AllDoneChoosing = (ScreenMessage)(SM_User+123); // unique
|
||||
extern const AutoScreenMessage SM_AllDoneChoosing;
|
||||
|
||||
class ScreenSelect : public ScreenWithMenuElements
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include "RageSoundManager.h"
|
||||
|
||||
|
||||
const ScreenMessage SM_PlayPostSwitchPage = (ScreenMessage)(SM_User+1);
|
||||
const AutoScreenMessage SM_PlayPostSwitchPage;
|
||||
|
||||
CString CURSOR_OFFSET_X_FROM_ICON_NAME( size_t p, size_t part ) { return ssprintf("CursorPart%dP%dOffsetXFromIcon",part+1,p+1); }
|
||||
CString CURSOR_OFFSET_Y_FROM_ICON_NAME( size_t p, size_t part ) { return ssprintf("CursorPart%dP%dOffsetYFromIcon",part+1,p+1); }
|
||||
@@ -275,75 +275,68 @@ void ScreenSelectMaster::HandleScreenMessage( const ScreenMessage SM )
|
||||
{
|
||||
ScreenSelect::HandleScreenMessage( SM );
|
||||
|
||||
switch( SM )
|
||||
if( SM == SM_PlayPostSwitchPage )
|
||||
{
|
||||
case SM_PlayPostSwitchPage:
|
||||
if( SHARED_PREVIEW_AND_CURSOR )
|
||||
{
|
||||
if( SHARED_PREVIEW_AND_CURSOR )
|
||||
for( int i=0; i<NUM_CURSOR_PARTS; i++ )
|
||||
{
|
||||
for( int i=0; i<NUM_CURSOR_PARTS; i++ )
|
||||
m_sprCursor[i][0]->SetXY( GetCursorX((PlayerNumber)0,i), GetCursorY((PlayerNumber)0,i) );
|
||||
COMMAND( m_sprCursor[i][0], "PostSwitchPage" );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for( int i=0; i<NUM_CURSOR_PARTS; i++ )
|
||||
FOREACH_HumanPlayer( p )
|
||||
{
|
||||
m_sprCursor[i][0]->SetXY( GetCursorX((PlayerNumber)0,i), GetCursorY((PlayerNumber)0,i) );
|
||||
COMMAND( m_sprCursor[i][0], "PostSwitchPage" );
|
||||
m_sprCursor[i][p]->SetXY( GetCursorX(p,i), GetCursorY(p,i) );
|
||||
COMMAND( m_sprCursor[i][p], "PostSwitchPage" );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for( int i=0; i<NUM_CURSOR_PARTS; i++ )
|
||||
FOREACH_HumanPlayer( p )
|
||||
{
|
||||
m_sprCursor[i][p]->SetXY( GetCursorX(p,i), GetCursorY(p,i) );
|
||||
COMMAND( m_sprCursor[i][p], "PostSwitchPage" );
|
||||
}
|
||||
}
|
||||
|
||||
if( SHARED_PREVIEW_AND_CURSOR )
|
||||
{
|
||||
for( int i=0; i<NUM_PREVIEW_PARTS; i++ )
|
||||
COMMAND( m_sprPreview[i][m_iChoice[0]][0], "PostSwitchPage" );
|
||||
}
|
||||
else
|
||||
{
|
||||
for( int i=0; i<NUM_PREVIEW_PARTS; i++ )
|
||||
FOREACH_HumanPlayer( p )
|
||||
COMMAND( m_sprPreview[i][m_iChoice[p]][p], "PostSwitchPage" );
|
||||
}
|
||||
|
||||
m_fLockInputSecs = POST_SWITCH_PAGE_SECONDS;
|
||||
}
|
||||
break;
|
||||
case SM_BeginFadingOut:
|
||||
|
||||
if( SHARED_PREVIEW_AND_CURSOR )
|
||||
{
|
||||
TweenOffScreen();
|
||||
|
||||
/*
|
||||
* We start our own tween-out (TweenOffScreen), wait some amount of time, then
|
||||
* start the base tween (ScreenWithMenuElements, called from SM_AllDoneChoosing);
|
||||
* we move on when that finishes. This is a pain to tweak, especially now
|
||||
* that elements essentially owned by the derived class are starting to tween
|
||||
* in the ScreenWithMenuElements tween (underlay, overlay); we have to tweak the
|
||||
* duration of the "out" transition to determine how long to wait after fSecs
|
||||
* before moving on.
|
||||
*
|
||||
* Send a command to all children, so we can run overlay and underlay tweens at the
|
||||
* same time as the elements controlled by TweenOffScreen. Run this here, so
|
||||
* it affects the result of GetTweenTimeLeft().
|
||||
*/
|
||||
this->PlayCommand( "TweenOff" );
|
||||
|
||||
float fSecs = 0;
|
||||
/* This can be used to allow overlap between the main tween-off and the MenuElements
|
||||
* tweenoff. */
|
||||
if( OVERRIDE_SLEEP_AFTER_TWEEN_OFF_SECONDS )
|
||||
fSecs = SLEEP_AFTER_TWEEN_OFF_SECONDS;
|
||||
else
|
||||
fSecs = GetTweenTimeLeft();
|
||||
fSecs = max( fSecs, 0 );
|
||||
|
||||
SCREENMAN->PostMessageToTopScreen( SM_AllDoneChoosing, fSecs ); // nofify parent that we're finished
|
||||
StopTimer();
|
||||
for( int i=0; i<NUM_PREVIEW_PARTS; i++ )
|
||||
COMMAND( m_sprPreview[i][m_iChoice[0]][0], "PostSwitchPage" );
|
||||
}
|
||||
break;
|
||||
else
|
||||
{
|
||||
for( int i=0; i<NUM_PREVIEW_PARTS; i++ )
|
||||
FOREACH_HumanPlayer( p )
|
||||
COMMAND( m_sprPreview[i][m_iChoice[p]][p], "PostSwitchPage" );
|
||||
}
|
||||
m_fLockInputSecs = POST_SWITCH_PAGE_SECONDS;
|
||||
}
|
||||
else if( SM == SM_BeginFadingOut )
|
||||
{
|
||||
TweenOffScreen();
|
||||
/*
|
||||
* We start our own tween-out (TweenOffScreen), wait some amount of time, then
|
||||
* start the base tween (ScreenWithMenuElements, called from SM_AllDoneChoosing);
|
||||
* we move on when that finishes. This is a pain to tweak, especially now
|
||||
* that elements essentially owned by the derived class are starting to tween
|
||||
* in the ScreenWithMenuElements tween (underlay, overlay); we have to tweak the
|
||||
* duration of the "out" transition to determine how long to wait after fSecs
|
||||
* before moving on.
|
||||
*
|
||||
* Send a command to all children, so we can run overlay and underlay tweens at the
|
||||
* same time as the elements controlled by TweenOffScreen. Run this here, so
|
||||
* it affects the result of GetTweenTimeLeft().
|
||||
*/
|
||||
this->PlayCommand( "TweenOff" );
|
||||
|
||||
float fSecs = 0;
|
||||
/* This can be used to allow overlap between the main tween-off and the MenuElements
|
||||
* tweenoff. */
|
||||
if( OVERRIDE_SLEEP_AFTER_TWEEN_OFF_SECONDS )
|
||||
fSecs = SLEEP_AFTER_TWEEN_OFF_SECONDS;
|
||||
else
|
||||
fSecs = GetTweenTimeLeft();
|
||||
fSecs = max( fSecs, 0 );
|
||||
|
||||
SCREENMAN->PostMessageToTopScreen( SM_AllDoneChoosing, fSecs ); // nofify parent that we're finished
|
||||
StopTimer();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ const int NUM_SCORE_DIGITS = 9;
|
||||
#define SCORE_SORT_CHANGE_COMMAND(i) THEME->GetMetricA(m_sName,ssprintf("ScoreP%iSortChangeCommand", i+1))
|
||||
#define SCORE_FRAME_SORT_CHANGE_COMMAND(i) THEME->GetMetricA(m_sName,ssprintf("ScoreFrameP%iSortChangeCommand", i+1))
|
||||
|
||||
static const ScreenMessage SM_AllowOptionsMenuRepeat = ScreenMessage(SM_User+1);
|
||||
static const AutoScreenMessage SM_AllowOptionsMenuRepeat;
|
||||
|
||||
static CString g_sCDTitlePath;
|
||||
static bool g_bWantFallbackCdTitle;
|
||||
@@ -1021,12 +1021,12 @@ void ScreenSelectMusic::ChangeDifficulty( PlayerNumber pn, int dir )
|
||||
|
||||
void ScreenSelectMusic::HandleScreenMessage( const ScreenMessage SM )
|
||||
{
|
||||
switch( SM )
|
||||
if( SM == SM_AllowOptionsMenuRepeat )
|
||||
{
|
||||
case SM_AllowOptionsMenuRepeat:
|
||||
m_bAllowOptionsMenuRepeat = true;
|
||||
break;
|
||||
case SM_MenuTimer:
|
||||
}
|
||||
else if( SM == SM_MenuTimer )
|
||||
{
|
||||
if( m_MusicWheel.IsRouletting() )
|
||||
{
|
||||
MenuStart(PLAYER_INVALID);
|
||||
@@ -1053,7 +1053,9 @@ void ScreenSelectMusic::HandleScreenMessage( const ScreenMessage SM )
|
||||
MenuStart(PLAYER_INVALID);
|
||||
}
|
||||
return;
|
||||
case SM_GoToPrevScreen:
|
||||
}
|
||||
else if( SM == SM_GoToPrevScreen )
|
||||
{
|
||||
SCREENMAN->DeletePreparedScreens();
|
||||
SCREENMAN->SetNewScreen( PREV_SCREEN );
|
||||
|
||||
@@ -1062,14 +1064,17 @@ void ScreenSelectMusic::HandleScreenMessage( const ScreenMessage SM )
|
||||
* the game state, so just discard them. */
|
||||
ClearMessageQueue();
|
||||
return;
|
||||
case SM_BeginFadingOut:
|
||||
}
|
||||
else if( SM == SM_BeginFadingOut )
|
||||
{
|
||||
/* XXX: yuck. Later on, maybe this can be done in one BGA with lua ... */
|
||||
if( m_bGoToOptions )
|
||||
m_bgOptionsOut.StartTransitioning( SM_GoToNextScreen );
|
||||
else
|
||||
m_bgNoOptionsOut.StartTransitioning( SM_GoToNextScreen );
|
||||
break;
|
||||
case SM_GoToNextScreen:
|
||||
}
|
||||
else if( SM == SM_GoToNextScreen )
|
||||
{
|
||||
if( m_bGoToOptions )
|
||||
{
|
||||
SCREENMAN->SetNewScreen( NEXT_OPTIONS_SCREEN );
|
||||
@@ -1081,22 +1086,27 @@ void ScreenSelectMusic::HandleScreenMessage( const ScreenMessage SM )
|
||||
SCREENMAN->SetNewScreen( NEXT_SCREEN );
|
||||
}
|
||||
return;
|
||||
case SM_SongChanged:
|
||||
}
|
||||
else if( SM == SM_SongChanged )
|
||||
{
|
||||
AfterMusicChange();
|
||||
break;
|
||||
case SM_SortOrderChanging: /* happens immediately */
|
||||
// m_MusicSortDisplay.FadeOff( 0, "fade", TWEEN_TIME );
|
||||
}
|
||||
else if( SM == SM_SortOrderChanging ) /* happens immediately */
|
||||
{
|
||||
// m_MusicSortDisplay.FadeOff( 0, "fade", TWEEN_TIME );
|
||||
TweenScoreOnAndOffAfterChangeSort();
|
||||
break;
|
||||
case SM_SortOrderChanged: /* happens after the wheel is off and the new song is selected */
|
||||
}
|
||||
else if( SM == SM_SortOrderChanged ) /* happens after the wheel is off and the new song is selected */
|
||||
{
|
||||
SortOrderChanged();
|
||||
break;
|
||||
case SM_GainFocus:
|
||||
}
|
||||
else if( SM == SM_GainFocus )
|
||||
{
|
||||
CodeDetector::RefreshCacheItems( CODES );
|
||||
break;
|
||||
case SM_LoseFocus:
|
||||
}
|
||||
else if( SM == SM_LoseFocus )
|
||||
{
|
||||
CodeDetector::RefreshCacheItems(); /* reset for other screens */
|
||||
break;
|
||||
}
|
||||
|
||||
Screen::HandleScreenMessage( SM );
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#include "ThemeManager.h"
|
||||
#include "PrefsManager.h"
|
||||
|
||||
const AutoScreenMessage SM_BackFromSongOptions;
|
||||
|
||||
#define PREV_SCREEN THEME->GetMetric ("ScreenSongOptions","PrevScreen")
|
||||
#define NEXT_SCREEN THEME->GetMetric ("ScreenSongOptions","NextScreen")
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "ScreenOptionsMaster.h"
|
||||
|
||||
const ScreenMessage SM_BackFromSongOptions = (ScreenMessage)(SM_User+4);
|
||||
extern const AutoScreenMessage SM_BackFromSongOptions;
|
||||
|
||||
class ScreenSongOptions : public ScreenOptionsMaster
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "ThemeManager.h"
|
||||
#include "RageUtil.h"
|
||||
|
||||
const ScreenMessage SM_PrepScreen = (ScreenMessage)(SM_User+0);
|
||||
const AutoScreenMessage SM_PrepScreen;
|
||||
|
||||
|
||||
REGISTER_SCREEN_CLASS( ScreenSplash );
|
||||
@@ -26,33 +26,32 @@ void ScreenSplash::Init()
|
||||
|
||||
void ScreenSplash::HandleScreenMessage( const ScreenMessage SM )
|
||||
{
|
||||
switch( SM )
|
||||
if( SM == SM_PrepScreen )
|
||||
{
|
||||
case SM_PrepScreen:
|
||||
{
|
||||
RageTimer length;
|
||||
if( PREPARE_SCREEN )
|
||||
SCREENMAN->PrepareScreen( NEXT_SCREEN );
|
||||
float fScreenLoadSeconds = length.GetDeltaTime();
|
||||
RageTimer length;
|
||||
if( PREPARE_SCREEN )
|
||||
SCREENMAN->PrepareScreen( NEXT_SCREEN );
|
||||
float fScreenLoadSeconds = length.GetDeltaTime();
|
||||
|
||||
/* The screen load took fScreenLoadSeconds. Move on to the next screen after
|
||||
* no less than MINIMUM_DELAY seconds. */
|
||||
this->PostScreenMessage( SM_GoToNextScreen, max( 0, MINIMUM_LOAD_DELAY_SECONDS-fScreenLoadSeconds) );
|
||||
}
|
||||
break;
|
||||
case SM_BeginFadingOut:
|
||||
/* The screen load took fScreenLoadSeconds. Move on to the next screen after
|
||||
* no less than MINIMUM_DELAY seconds. */
|
||||
this->PostScreenMessage( SM_GoToNextScreen, max( 0, MINIMUM_LOAD_DELAY_SECONDS-fScreenLoadSeconds) );
|
||||
}
|
||||
else if( SM == SM_BeginFadingOut )
|
||||
{
|
||||
StartTransitioning( SM_GoToNextScreen );
|
||||
break;
|
||||
case SM_GoToNextScreen:
|
||||
}
|
||||
else if( SM == SM_GoToNextScreen )
|
||||
{
|
||||
if( SCREENMAN->IsStackedScreen(SCREENMAN->GetTopScreen()) )
|
||||
SCREENMAN->PopTopScreen( SM_None );
|
||||
else
|
||||
SCREENMAN->SetNewScreen( NEXT_SCREEN );
|
||||
break;
|
||||
case SM_GoToPrevScreen:
|
||||
}
|
||||
else if( SM == SM_GoToPrevScreen )
|
||||
{
|
||||
SCREENMAN->DeletePreparedScreens();
|
||||
SCREENMAN->SetNewScreen( PREV_SCREEN );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#define PREV_SCREEN THEME->GetMetric (m_sName,"PrevScreen")
|
||||
#define MINIMUM_DELAY THEME->GetMetricF(m_sName,"MinimumDelay")
|
||||
|
||||
const ScreenMessage SM_PrepScreen = (ScreenMessage)(SM_User+0);
|
||||
const AutoScreenMessage SM_PrepScreen;
|
||||
|
||||
REGISTER_SCREEN_CLASS( ScreenStage );
|
||||
ScreenStage::ScreenStage( CString sClassName ) : Screen( sClassName )
|
||||
@@ -102,9 +102,7 @@ void ScreenStage::Init()
|
||||
|
||||
void ScreenStage::HandleScreenMessage( const ScreenMessage SM )
|
||||
{
|
||||
switch( SM )
|
||||
{
|
||||
case SM_PrepScreen:
|
||||
if( SM == SM_PrepScreen )
|
||||
{
|
||||
RageTimer length;
|
||||
SCREENMAN->PrepareScreen( NEXT_SCREEN );
|
||||
@@ -113,24 +111,24 @@ void ScreenStage::HandleScreenMessage( const ScreenMessage SM )
|
||||
/* The screen load took fScreenLoadSeconds. Move on to the next screen after
|
||||
* no less than MINIMUM_DELAY seconds. */
|
||||
this->PostScreenMessage( SM_BeginFadingOut, max( 0, MINIMUM_DELAY-fScreenLoadSeconds) );
|
||||
break;
|
||||
}
|
||||
case SM_BeginFadingOut:
|
||||
else if( SM == SM_BeginFadingOut )
|
||||
{
|
||||
m_Out.StartTransitioning();
|
||||
FOREACH_PlayerNumber( p )
|
||||
OFF_COMMAND( m_sprCharacterIcon[p] );
|
||||
OFF_COMMAND( m_SongTitle );
|
||||
OFF_COMMAND( m_Artist );
|
||||
this->PostScreenMessage( SM_GoToNextScreen, this->GetTweenTimeLeft() );
|
||||
|
||||
break;
|
||||
case SM_GoToNextScreen:
|
||||
}
|
||||
else if( SM == SM_GoToNextScreen )
|
||||
{
|
||||
SCREENMAN->SetNewScreen( NEXT_SCREEN );
|
||||
break;
|
||||
case SM_GoToPrevScreen:
|
||||
}
|
||||
else if( SM == SM_GoToPrevScreen )
|
||||
{
|
||||
SCREENMAN->DeletePreparedScreens();
|
||||
SCREENMAN->SetNewScreen( PREV_SCREEN );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
#define NONSTOP_SCREEN THEME->GetMetric("ScreenStyleSplash","NonstopScreen")
|
||||
#define ONI_SCREEN THEME->GetMetric("ScreenStyleSplash","OniScreen")
|
||||
|
||||
const ScreenMessage SM_DoneOpening = ScreenMessage(SM_User-7);
|
||||
const ScreenMessage SM_StartClosing = ScreenMessage(SM_User-8);
|
||||
const AutoScreenMessage SM_DoneOpening;
|
||||
const AutoScreenMessage SM_StartClosing;
|
||||
|
||||
|
||||
REGISTER_SCREEN_CLASS( ScreenStyleSplash );
|
||||
@@ -61,21 +61,21 @@ void ScreenStyleSplash::Input( const DeviceInput& DeviceI, const InputEventType
|
||||
|
||||
void ScreenStyleSplash::HandleScreenMessage( const ScreenMessage SM )
|
||||
{
|
||||
switch( SM )
|
||||
if( SM == SM_StartClosing )
|
||||
{
|
||||
case SM_StartClosing:
|
||||
if( !IsTransitioning() )
|
||||
StartTransitioning( SM_GoToNextScreen );
|
||||
break;
|
||||
case SM_DoneOpening:
|
||||
|
||||
break;
|
||||
case SM_GoToPrevScreen:
|
||||
}
|
||||
else if( SM == SM_DoneOpening )
|
||||
{
|
||||
}
|
||||
else if( SM == SM_GoToPrevScreen )
|
||||
{
|
||||
SCREENMAN->SetNewScreen( PREV_SCREEN );
|
||||
break;
|
||||
case SM_GoToNextScreen:
|
||||
}
|
||||
else if( SM == SM_GoToNextScreen )
|
||||
{
|
||||
SCREENMAN->SetNewScreen( NEXT_SCREEN );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ void ChangeText(CString txt)
|
||||
{
|
||||
CustomText = txt;
|
||||
}
|
||||
const ScreenMessage SM_ChangeText = ScreenMessage(SM_User+1);
|
||||
const AutoScreenMessage SM_ChangeText;
|
||||
|
||||
void ScreenTestFonts::HandleScreenMessage( const ScreenMessage SM )
|
||||
{
|
||||
|
||||
@@ -2628,6 +2628,10 @@ SOURCE=.\ScreenMapControllers.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ScreenMessage.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ScreenMessage.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@@ -373,6 +373,9 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)"\
|
||||
<File
|
||||
RelativePath="ScreenMapControllers.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="ScreenMessage.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="ScreenMessage.h">
|
||||
</File>
|
||||
@@ -767,9 +770,6 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)"\
|
||||
<File
|
||||
RelativePath="GameInput.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="GameplayMessages.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Grade.cpp">
|
||||
</File>
|
||||
|
||||
Reference in New Issue
Block a user