Working on UI hints
This commit is contained in:
1 parent
3d4560bb51
commit
8552725dfc
28 files changed
+1052
-46
No files matched your search
+93
-26
@@ -81,8 +81,14 @@ namespace ZL {
|
||||
hudStep5aRoot = loadUiFromFile("resources/w/ui/hud_step5a.json", renderer, zipFile);
|
||||
hudStep5bRoot = loadUiFromFile("resources/w/ui/hud_step5b.json", renderer, zipFile);
|
||||
hudStep5abRoot = loadUiFromFile("resources/w/ui/hud_step5ab.json", renderer, zipFile);
|
||||
hudUniExtRoot = loadUiFromFile("resources/w/ui/hud_uni_ext.json", renderer, zipFile);
|
||||
hudUniIntRoot = loadUiFromFile("resources/w/ui/hud_uni_int.json", renderer, zipFile);
|
||||
hudUniExtRoot = loadUiFromFile("resources/w/ui/hud_uni_ext.json", renderer, zipFile);
|
||||
hudUniIntStep10Root = loadUiFromFile("resources/w/ui/hud_uni_int_step10.json", renderer, zipFile);
|
||||
hudUniIntStep11Root = loadUiFromFile("resources/w/ui/hud_uni_int_step11.json", renderer, zipFile);
|
||||
hudUniIntStep12Root = loadUiFromFile("resources/w/ui/hud_uni_int_step12.json", renderer, zipFile);
|
||||
hudUniIntStep13Root = loadUiFromFile("resources/w/ui/hud_uni_int_step13.json", renderer, zipFile);
|
||||
hudUniIntFullRoot = loadUiFromFile("resources/w/ui/hud_uni_int_full.json", renderer, zipFile);
|
||||
hudUniIntDarkFullRoot = loadUiFromFile("resources/w/ui/hud_uni_int_dark_full.json", renderer, zipFile);
|
||||
hudUniExtDarkRoot = loadUiFromFile("resources/w/ui/hud_uni_ext_dark.json", renderer, zipFile);
|
||||
phoneChatListRoot = loadUiFromFile("resources/w/ui/screen_phone_chat_list.json", renderer, zipFile);
|
||||
phoneChat1Root = loadUiFromFile("resources/w/ui/screen_phone_chat1.json", renderer, zipFile);
|
||||
phoneChat2Root = loadUiFromFile("resources/w/ui/screen_phone_chat2.json", renderer, zipFile);
|
||||
@@ -344,29 +350,25 @@ namespace ZL {
|
||||
}
|
||||
|
||||
void MenuManager::setupGameplayHudCallbacks() {
|
||||
uiManager.setButtonCallback("phoneButton", [this](const std::string&) {
|
||||
openPhoneScreen();
|
||||
});
|
||||
uiManager.setButtonCallback("inventoryButton", [this](const std::string&) {
|
||||
openInventory();
|
||||
});
|
||||
uiManager.setButtonCallback("journalButton", [this](const std::string&) {
|
||||
openQuestJournal();
|
||||
});
|
||||
uiManager.setButtonCallback("darklandsButton", [this](const std::string&) {
|
||||
startDarklandsTransitionFunc();
|
||||
});
|
||||
if (uiManager.findButton("phoneButton"))
|
||||
uiManager.setButtonCallback("phoneButton", [this](const std::string&) { openPhoneScreen(); });
|
||||
if (uiManager.findButton("inventoryButton"))
|
||||
uiManager.setButtonCallback("inventoryButton", [this](const std::string&) { openInventory(); });
|
||||
if (uiManager.findButton("journalButton"))
|
||||
uiManager.setButtonCallback("journalButton", [this](const std::string&) { openQuestJournal(); });
|
||||
if (uiManager.findButton("darklandsButton"))
|
||||
uiManager.setButtonCallback("darklandsButton", [this](const std::string&) { startDarklandsTransitionFunc(); });
|
||||
}
|
||||
|
||||
void MenuManager::onLocationChanged(const std::string& locationName) {
|
||||
if (state != GameState::Gameplay) return;
|
||||
currentLocationName_ = locationName;
|
||||
|
||||
if (locationName == "uni_exterior") {
|
||||
uiManager.replaceRoot(hudUniExtRoot);
|
||||
uiManager.replaceRoot(currentIsDarklands_ ? hudUniExtDarkRoot : hudUniExtRoot);
|
||||
setupGameplayHudCallbacks();
|
||||
} else if (locationName == "uni_interior") {
|
||||
uiManager.replaceRoot(hudUniIntRoot);
|
||||
setupGameplayHudCallbacks();
|
||||
applyUniIntHud();
|
||||
} else {
|
||||
// Returning to dorm: reuse step5ab, suppress already-completed hints
|
||||
uiManager.replaceRoot(hudStep5abRoot);
|
||||
@@ -408,10 +410,22 @@ namespace ZL {
|
||||
}
|
||||
|
||||
void MenuManager::onItemPickedUp(const std::string& itemId) {
|
||||
if (itemId == "note_spell" && uniIntTutorialState_ == UniIntTutorialState::Step10) {
|
||||
uniIntTutorialState_ = UniIntTutorialState::Step11;
|
||||
if (currentLocationName_ == "uni_interior" && state == GameState::Gameplay)
|
||||
applyUniIntHud();
|
||||
}
|
||||
|
||||
if (tutorialStep != TutorialStep::Step4 && tutorialStep != TutorialStep::Step5) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Dorm tutorial HUD logic must not run in other locations.
|
||||
// currentLocationName_ is empty only before the first teleport (still in dorm).
|
||||
if (!currentLocationName_.empty() && currentLocationName_ != "location_dorm") {
|
||||
return;
|
||||
}
|
||||
|
||||
if (itemId == "phone") tutorialPhonePickedUp = true;
|
||||
if (itemId == "journal") tutorialJournalPickedUp = true;
|
||||
|
||||
@@ -604,17 +618,70 @@ namespace ZL {
|
||||
|
||||
void MenuManager::setDarklandsMode(bool enabled)
|
||||
{
|
||||
if (enabled)
|
||||
{
|
||||
uiManager.setNodeVisible("darklandsButton", false);
|
||||
uiManager.setNodeVisible("phoneButton", false);
|
||||
currentIsDarklands_ = enabled;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
uiManager.setNodeVisible("darklandsButton", true);
|
||||
uiManager.setNodeVisible("phoneButton", true);
|
||||
if (currentLocationName_ == "uni_interior") {
|
||||
if (enabled && uniIntTutorialState_ == UniIntTutorialState::Step11) {
|
||||
uniIntTutorialState_ = UniIntTutorialState::DarklandsActive;
|
||||
}
|
||||
applyUniIntHud();
|
||||
} else if (currentLocationName_ == "uni_exterior") {
|
||||
if (state == GameState::Gameplay) {
|
||||
uiManager.replaceRoot(enabled ? hudUniExtDarkRoot : hudUniExtRoot);
|
||||
setupGameplayHudCallbacks();
|
||||
}
|
||||
} else {
|
||||
uiManager.setNodeVisible("darklandsButton", !enabled);
|
||||
uiManager.setNodeVisible("phoneButton", !enabled);
|
||||
}
|
||||
}
|
||||
|
||||
void MenuManager::applyUniIntHud()
|
||||
{
|
||||
if (state != GameState::Gameplay) return;
|
||||
std::shared_ptr<UiNode> root;
|
||||
if (currentIsDarklands_) {
|
||||
switch (uniIntTutorialState_) {
|
||||
case UniIntTutorialState::DarklandsStep13: root = hudUniIntStep13Root; break;
|
||||
case UniIntTutorialState::DarklandsFull: root = hudUniIntDarkFullRoot; break;
|
||||
default: root = hudUniIntStep12Root; break;
|
||||
}
|
||||
} else {
|
||||
switch (uniIntTutorialState_) {
|
||||
case UniIntTutorialState::Step10: root = hudUniIntStep10Root; break;
|
||||
case UniIntTutorialState::Step11: root = hudUniIntStep11Root; break;
|
||||
default: root = hudUniIntFullRoot; break;
|
||||
}
|
||||
}
|
||||
uiManager.replaceRoot(root);
|
||||
setupGameplayHudCallbacks();
|
||||
}
|
||||
|
||||
void MenuManager::onPlayerStartedWalking()
|
||||
{
|
||||
if (currentLocationName_ == "uni_interior"
|
||||
&& currentIsDarklands_
|
||||
&& uniIntTutorialState_ == UniIntTutorialState::DarklandsActive) {
|
||||
uiManager.setNodeVisible("hint_darklands003", false);
|
||||
uiManager.setNodeVisible("hint_darklands003_arrow", false);
|
||||
}
|
||||
}
|
||||
|
||||
void MenuManager::advanceUniIntDarklandsHud()
|
||||
{
|
||||
if (uniIntTutorialState_ != UniIntTutorialState::DarklandsActive) return;
|
||||
uniIntTutorialState_ = UniIntTutorialState::DarklandsStep13;
|
||||
if (currentLocationName_ == "uni_interior" && currentIsDarklands_ && state == GameState::Gameplay)
|
||||
applyUniIntHud();
|
||||
}
|
||||
|
||||
void MenuManager::onEnemyKilledInUniInterior()
|
||||
{
|
||||
if (uniIntTutorialState_ != UniIntTutorialState::DarklandsActive
|
||||
&& uniIntTutorialState_ != UniIntTutorialState::DarklandsStep13) return;
|
||||
uniIntTutorialState_ = UniIntTutorialState::DarklandsFull;
|
||||
if (currentLocationName_ == "uni_interior" && currentIsDarklands_ && state == GameState::Gameplay)
|
||||
applyUniIntHud();
|
||||
}
|
||||
|
||||
} // namespace ZL
|
||||
Reference in new issue
Block a user