diff --git a/core/Base/Game.cpp b/core/Base/Game.cpp index ca3bccb6..ac8c46aa 100644 --- a/core/Base/Game.cpp +++ b/core/Base/Game.cpp @@ -103,21 +103,13 @@ void e2d::Game::pause() void e2d::Game::resume() { - if (_paused) - { - Game::reset(); - } - _paused = false; -} - -void e2d::Game::reset() -{ - if (!_ended) + if (_paused && !_ended) { Time::__reset(); Timer::__resetAll(); ActionManager::getInstance()->__resetAll(); } + _paused = false; } bool e2d::Game::isPaused() diff --git a/core/Base/Window.cpp b/core/Base/Window.cpp index c0d4afae..03abca8d 100644 --- a/core/Base/Window.cpp +++ b/core/Base/Window.cpp @@ -359,20 +359,23 @@ void e2d::Window::setTypewritingEnabled(bool enabled) void e2d::Window::info(const String & text, const String & title) { + Game::getInstance()->pause(); ::MessageBox(_hWnd, (LPCWSTR)text, (LPCWSTR)title, MB_ICONINFORMATION | MB_OK); - Game::getInstance()->reset(); + Game::getInstance()->resume(); } void e2d::Window::warning(const String& title, const String& text) { + Game::getInstance()->pause(); ::MessageBox(_hWnd, (LPCWSTR)text, (LPCWSTR)title, MB_ICONWARNING | MB_OK); - Game::getInstance()->reset(); + Game::getInstance()->resume(); } void e2d::Window::error(const String & text, const String & title) { + Game::getInstance()->pause(); ::MessageBox(_hWnd, (LPCWSTR)text, (LPCWSTR)title, MB_ICONERROR | MB_OK); - Game::getInstance()->reset(); + Game::getInstance()->resume(); } diff --git a/core/e2dbase.h b/core/e2dbase.h index 00780a87..30e8cd80 100644 --- a/core/e2dbase.h +++ b/core/e2dbase.h @@ -37,9 +37,6 @@ public: // 清理资源 void cleanup(); - // 重置游戏内部计时 - void reset(); - // 游戏是否暂停 bool isPaused();