98 lines
2.4 KiB
C++
98 lines
2.4 KiB
C++
#pragma once
|
|
#include "render/Renderer.h"
|
|
#include "Environment.h"
|
|
#include "render/TextureManager.h"
|
|
#include "UiManager.h"
|
|
#include "items/Item.h"
|
|
#include "quest/QuestJournal.h"
|
|
#include <vector>
|
|
#include <string>
|
|
#include <memory>
|
|
|
|
namespace ZL {
|
|
|
|
extern const char* CONST_ZIP_FILE;
|
|
|
|
enum class GameState {
|
|
Gameplay,
|
|
Inventory,
|
|
QuestJournal,
|
|
PhoneScreen,
|
|
JournalScreen
|
|
};
|
|
|
|
enum class TutorialStep {
|
|
Step0, // Dialogue hint: "click to advance"
|
|
Step1, // Camera rotation hint
|
|
Step2, // Floor tap / walk hint
|
|
Step3, // Pinch-zoom hint
|
|
Step4, // Pick-up item hint
|
|
Step5, // Post-pickup reaction (sub-state: which items were collected)
|
|
};
|
|
|
|
class MenuManager {
|
|
public:
|
|
UiManager uiManager;
|
|
ZL::Quest::QuestJournal questJournal;
|
|
|
|
MenuManager(Renderer& iRenderer);
|
|
|
|
void setup(Inventory& inv, const std::string& zipFile);
|
|
|
|
void openInventory();
|
|
void closeInventory();
|
|
|
|
void openQuestJournal();
|
|
void closeQuestJournal();
|
|
void toggleQuestJournal();
|
|
|
|
bool isInventoryOpen() const { return state == GameState::Inventory; }
|
|
bool isQuestJournalOpen() const { return state == GameState::QuestJournal; }
|
|
|
|
void openPhoneScreen();
|
|
void closePhoneScreen();
|
|
void openJournalScreen();
|
|
void closeJournalScreen();
|
|
|
|
void advanceTutorialStep();
|
|
void onItemPickedUp(const std::string& itemId);
|
|
|
|
TutorialStep tutorialStep = TutorialStep::Step0;
|
|
|
|
protected:
|
|
Renderer& renderer;
|
|
|
|
private:
|
|
void enterGameplay();
|
|
void refreshQuestJournalUi();
|
|
void selectQuestByIndex(int index);
|
|
void refreshItemPickupHud();
|
|
void setupStep5Callbacks();
|
|
|
|
GameState state = GameState::Gameplay;
|
|
Inventory* inventory = nullptr;
|
|
|
|
bool tutorialPhonePickedUp = false;
|
|
bool tutorialJournalPickedUp = false;
|
|
bool tutorialPhoneScreenOpened = false;
|
|
bool tutorialJournalScreenOpened = false;
|
|
|
|
std::shared_ptr<UiNode> hudRoot;
|
|
std::shared_ptr<UiNode> hudStep1Root;
|
|
std::shared_ptr<UiNode> hudStep2Root;
|
|
std::shared_ptr<UiNode> hudStep3Root;
|
|
std::shared_ptr<UiNode> hudStep4Root;
|
|
std::shared_ptr<UiNode> hudStep5aRoot;
|
|
std::shared_ptr<UiNode> hudStep5bRoot;
|
|
std::shared_ptr<UiNode> hudStep5abRoot;
|
|
std::shared_ptr<UiNode> phoneScreenRoot;
|
|
std::shared_ptr<UiNode> journalScreenRoot;
|
|
std::shared_ptr<UiNode> inventoryRoot;
|
|
std::shared_ptr<UiNode> questJournalRoot;
|
|
|
|
int selectedQuestIndex = -1;
|
|
std::vector<std::string> visibleQuestIds;
|
|
};
|
|
|
|
} // namespace ZL
|