use Dialog

This commit is contained in:
Glenn Maynard
2004-06-10 22:47:51 +00:00
parent 77c42f991d
commit 211f9b852a
10 changed files with 41 additions and 42 deletions
+2 -2
View File
@@ -6,7 +6,7 @@
#include "RageMath.h"
#include "GameConstantsAndTypes.h"
#include "RageLog.h"
#include "arch/ArchHooks/ArchHooks.h"
#include "arch/Dialog/Dialog.h"
#include "GameState.h" /* XXX: ugly dependency */
@@ -745,7 +745,7 @@ void Actor::HandleCommand( const ParsedCommand &command )
{
CString sError = ssprintf( "Actor::HandleCommand: Unrecognized command name '%s'.", sName.c_str() );
LOG->Warn( sError );
HOOKS->MessageBoxOK( sError );
Dialog::OK( sError );
}
CheckHandledParams;
+2 -2
View File
@@ -2,14 +2,14 @@
#include "ActorCommands.h"
#include "RageUtil.h"
#include "RageLog.h"
#include "arch/ArchHooks/ArchHooks.h"
#include "arch/Dialog/Dialog.h"
void IncorrectActorParametersWarning( const ParsedCommand &command, int iMaxIndexAccessed )
{
const CString sError = ssprintf( "Actor::HandleCommand: Wrong number of parameters in command '%s'. Expected %d but there are %u.",
command.GetOriginalCommandString().c_str(), iMaxIndexAccessed+1, unsigned(command.vTokens.size()) );
LOG->Warn( sError );
HOOKS->MessageBoxOK( sError );
Dialog::OK( sError );
}
void ParsedCommandToken::Set( const CString &sToken )
+2 -2
View File
@@ -1,6 +1,6 @@
#include "global.h"
#include "ActorFrame.h"
#include "arch/ArchHooks/ArchHooks.h"
#include "arch/Dialog/Dialog.h"
#include "RageUtil.h"
void ActorFrame::AddChild( Actor* pActor )
@@ -9,7 +9,7 @@ void ActorFrame::AddChild( Actor* pActor )
// check that this Actor isn't already added.
vector<Actor*>::iterator iter = find( m_SubActors.begin(), m_SubActors.end(), pActor );
if( iter != m_SubActors.end() )
HOOKS->MessageBoxOK( ssprintf("Actor \"%s\" adds child \"%s\" more than once", m_sName.c_str(), pActor->m_sName.c_str()) );
Dialog::OK( ssprintf("Actor \"%s\" adds child \"%s\" more than once", m_sName.c_str(), pActor->m_sName.c_str()) );
#endif
ASSERT( pActor );
+2 -2
View File
@@ -10,7 +10,7 @@
#include "RageFile.h"
#include "ActorUtil.h"
#include "LuaHelpers.h"
#include "arch/ArchHooks/ArchHooks.h"
#include "arch/Dialog/Dialog.h"
const int MAX_LAYERS = 1000;
@@ -133,7 +133,7 @@ void BGAnimation::LoadFromAniDir( CString sAniDir )
#define REQUIRED_GET_VALUE( szName, valueOut ) \
if( !ini.GetValue( "Scroller", szName, valueOut ) ) \
HOOKS->MessageBoxOK( ssprintf("File '%s' is missing the value Scroller::%s", sPathToIni.c_str(), szName) );
Dialog::OK( ssprintf("File '%s' is missing the value Scroller::%s", sPathToIni.c_str(), szName) );
float fSecondsPerItem = 1;
int iNumItemsToDraw = 7;
+2 -2
View File
@@ -14,7 +14,7 @@
#include "Steps.h"
#include "GameState.h"
#include "RageDisplay.h"
#include "arch/ArchHooks/ArchHooks.h"
#include "arch/Dialog/Dialog.h"
#include "Trail.h"
DifficultyIcon::DifficultyIcon()
@@ -34,7 +34,7 @@ bool DifficultyIcon::Load( CString sPath )
NUM_DIFFICULTIES,
NUM_DIFFICULTIES*2,
iStates );
HOOKS->MessageBoxOK( sError );
Dialog::OK( sError );
}
StopAnimating();
return true;
+3 -3
View File
@@ -10,7 +10,7 @@
#include "GameManager.h"
#include "arch/arch.h"
#include "RageDisplay.h"
#include "arch/ArchHooks/ArchHooks.h"
#include "arch/Dialog/Dialog.h"
#include "PrefsManager.h"
@@ -258,7 +258,7 @@ CString NoteSkinManager::GetPathToFromNoteSkinAndButton( CString NoteSkin, CStri
"Verify that this redirect is correct.",
sPath.c_str(), sNewFileName.c_str());
if( ArchHooks::retry == HOOKS->MessageBoxAbortRetryIgnore(message) )
if( Dialog::AbortRetryIgnore(message) == Dialog::retry )
{
FlushDirCache();
g_PathCache.clear();
@@ -297,7 +297,7 @@ CString NoteSkinManager::GetPathToFromDir( CString sDir, CString sFileName )
if( matches.size() > 1 )
{
CString sError = "Multiple files match '"+sDir+sFileName+"'. Please remove all but one of these files.";
HOOKS->MessageBoxOK( sError );
Dialog::OK( sError );
}
return matches[0];
+2 -2
View File
@@ -6,7 +6,7 @@
#include "RageException.h"
#include "RageDisplay.h"
#include "RageTypes.h"
#include "arch/ArchHooks/ArchHooks.h"
#include "arch/Dialog/Dialog.h"
#include "PrefsManager.h"
#include "SDL.h"
@@ -288,7 +288,7 @@ void RageBitmapTexture::Create()
fBetterSourceWidth, fBetterSourceHeight,
fBetterFrameWidth, fBetterFrameHeight );
LOG->Warn( sWarning );
HOOKS->MessageBoxOK( sWarning, "FRAME_DIMENSIONS_WARNING" );
Dialog::OK( sWarning, "FRAME_DIMENSIONS_WARNING" );
}
}
+3 -3
View File
@@ -4,7 +4,7 @@
#include "RageUtil.h"
#include "RageDisplay.h"
#include "RageLog.h"
#include "arch/ArchHooks/ArchHooks.h"
#include "arch/Dialog/Dialog.h"
void RageVec3ClearBounds( RageVector3 &mins, RageVector3 &maxs )
{
@@ -258,7 +258,7 @@ void RageMatrixCommand( CString sCommandString, RageMatrix &mat )
{
CString sError = ssprintf( "MatrixCommand: Unrecognized matrix command name '%s' in command string '%s'.", sName.c_str(), sCommandString.c_str() );
LOG->Warn( sError );
HOOKS->MessageBoxOK( sError );
Dialog::OK( sError );
continue;
}
@@ -267,7 +267,7 @@ void RageMatrixCommand( CString sCommandString, RageMatrix &mat )
{
CString sError = ssprintf( "MatrixCommand: Wrong number of parameters in command '%s'. Expected %d but there are %d.", join(",",asTokens).c_str(), iMaxIndexAccessed+1, (int)asTokens.size() );
LOG->Warn( sError );
HOOKS->MessageBoxOK( sError );
Dialog::OK( sError );
continue;
}
+6 -6
View File
@@ -11,7 +11,7 @@
#include "RageTexture.h"
#include "SDL_utils.h"
#include "ActorUtil.h"
#include "arch/ArchHooks/ArchHooks.h"
#include "arch/Dialog/Dialog.h"
Sprite::Sprite()
{
@@ -124,13 +124,13 @@ retry:
if(asElementPaths.size() == 0)
{
CString sMessage = ssprintf( "The sprite file '%s' points to a texture '%s' which doesn't exist.", m_sSpritePath.c_str(), ID.filename.c_str() );
switch( HOOKS->MessageBoxAbortRetryIgnore(sMessage) )
switch( Dialog::AbortRetryIgnore(sMessage) )
{
case ArchHooks::abort:
case Dialog::abort:
RageException::Throw( "Error reading value 'Texture' from %s.", m_sSpritePath.c_str() );
case ArchHooks::retry:
case Dialog::retry:
goto retry;
case ArchHooks::ignore:
case Dialog::ignore:
return false;
default:
ASSERT(0);
@@ -616,7 +616,7 @@ void Sprite::SetState( int iNewState )
else
sError = ssprintf("A Sprite (\"%s\") tried to set state index %d but no texture is loaded.",
this->m_sName.c_str(), iNewState );
HOOKS->MessageBoxOK( sError );
Dialog::OK( sError );
}
CLAMP(iNewState, 0, (int)m_States.size()-1);
+17 -18
View File
@@ -12,8 +12,7 @@
#include "Font.h"
#include "FontCharAliases.h"
#include "RageDisplay.h"
#include "arch/ArchHooks/ArchHooks.h"
#include "arch/arch.h"
#include "arch/Dialog/Dialog.h"
#include "RageFile.h"
#include "ScreenManager.h"
#include "StepMania.h"
@@ -308,16 +307,16 @@ try_element_again:
"'%s/%s/%s %s'. Please remove all but one of these matches.",
sThemeName.c_str(), sCategory.c_str(), sClassName.c_str(), sElement.c_str() );
switch( HOOKS->MessageBoxAbortRetryIgnore(message) )
switch( Dialog::AbortRetryIgnore(message) )
{
case ArchHooks::abort:
case Dialog::abort:
RageException::Throw( message );
break;
case ArchHooks::retry:
case Dialog::retry:
FlushDirCache();
ReloadMetrics();
goto try_element_again;
case ArchHooks::ignore:
case Dialog::ignore:
break;
}
}
@@ -360,7 +359,7 @@ try_element_again:
"Verify that this redirect is correct.",
sPath.c_str(), sNewFileName.c_str());
if( ArchHooks::retry == HOOKS->MessageBoxAbortRetryIgnore(message) )
if( Dialog::AbortRetryIgnore(message) == Dialog::retry )
{
FlushDirCache();
ReloadMetrics();
@@ -414,18 +413,18 @@ try_element_again:
/* We can't fall back on _missing in Other: the file types are unknown. */
CString sMessage = "The theme element \"" + sCategory + "/" + sFileName +"\" is missing.";
ArchHooks::MessageBoxResult res;
Dialog::Result res;
if( category != Other )
res = HOOKS->MessageBoxAbortRetryIgnore(sMessage, "MissingThemeElement");
res = Dialog::AbortRetryIgnore(sMessage, "MissingThemeElement");
else
res = HOOKS->MessageBoxRetryCancel(sMessage, "MissingThemeElement");
res = Dialog::RetryCancel(sMessage, "MissingThemeElement");
switch( res )
{
case ArchHooks::retry:
case Dialog::retry:
FlushDirCache();
ReloadMetrics();
goto try_element_again;
case ArchHooks::ignore:
case Dialog::ignore:
LOG->Warn(
"Theme element '%s/%s' could not be found in '%s' or '%s'.",
sCategory.c_str(),
@@ -440,8 +439,8 @@ try_element_again:
Cache[sFileName] = GetPath( category, "", "_missing" );
return Cache[sFileName];
/* XXX: "abort" and "cancel" are synonyms; merge */
case ArchHooks::abort:
case ArchHooks::cancel:
case Dialog::abort:
case Dialog::cancel:
RageException::Throw( "Theme element '%s/%s' could not be found in '%s' or '%s'.",
sCategory.c_str(),
sFileName.c_str(),
@@ -530,15 +529,15 @@ try_metric_again:
CString sMessage = ssprintf( "The theme metric '%s-%s' is missing. Correct this and click Retry, or Cancel to break.",sClassName.c_str(),sValueName.c_str() );
switch( HOOKS->MessageBoxAbortRetryIgnore(sMessage) )
switch( Dialog::AbortRetryIgnore(sMessage) )
{
case ArchHooks::abort:
case Dialog::abort:
break; // fall through
case ArchHooks::retry:
case Dialog::retry:
FlushDirCache();
ReloadMetrics();
goto try_metric_again;
case ArchHooks::ignore:
case Dialog::ignore:
return "";
default:
ASSERT(0);