[Scummvm-cvs-logs] scummvm master -> fc0cf31fdea7dc2d796b7d2109324d2d613d2e0b

dreammaster dreammaster at scummvm.org
Sat Jul 25 04:15:46 CEST 2015


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
fc0cf31fde SHERLOCK: RT: Skeleton class for Files dialog


Commit: fc0cf31fdea7dc2d796b7d2109324d2d613d2e0b
    https://github.com/scummvm/scummvm/commit/fc0cf31fdea7dc2d796b7d2109324d2d613d2e0b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-07-24T22:14:40-04:00

Commit Message:
SHERLOCK: RT: Skeleton class for Files dialog

Changed paths:
  A engines/sherlock/tattoo/widget_files.cpp
  A engines/sherlock/tattoo/widget_files.h
    engines/sherlock/module.mk
    engines/sherlock/saveload.cpp
    engines/sherlock/saveload.h
    engines/sherlock/scalpel/scalpel_saveload.h
    engines/sherlock/tattoo/tattoo_user_interface.cpp
    engines/sherlock/tattoo/tattoo_user_interface.h



diff --git a/engines/sherlock/module.mk b/engines/sherlock/module.mk
index 3af8986..c602021 100644
--- a/engines/sherlock/module.mk
+++ b/engines/sherlock/module.mk
@@ -34,6 +34,7 @@ MODULE_OBJS = \
 	tattoo/tattoo_user_interface.o \
 	tattoo/widget_base.o \
 	tattoo/widget_credits.o \
+	tattoo/widget_files.o \
 	tattoo/widget_hangman.o \
 	tattoo/widget_inventory.o \
 	tattoo/widget_lab.o \
diff --git a/engines/sherlock/saveload.cpp b/engines/sherlock/saveload.cpp
index fae8196..1151655 100644
--- a/engines/sherlock/saveload.cpp
+++ b/engines/sherlock/saveload.cpp
@@ -46,7 +46,6 @@ SaveManager *SaveManager::init(SherlockEngine *vm, const Common::String &target)
 SaveManager::SaveManager(SherlockEngine *vm, const Common::String &target) :
 		_vm(vm), _target(target) {
 	_saveThumb = nullptr;
-	_envMode = SAVEMODE_NONE;
 	_justLoaded = false;
 	_savegameIndex = 0;
 }
diff --git a/engines/sherlock/saveload.h b/engines/sherlock/saveload.h
index 0aaa9cf..b4e9b3e 100644
--- a/engines/sherlock/saveload.h
+++ b/engines/sherlock/saveload.h
@@ -87,7 +87,6 @@ protected:
 public:
 	Common::StringArray _savegames;
 	int _savegameIndex;
-	SaveMode _envMode;
 	bool _justLoaded;
 public:
 	static SaveManager *init(SherlockEngine *vm, const Common::String &target);
diff --git a/engines/sherlock/scalpel/scalpel_saveload.h b/engines/sherlock/scalpel/scalpel_saveload.h
index db4fa1a..6b035ca 100644
--- a/engines/sherlock/scalpel/scalpel_saveload.h
+++ b/engines/sherlock/scalpel/scalpel_saveload.h
@@ -33,6 +33,8 @@ extern const int ENV_POINTS[6][3];
 
 class ScalpelSaveManager: public SaveManager {
 public:
+	SaveMode _envMode;
+public:
 	ScalpelSaveManager(SherlockEngine *vm, const Common::String &target);
 	virtual ~ScalpelSaveManager() {}
 
diff --git a/engines/sherlock/tattoo/tattoo_user_interface.cpp b/engines/sherlock/tattoo/tattoo_user_interface.cpp
index f602259..01f927b 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 016398e..652e5b1 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 0000000..37842bb
--- /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 0000000..6ef5aab
--- /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






More information about the Scummvm-git-logs mailing list