Added DifficultyMeter to ScreenNetSelectMusic.
This commit is contained in:
@@ -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
|
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
|
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
|
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
|
DifficultyIconP1Y=400
|
||||||
DifficultyIconP1X=230
|
DifficultyIconP1X=230
|
||||||
DifficultyIconP1OnCommand=zoomx,0;zoomy,0;linear,0.5;zoomx,1.0;zoomy,1.0
|
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
|
# when using entries that change the screen; otherwise, the only way to
|
||||||
# exit the screen when in regular mode is "exit".
|
# 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
|
OptionMenuFlags=together;forceallplayers;smnavigation
|
||||||
# This NextScreen is only used for the "exit" choice.
|
# This NextScreen is only used for the "exit" choice.
|
||||||
Line1=list,Appearance Options
|
Line1=list,Appearance Options
|
||||||
@@ -4096,6 +4104,7 @@ Line12=list,Profile Options
|
|||||||
Line13=list,Other Options
|
Line13=list,Other Options
|
||||||
Line14=list,Reload Songs/Courses
|
Line14=list,Reload Songs/Courses
|
||||||
Line15=list,Test Input
|
Line15=list,Test Input
|
||||||
|
Line16=list,Network Options
|
||||||
|
|
||||||
[TextBanner]
|
[TextBanner]
|
||||||
TitleX=-90
|
TitleX=-90
|
||||||
|
|||||||
@@ -169,6 +169,11 @@ ScreenNetSelectMusic::ScreenNetSelectMusic( const CString& sName ) : ScreenWithM
|
|||||||
ON_COMMAND( m_DifficultyIcon[p] );
|
ON_COMMAND( m_DifficultyIcon[p] );
|
||||||
m_DC[p] = GAMESTATE->m_PreferredDifficulty[p];
|
m_DC[p] = GAMESTATE->m_PreferredDifficulty[p];
|
||||||
m_DifficultyIcon[p].SetFromDifficulty( p, m_DC[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;
|
m_SelectMode = SelectGroup;
|
||||||
@@ -404,7 +409,7 @@ void ScreenNetSelectMusic::MenuLeft( PlayerNumber pn, const InputEventType type
|
|||||||
case SelectDifficulty:
|
case SelectDifficulty:
|
||||||
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
|
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
|
||||||
vector <Steps *> MultiSteps;
|
vector <Steps *> MultiSteps;
|
||||||
MultiSteps = m_vSongs[m_iSongNum % m_vSongs.size()]->GetAllSteps( st );
|
MultiSteps = GAMESTATE->m_pCurSong->GetAllSteps( st );
|
||||||
if (MultiSteps.size() == 0)
|
if (MultiSteps.size() == 0)
|
||||||
m_DC[pn] = NUM_DIFFICULTIES;
|
m_DC[pn] = NUM_DIFFICULTIES;
|
||||||
else
|
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
|
if (i > 0) //If we are at the easiest difficulty, do nothign
|
||||||
m_DC[pn] = MultiSteps[i-1]->GetDifficulty();
|
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:
|
case SelectDifficulty:
|
||||||
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
|
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
|
||||||
vector <Steps *> MultiSteps;
|
vector <Steps *> MultiSteps;
|
||||||
MultiSteps = m_vSongs[m_iSongNum % m_vSongs.size()]->GetAllSteps( st );
|
MultiSteps = GAMESTATE->m_pCurSong->GetAllSteps( st );
|
||||||
if (MultiSteps.size() == 0)
|
if (MultiSteps.size() == 0)
|
||||||
m_DC[pn] = NUM_DIFFICULTIES;
|
m_DC[pn] = NUM_DIFFICULTIES;
|
||||||
else
|
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
|
if (i < (int)MultiSteps.size() - 1 ) //If we are at the hardest difficulty, do nothign
|
||||||
m_DC[pn] = MultiSteps[i+1]->GetDifficulty();
|
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 );
|
OFF_COMMAND( m_rectDiff );
|
||||||
|
|
||||||
FOREACH_EnabledPlayer (pn)
|
FOREACH_EnabledPlayer (pn)
|
||||||
|
{
|
||||||
|
OFF_COMMAND( m_DifficultyMeters[pn] );
|
||||||
OFF_COMMAND( m_DifficultyIcon[pn] );
|
OFF_COMMAND( m_DifficultyIcon[pn] );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -550,12 +560,21 @@ void ScreenNetSelectMusic::StartSelectedSong()
|
|||||||
Steps * pSteps = pSong->GetStepsByDifficulty(st,m_DC[pn]);
|
Steps * pSteps = pSong->GetStepsByDifficulty(st,m_DC[pn]);
|
||||||
GAMESTATE->m_pCurSteps[pn] = pSteps;
|
GAMESTATE->m_pCurSteps[pn] = pSteps;
|
||||||
}
|
}
|
||||||
GAMESTATE->m_pCurSong = pSong;
|
|
||||||
|
|
||||||
TweenOffScreen();
|
TweenOffScreen();
|
||||||
StartTransitioning( SM_GoToNextScreen );
|
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()
|
void ScreenNetSelectMusic::UpdateSongsListPos()
|
||||||
{
|
{
|
||||||
int i,j;
|
int i,j;
|
||||||
@@ -575,11 +594,13 @@ void ScreenNetSelectMusic::UpdateSongsListPos()
|
|||||||
|
|
||||||
m_textArtist.SetText( m_vSongs[j]->GetTranslitArtist() );
|
m_textArtist.SetText( m_vSongs[j]->GetTranslitArtist() );
|
||||||
m_textSubtitle.SetText( m_vSongs[j]->GetTranslitSubTitle() );
|
m_textSubtitle.SetText( m_vSongs[j]->GetTranslitSubTitle() );
|
||||||
|
GAMESTATE->m_pCurSong = m_vSongs[j];
|
||||||
|
|
||||||
//Update the difficulty Icons
|
//Update the difficulty Icons
|
||||||
//Handle difficulty
|
//Handle difficulty
|
||||||
FOREACH_EnabledPlayer (pn)
|
FOREACH_EnabledPlayer (pn)
|
||||||
{
|
{
|
||||||
|
m_DC[pn] = GAMESTATE->m_PreferredDifficulty[pn];
|
||||||
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
|
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
|
||||||
vector <Steps *> MultiSteps;
|
vector <Steps *> MultiSteps;
|
||||||
MultiSteps = m_vSongs[j]->GetAllSteps( st );
|
MultiSteps = m_vSongs[j]->GetAllSteps( st );
|
||||||
@@ -596,10 +617,9 @@ void ScreenNetSelectMusic::UpdateSongsListPos()
|
|||||||
else
|
else
|
||||||
m_DC[pn] = MultiSteps[i]->GetDifficulty();
|
m_DC[pn] = MultiSteps[i]->GetDifficulty();
|
||||||
}
|
}
|
||||||
m_DifficultyIcon[pn].SetFromDifficulty( pn, m_DC[pn] );
|
UpdateDifficulties( pn );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Then handle sound (Copied from MusicBannerWheel)
|
//Then handle sound (Copied from MusicBannerWheel)
|
||||||
SOUND->StopMusic();
|
SOUND->StopMusic();
|
||||||
Song* pSong = m_vSongs[j];
|
Song* pSong = m_vSongs[j];
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
#include "ModeSwitcher.h"
|
#include "ModeSwitcher.h"
|
||||||
#include "DifficultyIcon.h"
|
#include "DifficultyIcon.h"
|
||||||
#include "Difficulty.h"
|
#include "Difficulty.h"
|
||||||
|
#include "DifficultyMeter.h"
|
||||||
|
|
||||||
class ScreenNetSelectMusic : public ScreenWithMenuElements
|
class ScreenNetSelectMusic : public ScreenWithMenuElements
|
||||||
{
|
{
|
||||||
@@ -91,8 +92,12 @@ private:
|
|||||||
DifficultyIcon m_DifficultyIcon[NUM_PLAYERS];
|
DifficultyIcon m_DifficultyIcon[NUM_PLAYERS];
|
||||||
Difficulty m_DC[NUM_PLAYERS];
|
Difficulty m_DC[NUM_PLAYERS];
|
||||||
|
|
||||||
|
void UpdateDifficulties( PlayerNumber pn );
|
||||||
|
DifficultyMeter m_DifficultyMeters[NUM_PLAYERS];
|
||||||
|
|
||||||
RageSound m_soundChangeOpt;
|
RageSound m_soundChangeOpt;
|
||||||
RageSound m_soundChangeSel;
|
RageSound m_soundChangeSel;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user