move AutoPlay

This commit is contained in:
Glenn Maynard
2006-11-21 05:02:55 +00:00
parent 186f47df98
commit f0dab15f30
11 changed files with 23 additions and 20 deletions
+1
View File
@@ -4,6 +4,7 @@
// This options has weird interactions depending on m_bEventMode; // This options has weird interactions depending on m_bEventMode;
// use GameState::GetCoinMode(). // use GameState::GetCoinMode().
Preference<CoinMode> GamePreferences::m_CoinMode( "CoinMode", COIN_MODE_HOME ); Preference<CoinMode> GamePreferences::m_CoinMode( "CoinMode", COIN_MODE_HOME );
Preference<PlayerController> GamePreferences::m_AutoPlay( "AutoPlay", PC_HUMAN );
/* /*
+1
View File
@@ -7,6 +7,7 @@
namespace GamePreferences namespace GamePreferences
{ {
extern Preference<CoinMode> m_CoinMode; extern Preference<CoinMode> m_CoinMode;
extern Preference<PlayerController> m_AutoPlay;
}; };
#endif #endif
-2
View File
@@ -180,8 +180,6 @@ PrefsManager::PrefsManager() :
m_bFailOffForFirstStageEasy ( "FailOffForFirstStageEasy", false ), m_bFailOffForFirstStageEasy ( "FailOffForFirstStageEasy", false ),
m_bMercifulBeginner ( "MercifulBeginner", false ), m_bMercifulBeginner ( "MercifulBeginner", false ),
m_bMercifulSuperMeter ( "MercifulSuperMeter", true ), m_bMercifulSuperMeter ( "MercifulSuperMeter", true ),
m_AutoPlay ( "AutoPlay", PC_HUMAN ),
m_bDelayedBack ( "DelayedBack", true ), m_bDelayedBack ( "DelayedBack", true ),
m_bShowInstructions ( "ShowInstructions", true ), m_bShowInstructions ( "ShowInstructions", true ),
m_bShowSelectGroup ( "ShowSelectGroup", false ), m_bShowSelectGroup ( "ShowSelectGroup", false ),
-2
View File
@@ -140,8 +140,6 @@ public:
Preference<bool> m_bFailOffForFirstStageEasy; Preference<bool> m_bFailOffForFirstStageEasy;
Preference<bool> m_bMercifulBeginner; // don't subtract from percent score or grade DP, larger W5 window Preference<bool> m_bMercifulBeginner; // don't subtract from percent score or grade DP, larger W5 window
Preference<bool> m_bMercifulSuperMeter; // negative super deltas are scaled by the players life percentage Preference<bool> m_bMercifulSuperMeter; // negative super deltas are scaled by the players life percentage
Preference<PlayerController> m_AutoPlay;
Preference<bool> m_bDelayedBack; Preference<bool> m_bDelayedBack;
Preference<bool> m_bShowInstructions; Preference<bool> m_bShowInstructions;
Preference<bool> m_bShowSelectGroup; Preference<bool> m_bShowSelectGroup;
+2 -1
View File
@@ -2,6 +2,7 @@
#include "ScoreKeeperNormal.h" #include "ScoreKeeperNormal.h"
#include "GameState.h" #include "GameState.h"
#include "PrefsManager.h" #include "PrefsManager.h"
#include "GamePreferences.h"
#include "Steps.h" #include "Steps.h"
#include "ScreenManager.h" #include "ScreenManager.h"
#include "GameState.h" #include "GameState.h"
@@ -460,7 +461,7 @@ void ScoreKeeperNormal::HandleTapRowScore( const NoteData &nd, int iRow )
// handle combo logic // handle combo logic
// //
#ifndef DEBUG #ifndef DEBUG
if( PREFSMAN->m_AutoPlay != PC_HUMAN && !GAMESTATE->m_bDemonstrationOrJukebox ) // cheaters never prosper if( GamePreferences::m_AutoPlay != PC_HUMAN && !GAMESTATE->m_bDemonstrationOrJukebox ) // cheaters never prosper
{ {
m_iCurToastyCombo = 0; m_iCurToastyCombo = 0;
return; return;
+5 -5
View File
@@ -450,7 +450,7 @@ class DebugLineAutoplay : public IDebugLine
virtual RString GetDescription() { return AUTO_PLAY.GetValue(); } virtual RString GetDescription() { return AUTO_PLAY.GetValue(); }
virtual RString GetValue() virtual RString GetValue()
{ {
switch( PREFSMAN->m_AutoPlay ) switch( GamePreferences::m_AutoPlay )
{ {
case PC_HUMAN: return OFF.GetValue(); break; case PC_HUMAN: return OFF.GetValue(); break;
case PC_AUTOPLAY: return ON.GetValue(); break; case PC_AUTOPLAY: return ON.GetValue(); break;
@@ -459,7 +459,7 @@ class DebugLineAutoplay : public IDebugLine
} }
} }
virtual Type GetType() const { return IDebugLine::gameplay_only; } virtual Type GetType() const { return IDebugLine::gameplay_only; }
virtual bool IsEnabled() { return PREFSMAN->m_AutoPlay.Get() != PC_HUMAN; } virtual bool IsEnabled() { return GamePreferences::m_AutoPlay.Get() != PC_HUMAN; }
virtual void Do( RString &sMessageOut ) virtual void Do( RString &sMessageOut )
{ {
ASSERT( GAMESTATE->m_MasterPlayerNumber != PLAYER_INVALID ); ASSERT( GAMESTATE->m_MasterPlayerNumber != PLAYER_INVALID );
@@ -469,11 +469,11 @@ class DebugLineAutoplay : public IDebugLine
pc = (pc==PC_CPU) ? PC_HUMAN : PC_CPU; pc = (pc==PC_CPU) ? PC_HUMAN : PC_CPU;
else else
pc = (pc==PC_AUTOPLAY) ? PC_HUMAN : PC_AUTOPLAY; pc = (pc==PC_AUTOPLAY) ? PC_HUMAN : PC_AUTOPLAY;
PREFSMAN->m_AutoPlay.Set( pc ); GamePreferences::m_AutoPlay.Set( pc );
FOREACH_HumanPlayer(p) FOREACH_HumanPlayer(p)
GAMESTATE->m_pPlayerState[p]->m_PlayerController = PREFSMAN->m_AutoPlay; GAMESTATE->m_pPlayerState[p]->m_PlayerController = GamePreferences::m_AutoPlay;
FOREACH_MultiPlayer(p) FOREACH_MultiPlayer(p)
GAMESTATE->m_pMultiPlayerState[p]->m_PlayerController = PREFSMAN->m_AutoPlay; GAMESTATE->m_pMultiPlayerState[p]->m_PlayerController = GamePreferences::m_AutoPlay;
IDebugLine::Do( sMessageOut ); IDebugLine::Do( sMessageOut );
} }
}; };
+5 -4
View File
@@ -1,6 +1,7 @@
#include "global.h" #include "global.h"
#include "ScreenEdit.h" #include "ScreenEdit.h"
#include "PrefsManager.h" #include "PrefsManager.h"
#include "GamePreferences.h"
#include "SongManager.h" #include "SongManager.h"
#include "ScreenManager.h" #include "ScreenManager.h"
#include "ScreenSaveSync.h" #include "ScreenSaveSync.h"
@@ -2035,9 +2036,9 @@ void ScreenEdit::InputPlay( const InputEventPlus &input, EditButton EditB )
break; break;
case EDIT_BUTTON_TOGGLE_AUTOPLAY: case EDIT_BUTTON_TOGGLE_AUTOPLAY:
{ {
PREFSMAN->m_AutoPlay.Set( PREFSMAN->m_AutoPlay!=PC_HUMAN ? PC_HUMAN:PC_AUTOPLAY ); GamePreferences::m_AutoPlay.Set( GamePreferences::m_AutoPlay!=PC_HUMAN ? PC_HUMAN:PC_AUTOPLAY );
FOREACH_HumanPlayer( p ) FOREACH_HumanPlayer( p )
GAMESTATE->m_pPlayerState[p]->m_PlayerController = PREFSMAN->m_AutoPlay; GAMESTATE->m_pPlayerState[p]->m_PlayerController = GamePreferences::m_AutoPlay;
} }
break; break;
case EDIT_BUTTON_OFFSET_UP: case EDIT_BUTTON_OFFSET_UP:
@@ -2075,7 +2076,7 @@ void ScreenEdit::InputPlay( const InputEventPlus &input, EditButton EditB )
const int iCol = GAMESTATE->GetCurrentStyle()->GameInputToColumn( input.GameI ); const int iCol = GAMESTATE->GetCurrentStyle()->GameInputToColumn( input.GameI );
if( PREFSMAN->m_AutoPlay != PC_HUMAN || iCol == -1 ) if( GamePreferences::m_AutoPlay != PC_HUMAN || iCol == -1 )
return; return;
switch( input.pn ) switch( input.pn )
@@ -2224,7 +2225,7 @@ void ScreenEdit::TransitionEditState( EditState em )
SetupCourseAttacks(); SetupCourseAttacks();
m_Player.Load( m_NoteDataEdit ); m_Player.Load( m_NoteDataEdit );
GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerController = PREFSMAN->m_AutoPlay; GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerController = GamePreferences::m_AutoPlay;
if( g_bEditorShowBGChangesPlay ) if( g_bEditorShowBGChangesPlay )
{ {
+3 -2
View File
@@ -4,6 +4,7 @@
#include "ScreenManager.h" #include "ScreenManager.h"
#include "GameConstantsAndTypes.h" #include "GameConstantsAndTypes.h"
#include "PrefsManager.h" #include "PrefsManager.h"
#include "GamePreferences.h"
#include "GameManager.h" #include "GameManager.h"
#include "RageFileManager.h" #include "RageFileManager.h"
#include "Steps.h" #include "Steps.h"
@@ -1122,7 +1123,7 @@ void ScreenGameplay::LoadNextSong()
} }
else else
{ {
pi->GetPlayerState()->m_PlayerController = PREFSMAN->m_AutoPlay; pi->GetPlayerState()->m_PlayerController = GamePreferences::m_AutoPlay;
} }
} }
} }
@@ -2182,7 +2183,7 @@ void ScreenGameplay::Input( const InputEventPlus &input )
{ {
AbortGiveUp( true ); AbortGiveUp( true );
if( PREFSMAN->m_AutoPlay == PC_HUMAN ) if( GamePreferences::m_AutoPlay == PC_HUMAN )
{ {
PlayerInfo& pi = GetPlayerInfoForInput( input ); PlayerInfo& pi = GetPlayerInfoForInput( input );
+2 -2
View File
@@ -2,7 +2,7 @@
#include "ScreenGameplayLesson.h" #include "ScreenGameplayLesson.h"
#include "RageLog.h" #include "RageLog.h"
#include "GameState.h" #include "GameState.h"
#include "PrefsManager.h" #include "GamePreferences.h"
#include "StatsManager.h" #include "StatsManager.h"
#include "song.h" #include "song.h"
@@ -165,7 +165,7 @@ void ScreenGameplayLesson::ChangeLessonPage( int iDir )
// Change back to the current autoplay setting (in most cases, human controlled). // Change back to the current autoplay setting (in most cases, human controlled).
FOREACH_EnabledPlayerInfo( m_vPlayerInfo, pi ) FOREACH_EnabledPlayerInfo( m_vPlayerInfo, pi )
pi->GetPlayerState()->m_PlayerController = PREFSMAN->m_AutoPlay; pi->GetPlayerState()->m_PlayerController = GamePreferences::m_AutoPlay;
} }
else else
{ {
+2 -1
View File
@@ -4,6 +4,7 @@
#include "GameState.h" #include "GameState.h"
#include "GameManager.h" #include "GameManager.h"
#include "PrefsManager.h" #include "PrefsManager.h"
#include "GamePreferences.h"
#include "AdjustSync.h" #include "AdjustSync.h"
#include "ScreenDimensions.h" #include "ScreenDimensions.h"
#include "InputEventPlus.h" #include "InputEventPlus.h"
@@ -28,7 +29,7 @@ void ScreenGameplaySyncMachine::Init()
ASSERT( pSteps ); ASSERT( pSteps );
GAMESTATE->m_pCurSteps[0].Set( pSteps ); GAMESTATE->m_pCurSteps[0].Set( pSteps );
PREFSMAN->m_AutoPlay.Set( PC_HUMAN ); GamePreferences::m_AutoPlay.Set( PC_HUMAN );
ScreenGameplayNormal::Init(); ScreenGameplayNormal::Init();
+2 -1
View File
@@ -5,6 +5,7 @@
#include "GameState.h" #include "GameState.h"
#include "song.h" #include "song.h"
#include "PrefsManager.h" #include "PrefsManager.h"
#include "GamePreferences.h"
#include "InputEventPlus.h" #include "InputEventPlus.h"
#include "LocalizedString.h" #include "LocalizedString.h"
#include "AdjustSync.h" #include "AdjustSync.h"
@@ -90,7 +91,7 @@ void ScreenSyncOverlay::UpdateText()
if( g_bShowAutoPlayStatus ) if( g_bShowAutoPlayStatus )
{ {
switch( PREFSMAN->m_AutoPlay ) switch( GamePreferences::m_AutoPlay )
{ {
case PC_HUMAN: break; case PC_HUMAN: break;
case PC_AUTOPLAY: vs.push_back(AUTO_PLAY); break; case PC_AUTOPLAY: vs.push_back(AUTO_PLAY); break;