Add optoin to make pad escape instant.

This commit is contained in:
Glenn Maynard
2002-08-22 03:35:33 +00:00
parent 09b89aa400
commit a87562116b
4 changed files with 27 additions and 17 deletions
+3
View File
@@ -48,6 +48,7 @@ PrefsManager::PrefsManager()
m_fLifeDifficultyScale = 1.0f;
m_iMovieDecodeMS = 2;
m_bUseBGIfNoBanner = false;
m_bDelayedEscape = true;
ReadGlobalPrefsFromDisk( true );
}
@@ -83,6 +84,7 @@ void PrefsManager::ReadGlobalPrefsFromDisk( bool bSwitchToLastPlayedGame )
ini.GetValueF( "Options", "LifeDifficultyScale", m_fLifeDifficultyScale );
ini.GetValueI( "Options", "MovieDecodeMS", m_iMovieDecodeMS );
ini.GetValueB( "Options", "UseBGIfNoBanner", m_bUseBGIfNoBanner );
ini.GetValueB( "Options", "DelayedEscape", m_bDelayedEscape );
m_asAdditionalSongFolders.RemoveAll();
CString sAdditionalSongFolders;
@@ -121,6 +123,7 @@ void PrefsManager::SaveGlobalPrefsToDisk()
ini.SetValueF( "Options", "LifeDifficultyScale", m_fLifeDifficultyScale );
ini.SetValueI( "Options", "MovieDecodeMS", m_iMovieDecodeMS );
ini.SetValueB( "Options", "UseBGIfNoBanner", m_bUseBGIfNoBanner );
ini.SetValueB( "Options", "DelayedEscape", m_bDelayedEscape );
ini.SetValue( "Options", "AdditionalSongFolders", join(",", m_asAdditionalSongFolders) );
+11 -9
View File
@@ -31,21 +31,23 @@ public:
int m_iDisplayResolution;
int m_iTextureResolution;
int m_iRefreshRate; // 0 means 'default'
bool m_bIgnoreJoyAxes;
bool m_bOnlyDedicatedMenuButtons;
bool m_bShowStats;
BackgroundMode m_BackgroundMode;
bool m_bShowDanger;
float m_fBGBrightness;
bool m_bMenuTimer;
bool m_bEventMode;
int m_iNumArcadeStages;
bool m_bAutoPlay;
float m_fJudgeWindow;
float m_fLifeDifficultyScale;
int m_iMovieDecodeMS;
bool m_bUseBGIfNoBanner;
bool m_bIgnoreJoyAxes;
bool m_bOnlyDedicatedMenuButtons;
bool m_bMenuTimer;
bool m_bShowDanger;
int m_iNumArcadeStages;
bool m_bEventMode;
float m_fJudgeWindow;
float m_fLifeDifficultyScale;
bool m_bAutoPlay;
bool m_bDelayedEscape;
CStringArray m_asAdditionalSongFolders;
int GetDisplayHeight();
+7 -1
View File
@@ -46,12 +46,18 @@ void Screen::Update( float fDeltaTime )
}
}
void Screen::MenuBack( const PlayerNumber p, const InputEventType type )
{
if(!PREFSMAN->m_bDelayedEscape || type==IET_SLOW_REPEAT || type==IET_FAST_REPEAT)
MenuBack(p);
}
void Screen::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
{
/* Don't send release messages with the default handler. */
if(type == IET_RELEASE) return; // don't care
// don't make user hold back button if they're pressing escape
/* Don't make the user hold the back button if they're pressing escape. */
if( DeviceI.device == DEVICE_KEYBOARD && DeviceI.button == DIK_ESCAPE )
{
this->MenuBack( MenuI.player );
+6 -7
View File
@@ -50,12 +50,12 @@ protected:
public:
// let subclass override if they want
virtual void MenuUp( const PlayerNumber p, const InputEventType type ) { if(type==IET_FIRST_PRESS) MenuUp(p); };
virtual void MenuDown( const PlayerNumber p, const InputEventType type ) { if(type==IET_FIRST_PRESS) MenuDown(p); };
virtual void MenuLeft( const PlayerNumber p, const InputEventType type ) { if(type==IET_FIRST_PRESS) MenuLeft(p); };
virtual void MenuRight( const PlayerNumber p, const InputEventType type ) { if(type==IET_FIRST_PRESS) MenuRight(p); };
virtual void MenuStart( const PlayerNumber p, const InputEventType type ) { if(type==IET_FIRST_PRESS) MenuStart(p); };
virtual void MenuBack( const PlayerNumber p, const InputEventType type ) { if(type==IET_SLOW_REPEAT || type==IET_FAST_REPEAT) MenuBack(p); };
virtual void MenuUp( const PlayerNumber p, const InputEventType type ) { if(type==IET_FIRST_PRESS) MenuUp(p); }
virtual void MenuDown( const PlayerNumber p, const InputEventType type ) { if(type==IET_FIRST_PRESS) MenuDown(p); }
virtual void MenuLeft( const PlayerNumber p, const InputEventType type ) { if(type==IET_FIRST_PRESS) MenuLeft(p); }
virtual void MenuRight( const PlayerNumber p, const InputEventType type ) { if(type==IET_FIRST_PRESS) MenuRight(p); }
virtual void MenuStart( const PlayerNumber p, const InputEventType type ) { if(type==IET_FIRST_PRESS) MenuStart(p); }
virtual void MenuBack( const PlayerNumber p, const InputEventType type );
virtual void MenuUp( const PlayerNumber p ) {};
virtual void MenuDown( const PlayerNumber p ) {};
@@ -63,5 +63,4 @@ public:
virtual void MenuRight( const PlayerNumber p ) {};
virtual void MenuStart( const PlayerNumber p ) {};
virtual void MenuBack( const PlayerNumber p ) {};
};