Remove ShowAutoplayStatus, hold alt to hide autoplay text

This commit is contained in:
Chris Danford
2009-04-10 20:07:13 +00:00
parent f68f6df4c1
commit 03b5d2fc9a
3 changed files with 19 additions and 5 deletions
+12 -2
View File
@@ -26,6 +26,7 @@
#include "SongManager.h" #include "SongManager.h"
#include "GameLoop.h" #include "GameLoop.h"
#include "Song.h" #include "Song.h"
#include "ScreenSyncOverlay.h"
static bool g_bIsDisplayed = false; static bool g_bIsDisplayed = false;
static bool g_bIsSlow = false; static bool g_bIsSlow = false;
@@ -562,7 +563,7 @@ static LocalizedString SYNC_TEMPO ( "ScreenDebugOverlay", "Tempo" );
class DebugLineAutoplay : public IDebugLine class DebugLineAutoplay : public IDebugLine
{ {
virtual RString GetDisplayTitle() { return AUTO_PLAY.GetValue(); } virtual RString GetDisplayTitle() { return AUTO_PLAY.GetValue() + " (+Shift = AI) (+Alt = hide)"; }
virtual RString GetDisplayValue() virtual RString GetDisplayValue()
{ {
switch( GamePreferences::m_AutoPlay.Get() ) switch( GamePreferences::m_AutoPlay.Get() )
@@ -579,7 +580,9 @@ class DebugLineAutoplay : public IDebugLine
{ {
ASSERT( GAMESTATE->m_MasterPlayerNumber != PLAYER_INVALID ); ASSERT( GAMESTATE->m_MasterPlayerNumber != PLAYER_INVALID );
PlayerController pc = GAMESTATE->m_pPlayerState[GAMESTATE->m_MasterPlayerNumber]->m_PlayerController; PlayerController pc = GAMESTATE->m_pPlayerState[GAMESTATE->m_MasterPlayerNumber]->m_PlayerController;
bool bHoldingShift = INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_LSHIFT) ); bool bHoldingShift =
INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_LSHIFT) ) ||
INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_RSHIFT) );
if( bHoldingShift ) if( bHoldingShift )
pc = (pc==PC_CPU) ? PC_HUMAN : PC_CPU; pc = (pc==PC_CPU) ? PC_HUMAN : PC_CPU;
else else
@@ -589,6 +592,13 @@ class DebugLineAutoplay : public IDebugLine
GAMESTATE->m_pPlayerState[p]->m_PlayerController = GamePreferences::m_AutoPlay; GAMESTATE->m_pPlayerState[p]->m_PlayerController = GamePreferences::m_AutoPlay;
FOREACH_MultiPlayer(p) FOREACH_MultiPlayer(p)
GAMESTATE->m_pMultiPlayerState[p]->m_PlayerController = GamePreferences::m_AutoPlay; GAMESTATE->m_pMultiPlayerState[p]->m_PlayerController = GamePreferences::m_AutoPlay;
// Hide Autoplay if Alt is held down
bool bHoldingAlt =
INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_LALT) ) ||
INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_RALT) );
ScreenSyncOverlay::SetShowAutoplay( !bHoldingAlt );
IDebugLine::DoAndLog( sMessageOut ); IDebugLine::DoAndLog( sMessageOut );
} }
}; };
+6 -3
View File
@@ -37,7 +37,6 @@ void ScreenSyncOverlay::Init()
m_textHelp.SetHorizAlign( align_left ); m_textHelp.SetHorizAlign( align_left );
m_textHelp.SetXY( SCREEN_CENTER_X+20, SCREEN_TOP+100 ); m_textHelp.SetXY( SCREEN_CENTER_X+20, SCREEN_TOP+100 );
m_textHelp.SetDiffuseAlpha( 0 ); m_textHelp.SetDiffuseAlpha( 0 );
m_textHelp.SetZoom( 0.6f );
m_textHelp.SetShadowLength( 2 ); m_textHelp.SetShadowLength( 2 );
m_textHelp.SetText( m_textHelp.SetText(
REVERT_SYNC_CHANGES.GetValue()+":\n" REVERT_SYNC_CHANGES.GetValue()+":\n"
@@ -81,7 +80,11 @@ void ScreenSyncOverlay::Update( float fDeltaTime )
UpdateText(); UpdateText();
} }
static Preference<bool> g_bShowAutoPlayStatus( "ShowAutoPlayStatus", true ); bool g_bShowAutoplay = true;
void ScreenSyncOverlay::SetShowAutoplay( bool b )
{
g_bShowAutoplay = b;
}
static LocalizedString AUTO_PLAY ( "ScreenSyncOverlay", "AutoPlay" ); static LocalizedString AUTO_PLAY ( "ScreenSyncOverlay", "AutoPlay" );
static LocalizedString AUTO_PLAY_CPU ( "ScreenSyncOverlay", "AutoPlayCPU" ); static LocalizedString AUTO_PLAY_CPU ( "ScreenSyncOverlay", "AutoPlayCPU" );
@@ -99,7 +102,7 @@ void ScreenSyncOverlay::UpdateText()
// //
vector<RString> vs; vector<RString> vs;
if( g_bShowAutoPlayStatus ) if( g_bShowAutoplay )
{ {
switch( GamePreferences::m_AutoPlay.Get() ) switch( GamePreferences::m_AutoPlay.Get() )
{ {
+1
View File
@@ -16,6 +16,7 @@ public:
void Update( float fDeltaTime ); void Update( float fDeltaTime );
static void SetShowAutoplay( bool b );
private: private:
void UpdateText(); void UpdateText();
void ShowHelp(); void ShowHelp();