simplify
fix dialog windows coming up in fullscreen
This commit is contained in:
@@ -26,10 +26,19 @@ void ArchHooks::IgnoreMessage( CString ID )
|
|||||||
PREFSMAN->m_sIgnoredMessageWindows = join( ",", list );
|
PREFSMAN->m_sIgnoredMessageWindows = join( ",", list );
|
||||||
PREFSMAN->SaveGlobalPrefsToDisk();
|
PREFSMAN->SaveGlobalPrefsToDisk();
|
||||||
}
|
}
|
||||||
|
#include "RageLog.h"
|
||||||
|
void ArchHooks::MessageBoxError( CString sMessage )
|
||||||
|
{
|
||||||
|
MessageBoxErrorPrivate( sMessage );
|
||||||
|
}
|
||||||
|
|
||||||
void ArchHooks::MessageBoxOK( CString sMessage, CString ID )
|
void ArchHooks::MessageBoxOK( CString sMessage, CString ID )
|
||||||
{
|
{
|
||||||
|
if( ID != "" && MessageIsIgnored( ID ) )
|
||||||
|
return;
|
||||||
|
|
||||||
// don't show MessageBox if windowed
|
// don't show MessageBox if windowed
|
||||||
|
if(LOG)LOG->Trace("wind %i", DISPLAY->IsWindowed());
|
||||||
if( !DISPLAY->IsWindowed() )
|
if( !DISPLAY->IsWindowed() )
|
||||||
ArchHooks::MessageBoxOKPrivate( sMessage, ID );
|
ArchHooks::MessageBoxOKPrivate( sMessage, ID );
|
||||||
else
|
else
|
||||||
@@ -38,6 +47,9 @@ void ArchHooks::MessageBoxOK( CString sMessage, CString ID )
|
|||||||
|
|
||||||
ArchHooks::MessageBoxResult ArchHooks::MessageBoxAbortRetryIgnore( CString sMessage, CString ID )
|
ArchHooks::MessageBoxResult ArchHooks::MessageBoxAbortRetryIgnore( CString sMessage, CString ID )
|
||||||
{
|
{
|
||||||
|
if( ID != "" && MessageIsIgnored( ID ) )
|
||||||
|
return ArchHooks::MessageBoxAbortRetryIgnorePrivate( sMessage, ID );
|
||||||
|
|
||||||
// don't show MessageBox if windowed
|
// don't show MessageBox if windowed
|
||||||
if( DISPLAY && !DISPLAY->IsWindowed() )
|
if( DISPLAY && !DISPLAY->IsWindowed() )
|
||||||
return ArchHooks::MessageBoxAbortRetryIgnorePrivate( sMessage, ID );
|
return ArchHooks::MessageBoxAbortRetryIgnorePrivate( sMessage, ID );
|
||||||
@@ -47,6 +59,9 @@ ArchHooks::MessageBoxResult ArchHooks::MessageBoxAbortRetryIgnore( CString sMess
|
|||||||
|
|
||||||
ArchHooks::MessageBoxResult ArchHooks::MessageBoxRetryCancel( CString sMessage, CString ID )
|
ArchHooks::MessageBoxResult ArchHooks::MessageBoxRetryCancel( CString sMessage, CString ID )
|
||||||
{
|
{
|
||||||
|
if( ID != "" && MessageIsIgnored( ID ) )
|
||||||
|
return ArchHooks::MessageBoxRetryCancelPrivate( sMessage, ID );
|
||||||
|
|
||||||
// don't show MessageBox if windowed
|
// don't show MessageBox if windowed
|
||||||
if( !DISPLAY->IsWindowed() )
|
if( !DISPLAY->IsWindowed() )
|
||||||
return ArchHooks::MessageBoxRetryCancelPrivate( sMessage, ID );
|
return ArchHooks::MessageBoxRetryCancelPrivate( sMessage, ID );
|
||||||
|
|||||||
@@ -28,12 +28,12 @@ public:
|
|||||||
|
|
||||||
/* Message box stuff. Not supported on all archs. The ID can be used
|
/* Message box stuff. Not supported on all archs. The ID can be used
|
||||||
* to identify a class of messages, for "don't display this dialog"-type
|
* to identify a class of messages, for "don't display this dialog"-type
|
||||||
* prompts. */
|
* prompts. (Don't overload these, overload *Private below.) */
|
||||||
enum MessageBoxResult { abort, retry, ignore, cancel };
|
enum MessageBoxResult { abort, retry, ignore, cancel };
|
||||||
virtual void MessageBoxError( CString error ) { printf("Error: %s\n", error.c_str()); }
|
void MessageBoxError( CString error );
|
||||||
virtual void MessageBoxOK( CString sMessage, CString ID = "" );
|
void MessageBoxOK( CString sMessage, CString ID = "" );
|
||||||
virtual MessageBoxResult MessageBoxAbortRetryIgnore( CString sMessage, CString ID = "" );
|
MessageBoxResult MessageBoxAbortRetryIgnore( CString sMessage, CString ID = "" );
|
||||||
virtual MessageBoxResult MessageBoxRetryCancel( CString sMessage, CString ID = "" );
|
MessageBoxResult MessageBoxRetryCancel( CString sMessage, CString ID = "" );
|
||||||
|
|
||||||
virtual ~ArchHooks() { }
|
virtual ~ArchHooks() { }
|
||||||
/* This is called once each time through the game loop */
|
/* This is called once each time through the game loop */
|
||||||
@@ -43,6 +43,7 @@ public:
|
|||||||
virtual void RestartProgram() { }
|
virtual void RestartProgram() { }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual void MessageBoxErrorPrivate( CString sMessage ) { printf("Error: %s\n", sMessage.c_str()); }
|
||||||
virtual void MessageBoxOKPrivate( CString sMessage, CString ID ) {}
|
virtual void MessageBoxOKPrivate( CString sMessage, CString ID ) {}
|
||||||
virtual MessageBoxResult MessageBoxAbortRetryIgnorePrivate( CString sMessage, CString ID ) { return ignore; }
|
virtual MessageBoxResult MessageBoxAbortRetryIgnorePrivate( CString sMessage, CString ID ) { return ignore; }
|
||||||
virtual MessageBoxResult MessageBoxRetryCancelPrivate( CString sMessage, CString ID ) { return cancel; }
|
virtual MessageBoxResult MessageBoxRetryCancelPrivate( CString sMessage, CString ID ) { return cancel; }
|
||||||
|
|||||||
@@ -72,11 +72,9 @@ static BOOL CALLBACK OKWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void ArchHooks_Win32::MessageBoxOK( CString sMessage, CString ID )
|
void ArchHooks_Win32::MessageBoxOKPrivate( CString sMessage, CString ID )
|
||||||
{
|
{
|
||||||
g_AllowHush = ID != "";
|
g_AllowHush = ID != "";
|
||||||
if( g_AllowHush && MessageIsIgnored( ID ) )
|
|
||||||
return;
|
|
||||||
g_sMessage = sMessage;
|
g_sMessage = sMessage;
|
||||||
AppInstance handle;
|
AppInstance handle;
|
||||||
DialogBox(handle.Get(), MAKEINTRESOURCE(IDD_OK), NULL, OKWndProc);
|
DialogBox(handle.Get(), MAKEINTRESOURCE(IDD_OK), NULL, OKWndProc);
|
||||||
@@ -147,7 +145,7 @@ static BOOL CALLBACK ErrorWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ArchHooks_Win32::MessageBoxError( CString error )
|
void ArchHooks_Win32::MessageBoxErrorPrivate( CString error )
|
||||||
{
|
{
|
||||||
g_sErrorString = error;
|
g_sErrorString = error;
|
||||||
// throw up a pretty error dialog
|
// throw up a pretty error dialog
|
||||||
@@ -156,7 +154,7 @@ void ArchHooks_Win32::MessageBoxError( CString error )
|
|||||||
NULL, ErrorWndProc);
|
NULL, ErrorWndProc);
|
||||||
}
|
}
|
||||||
|
|
||||||
ArchHooks::MessageBoxResult ArchHooks_Win32::MessageBoxAbortRetryIgnore( CString sMessage, CString ID )
|
ArchHooks::MessageBoxResult ArchHooks_Win32::MessageBoxAbortRetryIgnorePrivate( CString sMessage, CString ID )
|
||||||
{
|
{
|
||||||
switch( MessageBox(NULL, sMessage, PRODUCT_NAME, MB_ABORTRETRYIGNORE|MB_DEFBUTTON2 ) )
|
switch( MessageBox(NULL, sMessage, PRODUCT_NAME, MB_ABORTRETRYIGNORE|MB_DEFBUTTON2 ) )
|
||||||
{
|
{
|
||||||
@@ -167,7 +165,7 @@ ArchHooks::MessageBoxResult ArchHooks_Win32::MessageBoxAbortRetryIgnore( CString
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ArchHooks::MessageBoxResult ArchHooks_Win32::MessageBoxRetryCancel( CString sMessage, CString ID )
|
ArchHooks::MessageBoxResult ArchHooks_Win32::MessageBoxRetryCancelPrivate( CString sMessage, CString ID )
|
||||||
{
|
{
|
||||||
switch( MessageBox(NULL, sMessage, PRODUCT_NAME, MB_RETRYCANCEL ) )
|
switch( MessageBox(NULL, sMessage, PRODUCT_NAME, MB_RETRYCANCEL ) )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ class ArchHooks_Win32: public ArchHooks
|
|||||||
public:
|
public:
|
||||||
ArchHooks_Win32();
|
ArchHooks_Win32();
|
||||||
void DumpDebugInfo();
|
void DumpDebugInfo();
|
||||||
void MessageBoxOK( CString sMessage, CString ID );
|
void MessageBoxOKPrivate( CString sMessage, CString ID );
|
||||||
void MessageBoxError( CString error );
|
void MessageBoxErrorPrivate( CString error );
|
||||||
MessageBoxResult MessageBoxAbortRetryIgnore( CString sMessage, CString ID );
|
MessageBoxResult MessageBoxAbortRetryIgnorePrivate( CString sMessage, CString ID );
|
||||||
MessageBoxResult MessageBoxRetryCancel( CString sMessage, CString ID );
|
MessageBoxResult MessageBoxRetryCancelPrivate( CString sMessage, CString ID );
|
||||||
void RestartProgram();
|
void RestartProgram();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user