Files
itgmania212121/stepmania/src/arch/ArchHooks/ArchHooks.cpp
T

73 lines
2.0 KiB
C++
Raw Normal View History

#include "global.h"
#include "ArchHooks.h"
#include "PrefsManager.h"
#include "RageUtil.h"
2003-11-15 08:54:57 +00:00
#include "RageDisplay.h" // for IsWindowed()
ArchHooks *HOOKS = NULL;
bool ArchHooks::MessageIsIgnored( CString ID )
{
vector<CString> list;
split( PREFSMAN->m_sIgnoredMessageWindows, ",", list );
for( unsigned i = 0; i < list.size(); ++i )
if( !ID.CompareNoCase(list[i]) )
return true;
return false;
}
void ArchHooks::IgnoreMessage( CString ID )
{
if( MessageIsIgnored(ID) )
return;
vector<CString> list;
split( PREFSMAN->m_sIgnoredMessageWindows, ",", list );
list.push_back( ID );
PREFSMAN->m_sIgnoredMessageWindows = join( ",", list );
PREFSMAN->SaveGlobalPrefsToDisk();
}
2004-01-16 22:43:59 +00:00
void ArchHooks::MessageBoxError( CString sMessage, CString ID )
2004-01-13 00:15:10 +00:00
{
2004-01-16 22:43:59 +00:00
if( ID != "" && MessageIsIgnored( ID ) )
return;
MessageBoxErrorPrivate( sMessage, ID );
2004-01-13 00:15:10 +00:00
}
2003-11-15 08:54:57 +00:00
void ArchHooks::MessageBoxOK( CString sMessage, CString ID )
{
2004-01-13 00:15:10 +00:00
if( ID != "" && MessageIsIgnored( ID ) )
return;
2003-11-15 08:54:57 +00:00
// don't show MessageBox if windowed
if( !DISPLAY->IsWindowed() )
ArchHooks::MessageBoxOKPrivate( sMessage, ID );
else
this->MessageBoxOKPrivate( sMessage, ID ); // call derived version
}
ArchHooks::MessageBoxResult ArchHooks::MessageBoxAbortRetryIgnore( CString sMessage, CString ID )
{
2004-01-13 00:15:10 +00:00
if( ID != "" && MessageIsIgnored( ID ) )
return ArchHooks::MessageBoxAbortRetryIgnorePrivate( sMessage, ID );
2003-11-15 08:54:57 +00:00
// don't show MessageBox if windowed
2003-12-19 08:02:41 +00:00
if( DISPLAY && !DISPLAY->IsWindowed() )
2003-11-15 08:54:57 +00:00
return ArchHooks::MessageBoxAbortRetryIgnorePrivate( sMessage, ID );
else
return this->MessageBoxAbortRetryIgnorePrivate( sMessage, ID ); // call derived version
}
ArchHooks::MessageBoxResult ArchHooks::MessageBoxRetryCancel( CString sMessage, CString ID )
{
2004-01-13 00:15:10 +00:00
if( ID != "" && MessageIsIgnored( ID ) )
return ArchHooks::MessageBoxRetryCancelPrivate( sMessage, ID );
2003-11-15 08:54:57 +00:00
// don't show MessageBox if windowed
if( !DISPLAY->IsWindowed() )
return ArchHooks::MessageBoxRetryCancelPrivate( sMessage, ID );
else
return this->MessageBoxRetryCancelPrivate( sMessage, ID ); // call derived version
}