Working on phone messages

This commit is contained in:
Vladislav Khorev committed 2026-05-30 21:27:25 +03:00
1 parent cdab525858
commit 9425f9b19a
20 files changed
+591 -28

No files matched your search

+26 -4
View File
@@ -387,6 +387,18 @@ namespace ZL
menuManager.onItemPickedUp(itemId);
};
// Wire phone dialogue start function so MenuManager can trigger dialogues.
menuManager.startDialogueFunc = [this](const std::string& id) {
if (currentLocation) currentLocation->dialogueSystem.startDialogue(id);
};
// 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) {
menuManager.revealPhoneChatBubble(bubbleSlot);
});
}
currentLocation = locations["location_dorm"];
currentLocation->scriptEngine.callLocationEnterCallback();
@@ -705,6 +717,7 @@ namespace ZL
break;
case SDLK_f:
currentLocation->dialogueSystem.startDialogue("dialog_start001");
break;
case SDLK_e:
currentLocation->dialogueSystem.startCutscene("test_cutscene_01"); //.startDialogue("test_cutscene_pan_dialogue");
@@ -940,8 +953,11 @@ namespace ZL
const int uiX = mx;
const int uiY = Environment::projectionHeight - my;
menuManager.uiManager.onTouchDown(fingerId, uiX, uiY);
st.capturedByUi = menuManager.uiManager.isUiInteractionForFinger(fingerId);
const bool dialogueActive = currentLocation && currentLocation->dialogueSystem.isActive();
if (!dialogueActive) {
menuManager.uiManager.onTouchDown(fingerId, uiX, uiY);
}
st.capturedByUi = !dialogueActive && menuManager.uiManager.isUiInteractionForFinger(fingerId);
activePointers[fingerId] = st;
@@ -972,7 +988,10 @@ namespace ZL
{
const int uiX = mx;
const int uiY = Environment::projectionHeight - my;
menuManager.uiManager.onTouchUp(fingerId, uiX, uiY);
const bool dialogueActive = currentLocation && currentLocation->dialogueSystem.isActive();
if (!dialogueActive) {
menuManager.uiManager.onTouchUp(fingerId, uiX, uiY);
}
auto it = activePointers.find(fingerId);
if (it == activePointers.end()) return;
@@ -1013,7 +1032,10 @@ namespace ZL
{
const int uiX = mx;
const int uiY = Environment::projectionHeight - my;
menuManager.uiManager.onTouchMove(fingerId, uiX, uiY);
const bool dialogueActive = currentLocation && currentLocation->dialogueSystem.isActive();
if (!dialogueActive) {
menuManager.uiManager.onTouchMove(fingerId, uiX, uiY);
}
auto it = activePointers.find(fingerId);
if (it != activePointers.end()) {