aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2018-07-08 19:23:31 +0200
committerEugene Sandulenko2018-07-11 22:45:36 +0200
commit468d9d09f0d013d8f897acd2ee3df258e84688e3 (patch)
tree0c579f49a86fc00a239c02d76aa09cf206a16e38
parent2446810378c6279583a89ca0afc3733442607860 (diff)
downloadscummvm-rg350-468d9d09f0d013d8f897acd2ee3df258e84688e3.tar.gz
scummvm-rg350-468d9d09f0d013d8f897acd2ee3df258e84688e3.tar.bz2
scummvm-rg350-468d9d09f0d013d8f897acd2ee3df258e84688e3.zip
PINK: Plugged in MacWindowManager for showing in-game menu
-rw-r--r--engines/pink/director.cpp56
-rw-r--r--engines/pink/director.h9
2 files changed, 62 insertions, 3 deletions
diff --git a/engines/pink/director.cpp b/engines/pink/director.cpp
index 966e1ca7a2..695ae0c4cf 100644
--- a/engines/pink/director.cpp
+++ b/engines/pink/director.cpp
@@ -29,10 +29,62 @@
#include "pink/objects/actions/action_cel.h"
#include "pink/objects/actors/actor.h"
+#include "graphics/macgui/macmenu.h"
+
namespace Pink {
+
+enum {
+ kMenuHighLevel = -1,
+ kMenuAbout = 0,
+ kMenuGame = 1,
+ kMenuBOK = 2,
+ kMenuOnline = 3,
+ kMenuHelp = 4
+};
+
+enum {
+ kMenuActionAbout,
+ kMenuActionNewGame,
+ kMenuActionOpenSavedGame,
+ kMenuActionSaveGame,
+ kMenuActionSaveGameAs,
+ kMenuActionSongs,
+ kMenuActionSoundPreferences,
+ kMenuActionPause,
+ kMenuActionExit
+};
+
+static const Graphics::MacMenuData menuSubItems[] = {
+ { kMenuHighLevel, "Game", 0, 0, false },
+ { kMenuHighLevel, "Book of Knowledge", 0, 0, false },
+ { kMenuHighLevel, "Online", 0, 0, false },
+ { kMenuHighLevel, "Help", 0, 0, false },
+
+ { kMenuGame, "New Game", kMenuActionNewGame, 'N', false },
+ { kMenuGame, "Open Saved Game...", kMenuActionOpenSavedGame, 'O', false },
+ { kMenuGame, "Save Game", kMenuActionSaveGame, 'S', false },
+ { kMenuGame, "Save Game As...", kMenuActionSaveGameAs, 0, false },
+ { kMenuGame, NULL, 0, 0, false },
+ { kMenuGame, "Songs", kMenuActionSongs, 0, false },
+ { kMenuGame, NULL, 0, 0, false },
+ { kMenuGame, "Sound Preferences...", kMenuActionSoundPreferences, 0, false },
+ { kMenuGame, NULL, 0, 0, false },
+ { kMenuGame, "Pause", kMenuActionPause, 'P', false },
+ { kMenuGame, "Exit", kMenuActionExit, 'N', false },
+
+ { 0, NULL, 0, 0, false }
+};
+
+
Director::Director()
: _surface(640, 480) {
- _wndManager.setScreen(&_surface);
+ _wm.setScreen(&_surface);
+ _wm.setMode(Graphics::kWMModeNoDesktop | Graphics::kWMModeAutohideMenu);
+ _wm.setMenuHotzone(Common::Rect(0, 0, 640, 23));
+ _wm.setMenuDelay(250);
+
+ _menu = _wm.addMenu();
+ _menu->addStaticMenus(menuSubItems);
}
void Director::update() {
@@ -45,6 +97,8 @@ void Director::update() {
_sprites[i]->update();
}
+ _wm.draw();
+
draw();
}
diff --git a/engines/pink/director.h b/engines/pink/director.h
index 3fdb7539ca..35f0dcc62c 100644
--- a/engines/pink/director.h
+++ b/engines/pink/director.h
@@ -30,6 +30,10 @@
#include "graphics/macgui/macwindowmanager.h"
#include "graphics/screen.h"
+namespace Graphics {
+ class MacMenu;
+}
+
namespace Pink {
class Actor;
@@ -62,7 +66,7 @@ public:
Actor *getActorByPoint(const Common::Point point);
- Graphics::MacWindowManager &getWndManager() { return _wndManager; };
+ Graphics::MacWindowManager &getWndManager() { return _wm; };
private:
void draw();
@@ -71,7 +75,8 @@ private:
private:
Graphics::Screen _surface;
- Graphics::MacWindowManager _wndManager;
+ Graphics::MacWindowManager _wm;
+ Graphics::MacMenu *_menu;
Common::Array<Common::Rect> _dirtyRects;
Common::Array<ActionCEL *> _sprites;
Common::Array<ActionCEL *> _savedSprites;