[Scummvm-cvs-logs] SF.net SVN: scummvm:[55100] scummvm/trunk/engines/hugo

sev at users.sourceforge.net sev at users.sourceforge.net
Mon Jan 3 13:38:13 CET 2011


Revision: 55100
          http://scummvm.svn.sourceforge.net/scummvm/?rev=55100&view=rev
Author:   sev
Date:     2011-01-03 12:38:13 +0000 (Mon, 03 Jan 2011)

Log Message:
-----------
HUGO: Stub for the top menu

Modified Paths:
--------------
    scummvm/trunk/engines/hugo/hugo.cpp
    scummvm/trunk/engines/hugo/hugo.h
    scummvm/trunk/engines/hugo/module.mk
    scummvm/trunk/engines/hugo/mouse.cpp

Added Paths:
-----------
    scummvm/trunk/engines/hugo/menu.cpp
    scummvm/trunk/engines/hugo/menu.h

Modified: scummvm/trunk/engines/hugo/hugo.cpp
===================================================================
--- scummvm/trunk/engines/hugo/hugo.cpp	2011-01-03 12:23:50 UTC (rev 55099)
+++ scummvm/trunk/engines/hugo/hugo.cpp	2011-01-03 12:38:13 UTC (rev 55100)
@@ -159,6 +159,8 @@
 
 	_screen->freeFonts();
 
+	delete _topMenu;
+
 	delete _object;
 	delete _sound;
 	delete _route;
@@ -196,6 +198,8 @@
 	_route = new Route(this);
 	_sound = new SoundHandler(this);
 
+	_topMenu = new TopMenu(this);
+
 	switch (_gameVariant) {
 	case 0: // H1 Win
 		_file = new FileManager_v1w(this);

Modified: scummvm/trunk/engines/hugo/hugo.h
===================================================================
--- scummvm/trunk/engines/hugo/hugo.h	2011-01-03 12:23:50 UTC (rev 55099)
+++ scummvm/trunk/engines/hugo/hugo.h	2011-01-03 12:38:13 UTC (rev 55100)
@@ -29,6 +29,7 @@
 #include "engines/engine.h"
 #include "common/file.h"
 #include "hugo/console.h"
+#include "hugo/menu.h"
 
 // This include is here temporarily while the engine is being refactored.
 #include "hugo/game.h"
@@ -280,6 +281,8 @@
 	IntroHandler *_intro;
 	ObjectHandler *_object;
 
+	TopMenu *_topMenu;
+
 protected:
 
 	// Engine APIs

Added: scummvm/trunk/engines/hugo/menu.cpp
===================================================================
--- scummvm/trunk/engines/hugo/menu.cpp	                        (rev 0)
+++ scummvm/trunk/engines/hugo/menu.cpp	2011-01-03 12:38:13 UTC (rev 55100)
@@ -0,0 +1,95 @@
+/* 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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "hugo/hugo.h"
+
+namespace Hugo {
+
+enum {
+	kMenuX = 5,
+	kMenuY = 1,
+	kButtonWidth = 18,
+	kButtonHeight = 18,
+	kButtonPad = 1,
+	kButtonSpace = 5
+};
+
+enum {
+	kCmdWhat = 'WHAT',
+	kCmdMusic = 'MUZK',
+	kCmdVolume = 'VOLM',
+	kCmdLoad = 'LOAD',
+	kCmdSave = 'SAVE',
+	kCmdUndo = 'UNDO',
+	kCmdText = 'TEXT',
+	kCmdLook = 'LOOK',
+	kCmdBomb = 'BOMB'
+};
+
+TopMenu::TopMenu(HugoEngine *vm) : Dialog(0, 0, 320, 20),
+	_vm(vm) {
+	init();
+}
+
+void TopMenu::init() {
+	int x = kMenuX;
+	int y = kMenuY;
+
+	_whatButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, "What is it?", kCmdWhat);
+	x += kButtonWidth + kButtonPad;
+
+	_musicButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, "Music", kCmdMusic);
+	x += kButtonWidth + kButtonPad;
+
+	_volumeButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, "Volume", kCmdVolume);
+	x += kButtonWidth + kButtonPad;
+
+	x += kButtonSpace;
+
+	_loadButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, "Load game", kCmdLoad);
+	x += kButtonWidth + kButtonPad;
+
+	_saveButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, "Save game", kCmdSave);
+	x += kButtonWidth + kButtonPad;
+
+	x += kButtonSpace;
+
+	_undoButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, "Undo", kCmdUndo);
+	x += kButtonWidth + kButtonPad;
+	
+	_textButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, "Text", kCmdText);
+	x += kButtonWidth + kButtonPad;
+
+	x += kButtonSpace;
+	
+	_lookButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, "Look", kCmdLook);
+	x += kButtonWidth + kButtonPad;
+	
+	_bombButton = new GUI::PicButtonWidget(this, x, y, kButtonWidth, kButtonHeight, "Bomb", kCmdBomb);
+	x += kButtonWidth + kButtonPad;
+
+}
+
+} // End of namespace Hugo


Property changes on: scummvm/trunk/engines/hugo/menu.cpp
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Added: scummvm/trunk/engines/hugo/menu.h
===================================================================
--- scummvm/trunk/engines/hugo/menu.h	                        (rev 0)
+++ scummvm/trunk/engines/hugo/menu.h	2011-01-03 12:38:13 UTC (rev 55100)
@@ -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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef HUGO_TOPMENU_H
+#define HUGO_TOPMENU_H
+
+#include "gui/dialog.h"
+
+namespace Hugo {
+
+class TopMenu : public GUI::Dialog {
+public:
+	TopMenu(HugoEngine *vm);
+
+	/*
+	void handleTickle();
+	void reflowLayout();
+	void handleMouseWheel(int x, int y, int direction);
+	void handleKeyDown(Common::KeyState state);
+	void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
+	*/
+
+protected:
+	void init();
+
+	HugoEngine *_vm;
+
+	GUI::PicButtonWidget *_whatButton;
+	GUI::PicButtonWidget *_musicButton;
+	GUI::PicButtonWidget *_volumeButton;
+	GUI::PicButtonWidget *_loadButton;
+	GUI::PicButtonWidget *_saveButton;
+	GUI::PicButtonWidget *_undoButton;
+	GUI::PicButtonWidget *_textButton;
+	GUI::PicButtonWidget *_lookButton;
+	GUI::PicButtonWidget *_bombButton;
+};
+
+}
+
+#endif // HUGO_TOPMENU_H


Property changes on: scummvm/trunk/engines/hugo/menu.h
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Modified: scummvm/trunk/engines/hugo/module.mk
===================================================================
--- scummvm/trunk/engines/hugo/module.mk	2011-01-03 12:23:50 UTC (rev 55099)
+++ scummvm/trunk/engines/hugo/module.mk	2011-01-03 12:38:13 UTC (rev 55100)
@@ -20,6 +20,7 @@
 	intro_v2w.o \
 	intro_v3w.o \
 	inventory.o \
+	menu.o \
 	mouse.o \
 	object.o \
 	object_v1d.o \

Modified: scummvm/trunk/engines/hugo/mouse.cpp
===================================================================
--- scummvm/trunk/engines/hugo/mouse.cpp	2011-01-03 12:23:50 UTC (rev 55099)
+++ scummvm/trunk/engines/hugo/mouse.cpp	2011-01-03 12:38:13 UTC (rev 55100)
@@ -276,8 +276,14 @@
 
 	int16 objId = -1;                               // Current source object
 	// Process cursor over an object or icon
-	if (gameStatus.inventoryState == I_ACTIVE)      // Check inventory icon bar first
+	if (gameStatus.inventoryState == I_ACTIVE) {      // Check inventory icon bar first
 		objId = _vm->_inventory->processInventory(INV_GET, cx, cy);
+	} else {
+		if (cy < 5 && cy > 0) {
+			_vm->_topMenu->runModal();
+		}
+	}
+
 	if (objId == -1)                                // No match, check rest of view
 		objId = _vm->_object->findObject(cx, cy);
 	if (objId >= 0) {                               // Got a match


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list