2018-04-04 20:39:08 +02:00
|
|
|
/* 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.
|
|
|
|
*
|
2021-12-26 18:47:58 +01:00
|
|
|
* 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 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
2018-04-04 20:39:08 +02:00
|
|
|
*
|
|
|
|
* 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
|
2021-12-26 18:47:58 +01:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2018-04-04 20:39:08 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MUTATIONOFJB_GUI_H
|
|
|
|
#define MUTATIONOFJB_GUI_H
|
|
|
|
|
2018-09-06 19:38:16 +02:00
|
|
|
#include "mutationofjb/inventory.h"
|
2018-10-28 13:08:41 +01:00
|
|
|
#include "mutationofjb/script.h"
|
|
|
|
#include "mutationofjb/guiscreen.h"
|
2018-09-06 19:38:16 +02:00
|
|
|
#include "mutationofjb/widgets/buttonwidget.h"
|
|
|
|
#include "mutationofjb/widgets/inventorywidget.h"
|
2018-10-28 13:08:41 +01:00
|
|
|
#include "mutationofjb/widgets/gamewidget.h"
|
2018-09-06 19:38:16 +02:00
|
|
|
|
2018-04-11 21:15:01 +02:00
|
|
|
#include "common/array.h"
|
2018-04-04 20:39:08 +02:00
|
|
|
#include "common/hashmap.h"
|
|
|
|
#include "common/hash-str.h"
|
2018-09-06 19:38:16 +02:00
|
|
|
|
2018-04-04 20:39:08 +02:00
|
|
|
#include "graphics/surface.h"
|
2018-04-11 21:15:01 +02:00
|
|
|
|
|
|
|
namespace Common {
|
2018-08-19 15:38:12 +02:00
|
|
|
struct Event;
|
2018-04-11 21:15:01 +02:00
|
|
|
}
|
2018-04-04 20:39:08 +02:00
|
|
|
|
|
|
|
namespace Graphics {
|
|
|
|
class Screen;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace MutationOfJB {
|
|
|
|
|
|
|
|
class Game;
|
2018-04-11 21:15:01 +02:00
|
|
|
class Widget;
|
|
|
|
class InventoryWidget;
|
2018-04-14 23:04:20 +02:00
|
|
|
class ConversationWidget;
|
2018-10-28 13:08:41 +01:00
|
|
|
class LabelWidget;
|
|
|
|
class GameWidget;
|
2018-04-04 20:39:08 +02:00
|
|
|
|
2018-10-28 13:08:41 +01:00
|
|
|
class GameScreen : public GuiScreen, public InventoryObserver, public ButtonWidgetCallback, public InventoryWidgetCallback, public GameWidgetCallback {
|
2018-04-04 20:39:08 +02:00
|
|
|
public:
|
|
|
|
friend class InventoryAnimationDecoderCallback;
|
2018-04-11 21:15:01 +02:00
|
|
|
friend class HudAnimationDecoderCallback;
|
|
|
|
|
2018-09-06 19:38:16 +02:00
|
|
|
GameScreen(Game &game, Graphics::Screen *screen);
|
2020-02-09 12:05:30 +01:00
|
|
|
~GameScreen() override;
|
2018-04-11 21:15:01 +02:00
|
|
|
|
2018-04-04 20:39:08 +02:00
|
|
|
bool init();
|
|
|
|
|
2020-02-09 12:05:30 +01:00
|
|
|
void handleEvent(const Common::Event &event) override;
|
2018-10-28 13:08:41 +01:00
|
|
|
|
2020-02-09 12:05:30 +01:00
|
|
|
void onInventoryChanged() override;
|
|
|
|
void onButtonClicked(ButtonWidget *) override;
|
|
|
|
void onInventoryItemHovered(InventoryWidget *widget, int posInWidget) override;
|
|
|
|
void onInventoryItemClicked(InventoryWidget *widget, int posInWidget) override;
|
|
|
|
void onGameDoorClicked(GameWidget *, Door *door) override;
|
|
|
|
void onGameStaticClicked(GameWidget *, Static *stat) override;
|
|
|
|
void onGameEntityHovered(GameWidget *, const Common::String &entity) override;
|
2018-04-04 20:39:08 +02:00
|
|
|
|
2018-08-04 16:57:41 +02:00
|
|
|
ConversationWidget &getConversationWidget();
|
2018-04-14 23:04:20 +02:00
|
|
|
|
2018-10-28 13:08:41 +01:00
|
|
|
void showConversationWidget(bool show);
|
|
|
|
void refreshAfterSceneChanged();
|
|
|
|
|
2018-04-04 20:39:08 +02:00
|
|
|
private:
|
|
|
|
bool loadInventoryGfx();
|
2018-04-11 21:15:01 +02:00
|
|
|
bool loadHudGfx();
|
2018-04-04 20:39:08 +02:00
|
|
|
void drawInventoryItem(const Common::String &item, int pos);
|
|
|
|
void drawInventory();
|
|
|
|
|
2018-10-28 13:08:41 +01:00
|
|
|
void updateStatusBarText(const Common::String &entity, bool inventory);
|
|
|
|
|
2018-04-04 20:39:08 +02:00
|
|
|
Common::Array<Graphics::Surface> _inventorySurfaces;
|
2018-04-11 21:15:01 +02:00
|
|
|
Common::Array<Graphics::Surface> _hudSurfaces;
|
|
|
|
|
2018-10-28 13:08:41 +01:00
|
|
|
Common::Array<ButtonWidget *> _buttons;
|
2018-04-11 21:15:01 +02:00
|
|
|
InventoryWidget *_inventoryWidget;
|
2018-04-14 23:04:20 +02:00
|
|
|
ConversationWidget *_conversationWidget;
|
2018-10-28 13:08:41 +01:00
|
|
|
LabelWidget *_statusBarWidget;
|
|
|
|
GameWidget *_gameWidget;
|
|
|
|
|
|
|
|
ActionInfo::Action _currentAction;
|
|
|
|
Common::String _currentPickedItem;
|
2018-04-04 20:39:08 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|