Added DifficultyMeter to ScreenNetSelectMusic.

This commit is contained in:
Charles Lohr
2004-08-29 06:35:01 +00:00
parent c11c9283cd
commit 6f0f39028a
3 changed files with 42 additions and 8 deletions
+10 -1
View File
@@ -884,6 +884,14 @@ SelOffCommand=linear,0.5;zoomx,0.0;zoomy,0.0
SelTo1Command=linear,0.3;zoomy,1.0;zoomx,1.0;x,480;y,150
SelTo2Command=linear,0.3;zoomy,1.0;zoomx,1.0;x,480;y,350
SelTo3Command=linear,0.3;x,260;y,400;zoomx,0.3;zoomy,2.0
MeterP1Y=435
MeterP1X=240
MeterP1OnCommand=zoomx,0.0;zoomy,0.0;linear,0.5;zoomy,1.0;zoomx,1.0
MeterP1OffCommand=linear,0.5;zoomx,0.0;zoomy,0.0
MeterP2Y=455
MeterP2X=280
MeterP2OnCommand=zoomx,0.0;zoomy,0.0;linear,0.5;zoomy,1.0;zoomx,1.0
MeterP2OffCommand=linear,0.5;zoomx,0.0;zoomy,0.0
DifficultyIconP1Y=400
DifficultyIconP1X=230
DifficultyIconP1OnCommand=zoomx,0;zoomy,0;linear,0.5;zoomx,1.0;zoomy,1.0
@@ -4078,7 +4086,7 @@ PrevScreen=ScreenTitleMenu
# when using entries that change the screen; otherwise, the only way to
# exit the screen when in regular mode is "exit".
LineNames=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
LineNames=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16
OptionMenuFlags=together;forceallplayers;smnavigation
# This NextScreen is only used for the "exit" choice.
Line1=list,Appearance Options
@@ -4096,6 +4104,7 @@ Line12=list,Profile Options
Line13=list,Other Options
Line14=list,Reload Songs/Courses
Line15=list,Test Input
Line16=list,Network Options
[TextBanner]
TitleX=-90
+27 -7
View File
@@ -169,6 +169,11 @@ ScreenNetSelectMusic::ScreenNetSelectMusic( const CString& sName ) : ScreenWithM
ON_COMMAND( m_DifficultyIcon[p] );
m_DC[p] = GAMESTATE->m_PreferredDifficulty[p];
m_DifficultyIcon[p].SetFromDifficulty( p, m_DC[p] );
m_DifficultyMeters[p].SetName( "DifficultyMeter", ssprintf("MeterP%d",p+1) );
m_DifficultyMeters[p].Load();
SET_XY_AND_ON_COMMAND( m_DifficultyMeters[p] );
this->AddChild( &m_DifficultyMeters[p] );
}
m_SelectMode = SelectGroup;
@@ -404,7 +409,7 @@ void ScreenNetSelectMusic::MenuLeft( PlayerNumber pn, const InputEventType type
case SelectDifficulty:
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
vector <Steps *> MultiSteps;
MultiSteps = m_vSongs[m_iSongNum % m_vSongs.size()]->GetAllSteps( st );
MultiSteps = GAMESTATE->m_pCurSong->GetAllSteps( st );
if (MultiSteps.size() == 0)
m_DC[pn] = NUM_DIFFICULTIES;
else
@@ -419,7 +424,8 @@ void ScreenNetSelectMusic::MenuLeft( PlayerNumber pn, const InputEventType type
if (i > 0) //If we are at the easiest difficulty, do nothign
m_DC[pn] = MultiSteps[i-1]->GetDifficulty();
}
m_DifficultyIcon[pn].SetFromDifficulty( pn, m_DC[pn] );
UpdateDifficulties( pn );
GAMESTATE->m_PreferredDifficulty[pn] = m_DC[pn];
}
}
@@ -442,7 +448,7 @@ void ScreenNetSelectMusic::MenuRight( PlayerNumber pn, const InputEventType type
case SelectDifficulty:
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
vector <Steps *> MultiSteps;
MultiSteps = m_vSongs[m_iSongNum % m_vSongs.size()]->GetAllSteps( st );
MultiSteps = GAMESTATE->m_pCurSong->GetAllSteps( st );
if (MultiSteps.size() == 0)
m_DC[pn] = NUM_DIFFICULTIES;
else
@@ -457,7 +463,8 @@ void ScreenNetSelectMusic::MenuRight( PlayerNumber pn, const InputEventType type
if (i < (int)MultiSteps.size() - 1 ) //If we are at the hardest difficulty, do nothign
m_DC[pn] = MultiSteps[i+1]->GetDifficulty();
}
m_DifficultyIcon[pn].SetFromDifficulty( pn, m_DC[pn] );
UpdateDifficulties( pn );
GAMESTATE->m_PreferredDifficulty[pn] = m_DC[pn];
}
}
@@ -521,7 +528,10 @@ void ScreenNetSelectMusic::TweenOffScreen()
OFF_COMMAND( m_rectDiff );
FOREACH_EnabledPlayer (pn)
{
OFF_COMMAND( m_DifficultyMeters[pn] );
OFF_COMMAND( m_DifficultyIcon[pn] );
}
}
@@ -550,12 +560,21 @@ void ScreenNetSelectMusic::StartSelectedSong()
Steps * pSteps = pSong->GetStepsByDifficulty(st,m_DC[pn]);
GAMESTATE->m_pCurSteps[pn] = pSteps;
}
GAMESTATE->m_pCurSong = pSong;
TweenOffScreen();
StartTransitioning( SM_GoToNextScreen );
}
void ScreenNetSelectMusic::UpdateDifficulties( PlayerNumber pn )
{
m_DifficultyIcon[pn].SetFromDifficulty( pn, m_DC[pn] );
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
if ( m_DC[pn] != NUM_DIFFICULTIES )
m_DifficultyMeters[pn].SetFromSteps( GAMESTATE->m_pCurSong->GetStepsByDifficulty( st, m_DC[pn] ) );
else
m_DifficultyMeters[pn].SetFromMeterAndDifficulty( 0, m_DC[pn] );
}
void ScreenNetSelectMusic::UpdateSongsListPos()
{
int i,j;
@@ -575,11 +594,13 @@ void ScreenNetSelectMusic::UpdateSongsListPos()
m_textArtist.SetText( m_vSongs[j]->GetTranslitArtist() );
m_textSubtitle.SetText( m_vSongs[j]->GetTranslitSubTitle() );
GAMESTATE->m_pCurSong = m_vSongs[j];
//Update the difficulty Icons
//Handle difficulty
FOREACH_EnabledPlayer (pn)
{
m_DC[pn] = GAMESTATE->m_PreferredDifficulty[pn];
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
vector <Steps *> MultiSteps;
MultiSteps = m_vSongs[j]->GetAllSteps( st );
@@ -596,10 +617,9 @@ void ScreenNetSelectMusic::UpdateSongsListPos()
else
m_DC[pn] = MultiSteps[i]->GetDifficulty();
}
m_DifficultyIcon[pn].SetFromDifficulty( pn, m_DC[pn] );
UpdateDifficulties( pn );
}
//Then handle sound (Copied from MusicBannerWheel)
SOUND->StopMusic();
Song* pSong = m_vSongs[j];
+5
View File
@@ -12,6 +12,7 @@
#include "ModeSwitcher.h"
#include "DifficultyIcon.h"
#include "Difficulty.h"
#include "DifficultyMeter.h"
class ScreenNetSelectMusic : public ScreenWithMenuElements
{
@@ -91,8 +92,12 @@ private:
DifficultyIcon m_DifficultyIcon[NUM_PLAYERS];
Difficulty m_DC[NUM_PLAYERS];
void UpdateDifficulties( PlayerNumber pn );
DifficultyMeter m_DifficultyMeters[NUM_PLAYERS];
RageSound m_soundChangeOpt;
RageSound m_soundChangeSel;
};
#endif