Fixed ERR_DROP resulting in a glitched screen with only the console accessible - show the main menu instead.

This commit is contained in:
Jonathan Young 2013-09-29 21:03:32 +10:00
parent 9e7230de34
commit 2555b804d6
3 changed files with 38 additions and 1 deletions

View file

@ -57,6 +57,7 @@ public:
virtual bool ProcessEvent( const sysEvent_t* event, bool forceAccept ); virtual bool ProcessEvent( const sysEvent_t* event, bool forceAccept );
virtual bool Active(); virtual bool Active();
virtual void ClearNotifyLines(); virtual void ClearNotifyLines();
virtual void Open();
virtual void Close(); virtual void Close();
virtual void Print( const char* text ); virtual void Print( const char* text );
virtual void Draw( bool forceFullScreen ); virtual void Draw( bool forceFullScreen );
@ -424,6 +425,22 @@ void idConsoleLocal::ClearNotifyLines()
} }
} }
/*
================
idConsoleLocal::Open
================
*/
void idConsoleLocal::Open()
{
if( keyCatching )
return; // already open
consoleField.ClearAutoComplete();
consoleField.Clear();
keyCatching = true;
SetDisplayFraction( 0.5f );
}
/* /*
================ ================
idConsoleLocal::Close idConsoleLocal::Close

View file

@ -76,6 +76,9 @@ public:
// clear the timers on any recent prints that are displayed in the notify lines // clear the timers on any recent prints that are displayed in the notify lines
virtual void ClearNotifyLines() = 0; virtual void ClearNotifyLines() = 0;
// force console open
virtual void Open() = 0;
// some console commands, like timeDemo, will force the console closed before they start // some console commands, like timeDemo, will force the console closed before they start
virtual void Close() = 0; virtual void Close() = 0;

View file

@ -853,7 +853,24 @@ void idCommonLocal::Frame()
} }
catch( idException& ) catch( idException& )
{ {
return; // an ERP_DROP was thrown // an ERP_DROP was thrown
#if defined(USE_DOOMCLASSIC)
if( currentGame == DOOM_CLASSIC || currentGame == DOOM2_CLASSIC )
{
return;
}
#endif
// kill loading gui
delete loadGUI;
loadGUI = NULL;
// drop back to main menu
LeaveGame();
// force the console open to show error messages
console->Open();
return;
} }
} }