Working on darklands mode
This commit is contained in:
1 parent
5f7e66f765
commit
3d4560bb51
7 files changed
+55
No files matched your search
@@ -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();
|
||||
|
||||
@@ -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
|
||||
@@ -57,7 +57,9 @@ namespace ZL {
|
||||
bool isPhoneScreenOpen() const { return state == GameState::PhoneScreen; }
|
||||
|
||||
std::function<void(const std::string&)> startDialogueFunc;
|
||||
std::function<void()> startDarklandsTransitionFunc;
|
||||
|
||||
void setDarklandsMode(bool enabled);
|
||||
void advanceTutorialStep();
|
||||
void onItemPickedUp(const std::string& itemId);
|
||||
void onLocationChanged(const std::string& locationName);
|
||||
|
||||
Reference in new issue
Block a user