Clean up UI, work on tutorial

This commit is contained in:
Vladislav Khorev committed 2026-06-08 22:09:24 +03:00
1 parent cfbd29d5b1
commit 619de45221
79 files changed
+5122 -316

No files matched your search

+54 -1
View File
@@ -6,6 +6,7 @@
#include "items/Item.h"
#include "quest/QuestJournal.h"
#include <vector>
#include <deque>
#include <string>
#include <memory>
@@ -14,6 +15,8 @@ namespace ZL {
extern const char* CONST_ZIP_FILE;
enum class GameState {
MainMenu,
About,
Gameplay,
Inventory,
QuestJournal,
@@ -56,21 +59,28 @@ namespace ZL {
bool isInventoryOpen() const { return state == GameState::Inventory; }
bool isQuestJournalOpen() const { return state == GameState::QuestJournal; }
void showMainMenu();
bool isMainMenuOpen() const { return state == GameState::MainMenu; }
void openPhoneScreen();
void closePhoneScreen();
bool isPhoneScreenOpen() const { return state == GameState::PhoneScreen; }
void closePhoneEntirely();
void tutorialShowTaxiHint();
void setChatUnread(int chatIndex, bool unread);
void spendMoney(int amount);
int getMoney() const { return money_; }
std::function<void()> startGameFunc;
std::function<void(const std::string&)> startDialogueFunc;
std::function<void()> startDarklandsTransitionFunc;
std::function<void()> startNightTransitionFunc;
std::function<void(int)> chatOpenCallback;
std::function<void()> skipCutsceneFunc;
std::function<void()> callTaxiFunc;
// Called when a chat message bubble should be shown (text + direction)
void onChatBubbleReady(const std::string& text, bool incoming);
@@ -90,6 +100,10 @@ namespace ZL {
void onCutsceneFinished();
bool cutsceneHudActive_ = false;
// Toast notification system
void showToast(const std::string& iconPath, const std::string& text);
void update(float deltaMs);
TutorialStep tutorialStep = TutorialStep::Step0;
protected:
@@ -115,6 +129,27 @@ namespace ZL {
void closePhoneScreenFromChat();
void applyUniIntHud();
void rebuildChatBubblesFromHistory(int chatIndex);
void showAboutScreen();
// Toast internals
struct ToastEntry {
std::string iconPath;
std::string text;
float timer = 0.0f;
enum class State { FadeIn, Visible, FadeOut } state = State::FadeIn;
float currentAlpha() const;
};
struct ToastMessage { std::string iconPath; std::string text; };
void updateToasts(float deltaMs);
void applyToastsToUi();
void hideAllToastWidgets();
std::vector<ToastEntry> activeToasts_;
std::deque<ToastMessage> toastQueue_;
static constexpr float TOAST_FADE_MS = 1000.0f;
static constexpr float TOAST_VISIBLE_MS = 2000.0f;
GameState state = GameState::Gameplay;
Inventory* inventory = nullptr;
@@ -128,8 +163,13 @@ namespace ZL {
bool tutorialPhonePickedUp = false;
bool tutorialJournalPickedUp = false;
bool tutorialPhoneScreenOpened = false;
//bool tutorialPhoneScreenOpened = false;
bool tutorialPhoneChatScreenOpened = false;
bool tutorialJournalScreenOpened = false;
bool tutorialMessengerScreenOpened = false;
//bool tutorialTaxiScreenOpened = false;
bool tutorialNeedOpenTaxiScreen = false;
std::shared_ptr<UiNode> hudRoot;
std::shared_ptr<UiNode> hudStep1Root;
@@ -147,17 +187,30 @@ namespace ZL {
std::shared_ptr<UiNode> hudUniIntStep13Root;
std::shared_ptr<UiNode> hudUniIntDarkFullRoot;
std::shared_ptr<UiNode> hudUniExtDarkRoot;
std::shared_ptr<UiNode> hudCutsceneRoot_;
std::shared_ptr<UiNode> hudTopHintRoot_;
std::shared_ptr<UiNode> phoneMainRoot;
std::shared_ptr<UiNode> phoneMainHintARoot;
std::shared_ptr<UiNode> phoneMainHintBRoot;
std::shared_ptr<UiNode> phoneMainHintABRoot;
std::shared_ptr<UiNode> phoneBankRoot;
std::shared_ptr<UiNode> phoneVideoRoot;
std::shared_ptr<UiNode> phoneMapDormRoot;
std::shared_ptr<UiNode> phoneMapUniRoot;
std::shared_ptr<UiNode> phoneChatListRoot;
std::shared_ptr<UiNode> phoneChatListHintRoot;
std::shared_ptr<UiNode> phoneChat1Root;
std::shared_ptr<UiNode> phoneChat2Root;
std::shared_ptr<UiNode> phoneChat3Root;
std::shared_ptr<UiNode> mainMenuRoot;
std::shared_ptr<UiNode> aboutScreenRoot;
std::shared_ptr<UiNode> newInventoryRoot;
std::shared_ptr<UiNode> questJournalRoot;