Working on darklands mode
This commit is contained in:
parent
5f7e66f765
commit
3d4560bb51
@ -73,6 +73,23 @@
|
|||||||
"pressed": "resources/w/ui/img/Journal001_State=Tap.png"
|
"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",
|
"type": "StaticImage",
|
||||||
"name": "location",
|
"name": "location",
|
||||||
|
|||||||
BIN
resources/w/ui/img/HealthBarBorder001.png
(Stored with Git LFS)
Normal file
BIN
resources/w/ui/img/HealthBarBorder001.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
resources/w/ui/img/HealthBarLine001.png
(Stored with Git LFS)
Normal file
BIN
resources/w/ui/img/HealthBarLine001.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
resources/w/ui/img/HealthBarPanel001.png
(Stored with Git LFS)
Normal file
BIN
resources/w/ui/img/HealthBarPanel001.png
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -394,6 +394,10 @@ namespace ZL
|
|||||||
if (currentLocation) currentLocation->dialogueSystem.startDialogue(id);
|
if (currentLocation) currentLocation->dialogueSystem.startDialogue(id);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
menuManager.startDarklandsTransitionFunc = [this]() {
|
||||||
|
startDarklandsTransition();
|
||||||
|
};
|
||||||
|
|
||||||
// Wire bubble-slot callback so chat bubbles appear as dialogue lines are shown.
|
// Wire bubble-slot callback so chat bubbles appear as dialogue lines are shown.
|
||||||
for (auto& [name, loc] : locations) {
|
for (auto& [name, loc] : locations) {
|
||||||
loc->dialogueSystem.setOnBubbleSlotReady([this](const std::string& bubbleSlot) {
|
loc->dialogueSystem.setOnBubbleSlotReady([this](const std::string& bubbleSlot) {
|
||||||
@ -1103,6 +1107,11 @@ namespace ZL
|
|||||||
darklandsFlashAlpha = min(darklandsFlashAlpha + step, 1.0f);
|
darklandsFlashAlpha = min(darklandsFlashAlpha + step, 1.0f);
|
||||||
if (darklandsFlashAlpha >= 1.0f) {
|
if (darklandsFlashAlpha >= 1.0f) {
|
||||||
isDarklands = !isDarklands;
|
isDarklands = !isDarklands;
|
||||||
|
|
||||||
|
|
||||||
|
// Change HUD
|
||||||
|
menuManager.setDarklandsMode(isDarklands);
|
||||||
|
|
||||||
if (currentLocation) {
|
if (currentLocation) {
|
||||||
if (isDarklands)
|
if (isDarklands)
|
||||||
currentLocation->scriptEngine.callDarklandsEnterCallback();
|
currentLocation->scriptEngine.callDarklandsEnterCallback();
|
||||||
|
|||||||
@ -353,6 +353,9 @@ namespace ZL {
|
|||||||
uiManager.setButtonCallback("journalButton", [this](const std::string&) {
|
uiManager.setButtonCallback("journalButton", [this](const std::string&) {
|
||||||
openQuestJournal();
|
openQuestJournal();
|
||||||
});
|
});
|
||||||
|
uiManager.setButtonCallback("darklandsButton", [this](const std::string&) {
|
||||||
|
startDarklandsTransitionFunc();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void MenuManager::onLocationChanged(const std::string& locationName) {
|
void MenuManager::onLocationChanged(const std::string& locationName) {
|
||||||
@ -599,4 +602,19 @@ namespace ZL {
|
|||||||
uiManager.startPopIn(slotName, 300.0f);
|
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
|
} // namespace ZL
|
||||||
|
|||||||
@ -57,7 +57,9 @@ namespace ZL {
|
|||||||
bool isPhoneScreenOpen() const { return state == GameState::PhoneScreen; }
|
bool isPhoneScreenOpen() const { return state == GameState::PhoneScreen; }
|
||||||
|
|
||||||
std::function<void(const std::string&)> startDialogueFunc;
|
std::function<void(const std::string&)> startDialogueFunc;
|
||||||
|
std::function<void()> startDarklandsTransitionFunc;
|
||||||
|
|
||||||
|
void setDarklandsMode(bool enabled);
|
||||||
void advanceTutorialStep();
|
void advanceTutorialStep();
|
||||||
void onItemPickedUp(const std::string& itemId);
|
void onItemPickedUp(const std::string& itemId);
|
||||||
void onLocationChanged(const std::string& locationName);
|
void onLocationChanged(const std::string& locationName);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user