Back to previous resolution when escape was pressed in confirm resolution dialog

This commit is contained in:
Deve 2014-08-22 19:46:03 +02:00
parent 3ef30dfd48
commit ad870c37f4
2 changed files with 12 additions and 0 deletions

View File

@ -64,6 +64,15 @@ void ConfirmResolutionDialog::onUpdate(float dt)
}
// ----------------------------------------------------------------------------
bool ConfirmResolutionDialog::onEscapePressed()
{
ModalDialog::dismiss();
irr_driver->cancelResChange();
return true;
} // escapePressed
// ------------------------------------------------------------------------------------------------------
void ConfirmResolutionDialog::updateMessage()

View File

@ -20,6 +20,7 @@
#define HEADER_CONFIRM_RES_DIALOG_HPP
#include "guiengine/modaldialog.hpp"
#include "utils/cpp2011.hpp"
/**
* \brief Dialog shown after a resolution switch sot he user may confirm if
@ -28,6 +29,7 @@
*/
class ConfirmResolutionDialog : public GUIEngine::ModalDialog
{
private:
/** number of seconds left before resolution is considered unplayable */
float m_remaining_time;
@ -40,6 +42,7 @@ public:
GUIEngine::EventPropagation processEvent(const std::string& eventSource);
virtual void onUpdate(float dt);
virtual bool onEscapePressed() OVERRIDE;
};