add metrics for NextSong and PrevSong buttons

This commit is contained in:
Chris Danford
2007-01-16 07:47:00 +00:00
parent ca92299c23
commit 56ca4a5a18
3 changed files with 16 additions and 15 deletions
+2
View File
@@ -510,6 +510,8 @@ OptionsMenuAvailable=OptionsMenuAvailable()
SelectMenuAvailable=false SelectMenuAvailable=false
ModeMenuAvailable=ModeMenuAvailable() ModeMenuAvailable=ModeMenuAvailable()
ScreenBeginCommand=setupmusicstagemods ScreenBeginCommand=setupmusicstagemods
PreviousSongButton="MenuLeft"
NextSongButton="MenuRight"
[ScreenSelectCourse] [ScreenSelectCourse]
Class="ScreenSelectMusic" Class="ScreenSelectMusic"
+10 -15
View File
@@ -69,6 +69,9 @@ void ScreenSelectMusic::Init()
SELECT_MENU_AVAILABLE.Load( m_sName, "SelectMenuAvailable" ); SELECT_MENU_AVAILABLE.Load( m_sName, "SelectMenuAvailable" );
MODE_MENU_AVAILABLE.Load( m_sName, "ModeMenuAvailable" ); MODE_MENU_AVAILABLE.Load( m_sName, "ModeMenuAvailable" );
m_GameButtonPreviousSong = INPUTMAPPER->GetInputScheme()->ButtonNameToIndex( THEME->GetMetric(m_sName,"PreviousSongButton") );
m_GameButtonNextSong = INPUTMAPPER->GetInputScheme()->ButtonNameToIndex( THEME->GetMetric(m_sName,"NextSongButton") );
LIGHTSMAN->SetLightsMode( LIGHTSMODE_MENU ); LIGHTSMAN->SetLightsMode( LIGHTSMODE_MENU );
/* Finish any previous stage. It's OK to call this when we havn't played a stage yet. /* Finish any previous stage. It's OK to call this when we havn't played a stage yet.
@@ -357,10 +360,8 @@ void ScreenSelectMusic::Input( const InputEventPlus &input )
return; return;
} }
switch( input.MenuI ) if( input.MenuI == m_GameButtonNextSong || input.MenuI == m_GameButtonPreviousSong )
{ {
case MENU_BUTTON_RIGHT:
case MENU_BUTTON_LEFT:
{ {
/* If we're rouletting, hands off. */ /* If we're rouletting, hands off. */
if( m_MusicWheel.IsRouletting() ) if( m_MusicWheel.IsRouletting() )
@@ -370,8 +371,8 @@ void ScreenSelectMusic::Input( const InputEventPlus &input )
bool bRightIsDown = false; bool bRightIsDown = false;
FOREACH_EnabledPlayer( p ) FOREACH_EnabledPlayer( p )
{ {
bLeftIsDown |= INPUTMAPPER->IsBeingPressed( MENU_BUTTON_LEFT, p ); bLeftIsDown |= INPUTMAPPER->IsBeingPressed( m_GameButtonPreviousSong, p );
bRightIsDown |= INPUTMAPPER->IsBeingPressed( MENU_BUTTON_RIGHT, p ); bRightIsDown |= INPUTMAPPER->IsBeingPressed( m_GameButtonNextSong, p );
} }
bool bBothDown = bLeftIsDown && bRightIsDown; bool bBothDown = bLeftIsDown && bRightIsDown;
@@ -388,15 +389,10 @@ void ScreenSelectMusic::Input( const InputEventPlus &input )
m_MusicWheel.Move( 0 ); m_MusicWheel.Move( 0 );
if( input.type == IET_FIRST_PRESS ) if( input.type == IET_FIRST_PRESS )
{ {
switch( input.MenuI ) if( input.MenuI == m_GameButtonPreviousSong )
{
case MENU_BUTTON_LEFT:
m_MusicWheel.ChangeMusicUnlessLocked( -1 ); m_MusicWheel.ChangeMusicUnlessLocked( -1 );
break; else if( input.MenuI == m_GameButtonNextSong )
case MENU_BUTTON_RIGHT:
m_MusicWheel.ChangeMusicUnlessLocked( +1 ); m_MusicWheel.ChangeMusicUnlessLocked( +1 );
break;
}
} }
} }
else if( bLeftIsDown ) else if( bLeftIsDown )
@@ -422,12 +418,11 @@ void ScreenSelectMusic::Input( const InputEventPlus &input )
{ {
FOREACH_HumanPlayer( p ) FOREACH_HumanPlayer( p )
{ {
INPUTMAPPER->ResetKeyRepeat( MENU_BUTTON_LEFT, p ); INPUTMAPPER->ResetKeyRepeat( m_GameButtonPreviousSong, p );
INPUTMAPPER->ResetKeyRepeat( MENU_BUTTON_RIGHT, p ); INPUTMAPPER->ResetKeyRepeat( m_GameButtonNextSong, p );
} }
} }
} }
break;
} }
if( input.type == IET_FIRST_PRESS && DetectCodes(input) ) if( input.type == IET_FIRST_PRESS && DetectCodes(input) )
+4
View File
@@ -14,6 +14,7 @@
#include "ThemeMetric.h" #include "ThemeMetric.h"
#include "RageTexturePreloader.h" #include "RageTexturePreloader.h"
#include "TimingData.h" #include "TimingData.h"
#include "GameInput.h"
class ScreenSelectMusic : public ScreenWithMenuElements class ScreenSelectMusic : public ScreenWithMenuElements
{ {
@@ -67,6 +68,9 @@ protected:
DynamicThemeMetric<bool> SELECT_MENU_AVAILABLE; DynamicThemeMetric<bool> SELECT_MENU_AVAILABLE;
DynamicThemeMetric<bool> MODE_MENU_AVAILABLE; DynamicThemeMetric<bool> MODE_MENU_AVAILABLE;
GameButton m_GameButtonPreviousSong;
GameButton m_GameButtonNextSong;
RString m_sSectionMusicPath; RString m_sSectionMusicPath;
RString m_sSortMusicPath; RString m_sSortMusicPath;
RString m_sRouletteMusicPath; RString m_sRouletteMusicPath;