diff options
author | Paul Gilbert | 2015-07-24 22:14:40 -0400 |
---|---|---|
committer | Paul Gilbert | 2015-07-24 22:14:40 -0400 |
commit | fc0cf31fdea7dc2d796b7d2109324d2d613d2e0b (patch) | |
tree | e00e0cf658aa780c15d673faf54002be10aa3a15 /engines/sherlock/tattoo | |
parent | 67d2bf85893e6672374fe41530310c7c894a64ee (diff) | |
download | scummvm-rg350-fc0cf31fdea7dc2d796b7d2109324d2d613d2e0b.tar.gz scummvm-rg350-fc0cf31fdea7dc2d796b7d2109324d2d613d2e0b.tar.bz2 scummvm-rg350-fc0cf31fdea7dc2d796b7d2109324d2d613d2e0b.zip |
SHERLOCK: RT: Skeleton class for Files dialog
Diffstat (limited to 'engines/sherlock/tattoo')
-rw-r--r-- | engines/sherlock/tattoo/tattoo_user_interface.cpp | 9 | ||||
-rw-r--r-- | engines/sherlock/tattoo/tattoo_user_interface.h | 3 | ||||
-rw-r--r-- | engines/sherlock/tattoo/widget_files.cpp | 73 | ||||
-rw-r--r-- | engines/sherlock/tattoo/widget_files.h | 63 |
4 files changed, 141 insertions, 7 deletions
diff --git a/engines/sherlock/tattoo/tattoo_user_interface.cpp b/engines/sherlock/tattoo/tattoo_user_interface.cpp index f602259ea8..01f927b8c3 100644 --- a/engines/sherlock/tattoo/tattoo_user_interface.cpp +++ b/engines/sherlock/tattoo/tattoo_user_interface.cpp @@ -31,7 +31,7 @@ namespace Tattoo { TattooUserInterface::TattooUserInterface(SherlockEngine *vm): UserInterface(vm), _inventoryWidget(vm), _messageWidget(vm), _textWidget(vm), _tooltipWidget(vm), _verbsWidget(vm), - _labWidget(vm), _creditsWidget(vm), _optionsWidget(vm), _quitWidget(vm) { + _labWidget(vm), _creditsWidget(vm), _optionsWidget(vm), _quitWidget(vm), _filesWidget(vm) { Common::fill(&_lookupTable[0], &_lookupTable[PALETTE_COUNT], 0); Common::fill(&_lookupTable1[0], &_lookupTable1[PALETTE_COUNT], 0); _scrollSize = 0; @@ -40,7 +40,6 @@ TattooUserInterface::TattooUserInterface(SherlockEngine *vm): UserInterface(vm), _bgShape = nullptr; _personFound = false; _lockoutTimer = 0; - _fileMode = SAVEMODE_NONE; _exitZone = -1; _scriptZone = -1; _arrowZone = _oldArrowZone = -1; @@ -882,13 +881,11 @@ void TattooUserInterface::clearWindow() { } void TattooUserInterface::loadGame() { - _fileMode = SAVEMODE_LOAD; - // TODO + _filesWidget.show(SAVEMODE_LOAD); } void TattooUserInterface::saveGame() { - _fileMode = SAVEMODE_SAVE; - // TODO + _filesWidget.show(SAVEMODE_SAVE); } } // End of namespace Tattoo diff --git a/engines/sherlock/tattoo/tattoo_user_interface.h b/engines/sherlock/tattoo/tattoo_user_interface.h index 016398efd5..652e5b1da2 100644 --- a/engines/sherlock/tattoo/tattoo_user_interface.h +++ b/engines/sherlock/tattoo/tattoo_user_interface.h @@ -29,6 +29,7 @@ #include "sherlock/screen.h" #include "sherlock/user_interface.h" #include "sherlock/tattoo/widget_credits.h" +#include "sherlock/tattoo/widget_files.h" #include "sherlock/tattoo/widget_inventory.h" #include "sherlock/tattoo/widget_lab.h" #include "sherlock/tattoo/widget_options.h" @@ -51,9 +52,9 @@ class TattooUserInterface : public UserInterface { friend class WidgetBase; private: int _lockoutTimer; - SaveMode _fileMode; int _scriptZone; int _cAnimFramePause; + WidgetFiles _filesWidget; WidgetInventory _inventoryWidget; WidgetMessage _messageWidget; WidgetQuit _quitWidget; diff --git a/engines/sherlock/tattoo/widget_files.cpp b/engines/sherlock/tattoo/widget_files.cpp new file mode 100644 index 0000000000..37842bb98f --- /dev/null +++ b/engines/sherlock/tattoo/widget_files.cpp @@ -0,0 +1,73 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "sherlock/tattoo/widget_files.h" +#include "sherlock/tattoo/tattoo.h" +#include "sherlock/tattoo/tattoo_fixed_text.h" +#include "sherlock/tattoo/tattoo_scene.h" +#include "sherlock/tattoo/tattoo_user_interface.h" + +namespace Sherlock { + +namespace Tattoo { + +WidgetFiles::WidgetFiles(SherlockEngine *vm) : WidgetBase(vm) { +} + +void WidgetFiles::show(SaveMode mode) { + Events &events = *_vm->_events; + TattooUserInterface &ui = *(TattooUserInterface *)_vm->_ui; + Common::Point mousePos = events.mousePos(); + + _fileMode = mode; + + // Set up the display area + _bounds = Common::Rect(_surface.stringWidth(FIXED(AreYouSureYou)) + _surface.widestChar() * 2, + (_surface.fontHeight() + 7) * 4); + _bounds.moveTo(mousePos.x - _bounds.width() / 2, mousePos.y - _bounds.height() / 2); + + // Create the surface + _surface.create(_bounds.width(), _bounds.height()); + _surface.fill(TRANSPARENCY); + makeInfoArea(); + + + ui._menuMode = FILES_MODE; + summonWindow(); +} + +void WidgetFiles::handleEvents() { + //Events &events = *_vm->_events; + +} + +void WidgetFiles::close() { + TattooScene &scene = *(TattooScene *)_vm->_scene; + TattooUserInterface &ui = *(TattooUserInterface *)_vm->_ui; + + banishWindow(); + ui._menuMode = scene._labTableScene ? LAB_MODE : STD_MODE; +} + +} // End of namespace Tattoo + +} // End of namespace Sherlock diff --git a/engines/sherlock/tattoo/widget_files.h b/engines/sherlock/tattoo/widget_files.h new file mode 100644 index 0000000000..6ef5aab836 --- /dev/null +++ b/engines/sherlock/tattoo/widget_files.h @@ -0,0 +1,63 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef SHERLOCK_TATTOO_WIDGET_FILES_H +#define SHERLOCK_TATTOO_WIDGET_FILES_H + +#include "common/scummsys.h" +#include "sherlock/tattoo/widget_base.h" +#include "sherlock/saveload.h" + +namespace Sherlock { + +class SherlockEngine; + +namespace Tattoo { + +class WidgetFiles: public WidgetBase { +private: + SaveMode _fileMode; + + /** + * Close the dialog + */ + void close(); +public: + WidgetFiles(SherlockEngine *vm); + virtual ~WidgetFiles() {} + + /** + * Prompt the user whether to quit + */ + void show(SaveMode mode); + + /** + * Handle event processing + */ + virtual void handleEvents(); +}; + +} // End of namespace Tattoo + +} // End of namespace Sherlock + +#endif |