aboutsummaryrefslogtreecommitdiff
path: root/engines/mutationofjb/gui.h
diff options
context:
space:
mode:
authorĽubomír Remák2018-04-11 21:15:01 +0200
committerEugene Sandulenko2018-08-25 23:12:01 +0200
commitc25ed8957228cfd580216383c3391ccc7e512bb5 (patch)
treefff52e7d5e588719ced3b164b6ea48c9779236af /engines/mutationofjb/gui.h
parent9af3d8a2381fe7c7440330a9aa338f51cd734990 (diff)
downloadscummvm-rg350-c25ed8957228cfd580216383c3391ccc7e512bb5.tar.gz
scummvm-rg350-c25ed8957228cfd580216383c3391ccc7e512bb5.tar.bz2
scummvm-rg350-c25ed8957228cfd580216383c3391ccc7e512bb5.zip
MUTATIONOFJB: Refactor inventory UI into separate widget, add button widgets.
Diffstat (limited to 'engines/mutationofjb/gui.h')
-rw-r--r--engines/mutationofjb/gui.h29
1 files changed, 24 insertions, 5 deletions
diff --git a/engines/mutationofjb/gui.h b/engines/mutationofjb/gui.h
index 27e0b0c2b3..5d8358b47f 100644
--- a/engines/mutationofjb/gui.h
+++ b/engines/mutationofjb/gui.h
@@ -23,10 +23,16 @@
#ifndef MUTATIONOFJB_GUI_H
#define MUTATIONOFJB_GUI_H
+#include "common/array.h"
#include "common/hashmap.h"
#include "common/hash-str.h"
#include "graphics/surface.h"
#include "mutationofjb/inventory.h"
+#include "mutationofjb/widgets/buttonwidget.h"
+
+namespace Common {
+class Event;
+}
namespace Graphics {
class Screen;
@@ -35,31 +41,44 @@ class Screen;
namespace MutationOfJB {
class Game;
+class Widget;
+class InventoryWidget;
-class Gui : public InventoryObserver {
+class Gui : public InventoryObserver, public ButtonWidgetCallback {
public:
+ typedef Common::HashMap<Common::String, int> InventoryMap;
+
friend class InventoryAnimationDecoderCallback;
+ friend class HudAnimationDecoderCallback;
+
Gui(Game &game, Graphics::Screen *screen);
+ ~Gui();
+ Game &getGame();
+
bool init();
void update();
- void markInventoryDirty();
+ void markDirty();
+ void handleEvent(const Common::Event &event);
virtual void onInventoryChanged() override;
+ virtual void onButtonClicked(ButtonWidget *) override;
private:
bool loadInventoryGfx();
+ bool loadHudGfx();
bool loadInventoryList();
void drawInventoryItem(const Common::String &item, int pos);
void drawInventory();
- typedef Common::HashMap<Common::String, int> InventoryMap;
-
Game &_game;
Graphics::Screen *_screen;
InventoryMap _inventoryItems;
Common::Array<Graphics::Surface> _inventorySurfaces;
- bool _inventoryDirty;
+ Common::Array<Graphics::Surface> _hudSurfaces;
+
+ InventoryWidget *_inventoryWidget;
+ Common::Array<Widget *> _widgets;
};
}