From 03b5d2fc9a32a7cfba777ac9b2e6e8c7e47e5768 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Fri, 10 Apr 2009 20:07:13 +0000 Subject: [PATCH] Remove ShowAutoplayStatus, hold alt to hide autoplay text --- stepmania/src/ScreenDebugOverlay.cpp | 14 ++++++++++++-- stepmania/src/ScreenSyncOverlay.cpp | 9 ++++++--- stepmania/src/ScreenSyncOverlay.h | 1 + 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/stepmania/src/ScreenDebugOverlay.cpp b/stepmania/src/ScreenDebugOverlay.cpp index 0777637574..53f223e61f 100644 --- a/stepmania/src/ScreenDebugOverlay.cpp +++ b/stepmania/src/ScreenDebugOverlay.cpp @@ -26,6 +26,7 @@ #include "SongManager.h" #include "GameLoop.h" #include "Song.h" +#include "ScreenSyncOverlay.h" static bool g_bIsDisplayed = false; static bool g_bIsSlow = false; @@ -562,7 +563,7 @@ static LocalizedString SYNC_TEMPO ( "ScreenDebugOverlay", "Tempo" ); 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() { switch( GamePreferences::m_AutoPlay.Get() ) @@ -579,7 +580,9 @@ class DebugLineAutoplay : public IDebugLine { ASSERT( GAMESTATE->m_MasterPlayerNumber != PLAYER_INVALID ); 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 ) pc = (pc==PC_CPU) ? PC_HUMAN : PC_CPU; else @@ -589,6 +592,13 @@ class DebugLineAutoplay : public IDebugLine GAMESTATE->m_pPlayerState[p]->m_PlayerController = GamePreferences::m_AutoPlay; FOREACH_MultiPlayer(p) 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 ); } }; diff --git a/stepmania/src/ScreenSyncOverlay.cpp b/stepmania/src/ScreenSyncOverlay.cpp index 12f4c8fa8e..90bd4a5443 100644 --- a/stepmania/src/ScreenSyncOverlay.cpp +++ b/stepmania/src/ScreenSyncOverlay.cpp @@ -37,7 +37,6 @@ void ScreenSyncOverlay::Init() m_textHelp.SetHorizAlign( align_left ); m_textHelp.SetXY( SCREEN_CENTER_X+20, SCREEN_TOP+100 ); m_textHelp.SetDiffuseAlpha( 0 ); - m_textHelp.SetZoom( 0.6f ); m_textHelp.SetShadowLength( 2 ); m_textHelp.SetText( REVERT_SYNC_CHANGES.GetValue()+":\n" @@ -81,7 +80,11 @@ void ScreenSyncOverlay::Update( float fDeltaTime ) UpdateText(); } -static Preference 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_CPU ( "ScreenSyncOverlay", "AutoPlayCPU" ); @@ -99,7 +102,7 @@ void ScreenSyncOverlay::UpdateText() // vector vs; - if( g_bShowAutoPlayStatus ) + if( g_bShowAutoplay ) { switch( GamePreferences::m_AutoPlay.Get() ) { diff --git a/stepmania/src/ScreenSyncOverlay.h b/stepmania/src/ScreenSyncOverlay.h index 7890ff781d..38c3b978e4 100644 --- a/stepmania/src/ScreenSyncOverlay.h +++ b/stepmania/src/ScreenSyncOverlay.h @@ -16,6 +16,7 @@ public: void Update( float fDeltaTime ); + static void SetShowAutoplay( bool b ); private: void UpdateText(); void ShowHelp();