From e9542e6e67b4f5d45edbcff15bb9bc19a060e5df Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Tue, 24 Dec 2013 09:09:55 -0500 Subject: [PATCH] BURIED: Use runLoadDialog/runSaveDialog instead of the old save/load code --- engines/buried/frame_window.cpp | 19 --------------- engines/buried/frame_window.h | 1 - engines/buried/gameui.cpp | 43 +++++---------------------------- engines/buried/gameui.h | 4 --- engines/buried/scene_view.cpp | 6 ----- engines/buried/scene_view.h | 1 - 6 files changed, 6 insertions(+), 68 deletions(-) diff --git a/engines/buried/frame_window.cpp b/engines/buried/frame_window.cpp index e9640bf38e3..ca51f4370e2 100644 --- a/engines/buried/frame_window.cpp +++ b/engines/buried/frame_window.cpp @@ -260,25 +260,6 @@ bool FrameWindow::startNewGame(bool walkthrough, bool introMovie) { return true; } -bool FrameWindow::startNewGame(const Common::String &fileName) { - _gameInProgress = true; - _atMainMenu = false; - - _vm->removeMouseMessages(this); - - delete _mainChildWindow; - - // Create Game UI window to kick things off - _mainChildWindow = new GameUIWindow(_vm, this); - _mainChildWindow->showWindow(kWindowShow); - setFocus(); - ((GameUIWindow *)_mainChildWindow)->startNewGame(fileName); - - _vm->removeMouseMessages(this); - _vm->removeMouseMessages(_mainChildWindow); - return true; -} - bool FrameWindow::showDeathScene(int deathSceneIndex, GlobalFlags globalFlags) { _gameInProgress = false; _atMainMenu = false; diff --git a/engines/buried/frame_window.h b/engines/buried/frame_window.h index db3798c7ca3..96ffab489b4 100644 --- a/engines/buried/frame_window.h +++ b/engines/buried/frame_window.h @@ -45,7 +45,6 @@ public: bool showClosingScreen(); bool showFeaturesScreen(); bool startNewGame(bool walkthrough = false, bool introMovie = false); - bool startNewGame(const Common::String &fileName); // TODO: startNewGame with continue data bool showDeathScene(int deathSceneIndex, GlobalFlags globalFlags); bool showCompletionScene(GlobalFlags globalFlags); diff --git a/engines/buried/gameui.cpp b/engines/buried/gameui.cpp index d96b995d82c..f05f5dae03a 100644 --- a/engines/buried/gameui.cpp +++ b/engines/buried/gameui.cpp @@ -25,6 +25,7 @@ #include "buried/biochip_right.h" #include "buried/buried.h" +#include "buried/frame_window.h" #include "buried/gameui.h" #include "buried/graphics.h" #include "buried/invdata.h" @@ -37,6 +38,7 @@ #include "buried/sound.h" #include "buried/video_window.h" +#include "common/error.h" #include "common/keyboard.h" #include "common/system.h" #include "graphics/surface.h" @@ -130,41 +132,6 @@ bool GameUIWindow::startNewGame(const Location &startingLocation) { return true; } -bool GameUIWindow::startNewGame(const Common::String &fileName) { - _doNotDraw = false; - showWindow(kWindowShow); - invalidateWindow(false); - - _navArrowWindow->showWindow(kWindowShow); - _liveTextWindow->showWindow(kWindowShow); - _sceneViewWindow->showWindow(kWindowShow); - _inventoryWindow->showWindow(kWindowShow); - _bioChipRightWindow->showWindow(kWindowShow); - _sceneViewWindow->startNewGame(fileName); - - return true; -} - -bool GameUIWindow::loadGame() { - _doNotDraw = false; - - // TODO; - - return false; -} - -bool GameUIWindow::loadGame(const Common::String &fileName) { - // TODO - - return true; -} - -bool GameUIWindow::saveGame() { - // TODO - - return false; -} - bool GameUIWindow::changeCurrentDate(int timeZoneID) { switch (timeZoneID) { case 1: @@ -341,7 +308,7 @@ void GameUIWindow::onKeyUp(const Common::KeyState &key, uint flags) { _bioChipRightWindow->changeCurrentBioChip(kItemBioChipInterface); _bioChipRightWindow->invalidateWindow(false); _bioChipRightWindow->sendMessage(new LButtonUpMessage(Common::Point(50, 130), 0)); - saveGame(); + _vm->runSaveDialog(); return; } // Fall through @@ -351,7 +318,9 @@ void GameUIWindow::onKeyUp(const Common::KeyState &key, uint flags) { _bioChipRightWindow->changeCurrentBioChip(kItemBioChipInterface); _bioChipRightWindow->invalidateWindow(false); _bioChipRightWindow->sendMessage(new LButtonUpMessage(Common::Point(50, 130), 0)); - loadGame(); + + if (_vm->runLoadDialog().getCode() == Common::kUnknownError) + ((FrameWindow *)_vm->_mainWindow)->showMainMenu(); return; } // Fall through diff --git a/engines/buried/gameui.h b/engines/buried/gameui.h index 84c10b403d0..849388c99d4 100644 --- a/engines/buried/gameui.h +++ b/engines/buried/gameui.h @@ -49,11 +49,7 @@ public: bool startNewGame(bool walkthrough = false); bool startNewGameIntro(bool walkthrough = false); bool startNewGame(const Location &startingLocation); - bool startNewGame(const Common::String &fileName); // startNewGame(continue data, location struct); - bool loadGame(); - bool loadGame(const Common::String &fileName); - bool saveGame(); bool changeCurrentDate(int timeZoneID); bool flashWarningLight(); bool setWarningState(bool newState); diff --git a/engines/buried/scene_view.cpp b/engines/buried/scene_view.cpp index 7e3e0689f76..4ef8b32910f 100644 --- a/engines/buried/scene_view.cpp +++ b/engines/buried/scene_view.cpp @@ -194,12 +194,6 @@ bool SceneViewWindow::startNewGame(const Location &startingLocation) { return true; } -bool SceneViewWindow::startNewGame(const Common::String &restoreFile) { - ((GameUIWindow *)_parent)->loadGame(restoreFile); - invalidateWindow(false); - return true; -} - bool SceneViewWindow::showDeathScene(int deathSceneIndex) { return ((FrameWindow *)(_parent->getParent()))->showDeathScene(deathSceneIndex, _globalFlags); // TODO: Inventory } diff --git a/engines/buried/scene_view.h b/engines/buried/scene_view.h index 4179d91b067..24a29b4f30a 100644 --- a/engines/buried/scene_view.h +++ b/engines/buried/scene_view.h @@ -55,7 +55,6 @@ public: bool startNewGame(bool walkthrough = false); bool startNewGameIntro(bool walkthrough = false); bool startNewGame(const Location &startingLocation); - bool startNewGame(const Common::String &restoreFile); bool showDeathScene(int deathSceneIndex); bool showCompletionScene();