diff --git a/resources/w/ui/hud_uni_int.json b/resources/w/ui/hud_uni_int.json index 1c58f58..e8f46cf 100644 --- a/resources/w/ui/hud_uni_int.json +++ b/resources/w/ui/hud_uni_int.json @@ -73,6 +73,23 @@ "pressed": "resources/w/ui/img/Journal001_State=Tap.png" } }, + { + "type": "Button", + "name": "darklandsButton", + "horizontal_gravity": "right", + "vertical_gravity": "top", + "x": 330, + "y": -18, + "width": 165, + "height": 165, + "clickZoneWidth": 89, + "clickZoneHeight": 89, + "textures": { + "normal": "resources/w/ui/img/Darklands001_State=Default001.png", + "hover": "resources/w/ui/img/Darklands001_State=Hover001.png", + "pressed": "resources/w/ui/img/Darklands001_State=Pressed001.png" + } + }, { "type": "StaticImage", "name": "location", diff --git a/resources/w/ui/img/HealthBarBorder001.png b/resources/w/ui/img/HealthBarBorder001.png new file mode 100644 index 0000000..7102be6 --- /dev/null +++ b/resources/w/ui/img/HealthBarBorder001.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:603821bb3699b4fb9610deda576b9c6f857adbb8770c62cebe44145ed0e425b4 +size 31377 diff --git a/resources/w/ui/img/HealthBarLine001.png b/resources/w/ui/img/HealthBarLine001.png new file mode 100644 index 0000000..54a5286 --- /dev/null +++ b/resources/w/ui/img/HealthBarLine001.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b1e84418511945597fbf466272e3689b8c7ade908cb7a96aacf8214f6ceb743f +size 83050 diff --git a/resources/w/ui/img/HealthBarPanel001.png b/resources/w/ui/img/HealthBarPanel001.png new file mode 100644 index 0000000..b07f061 --- /dev/null +++ b/resources/w/ui/img/HealthBarPanel001.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7f54720ee525740449fce1ba0861a08acc23f68c19f05faf0ac89a1683fd2890 +size 1089235 diff --git a/src/Game.cpp b/src/Game.cpp index 26ea6ec..e5a6e98 100644 --- a/src/Game.cpp +++ b/src/Game.cpp @@ -394,6 +394,10 @@ namespace ZL if (currentLocation) currentLocation->dialogueSystem.startDialogue(id); }; + menuManager.startDarklandsTransitionFunc = [this]() { + startDarklandsTransition(); + }; + // Wire bubble-slot callback so chat bubbles appear as dialogue lines are shown. for (auto& [name, loc] : locations) { loc->dialogueSystem.setOnBubbleSlotReady([this](const std::string& bubbleSlot) { @@ -1103,6 +1107,11 @@ namespace ZL darklandsFlashAlpha = min(darklandsFlashAlpha + step, 1.0f); if (darklandsFlashAlpha >= 1.0f) { isDarklands = !isDarklands; + + + // Change HUD + menuManager.setDarklandsMode(isDarklands); + if (currentLocation) { if (isDarklands) currentLocation->scriptEngine.callDarklandsEnterCallback(); diff --git a/src/MenuManager.cpp b/src/MenuManager.cpp index dabf3e4..6fe8ec1 100644 --- a/src/MenuManager.cpp +++ b/src/MenuManager.cpp @@ -353,6 +353,9 @@ namespace ZL { uiManager.setButtonCallback("journalButton", [this](const std::string&) { openQuestJournal(); }); + uiManager.setButtonCallback("darklandsButton", [this](const std::string&) { + startDarklandsTransitionFunc(); + }); } void MenuManager::onLocationChanged(const std::string& locationName) { @@ -599,4 +602,19 @@ namespace ZL { uiManager.startPopIn(slotName, 300.0f); } + void MenuManager::setDarklandsMode(bool enabled) + { + if (enabled) + { + uiManager.setNodeVisible("darklandsButton", false); + uiManager.setNodeVisible("phoneButton", false); + + } + else + { + uiManager.setNodeVisible("darklandsButton", true); + uiManager.setNodeVisible("phoneButton", true); + } + } + } // namespace ZL diff --git a/src/MenuManager.h b/src/MenuManager.h index e52c914..51a2499 100644 --- a/src/MenuManager.h +++ b/src/MenuManager.h @@ -57,7 +57,9 @@ namespace ZL { bool isPhoneScreenOpen() const { return state == GameState::PhoneScreen; } std::function startDialogueFunc; + std::function startDarklandsTransitionFunc; + void setDarklandsMode(bool enabled); void advanceTutorialStep(); void onItemPickedUp(const std::string& itemId); void onLocationChanged(const std::string& locationName);