Working on messenger

This commit is contained in:
Vladislav Khorev committed 2026-06-05 12:13:02 +03:00
1 parent 9221ab68ac
commit 1fc8120ee0
25 files changed
+445 -259

No files matched your search

+1 -1
View File
@@ -105,7 +105,7 @@ Node DialogueDatabase::parseNode(const json& j) {
node.falseNext = j.value("falseNext", "");
node.cutsceneId = j.value("cutsceneId", "");
node.luaCallback = j.value("luaCallback", "");
node.bubbleSlot = j.value("bubbleSlot", "");
node.chatBubble = j.value("chatBubble", "");
node.questUnlock = j.value("questUnlock", "");
node.questComplete = j.value("questComplete", "");
node.questFail = j.value("questFail", "");
+4 -4
View File
@@ -87,8 +87,8 @@ void DialogueRuntime::setOnCutsceneFadeInComplete(std::function<void(const std::
onCutsceneFadeInComplete = std::move(cb);
}
void DialogueRuntime::setOnBubbleSlotReady(std::function<void(const std::string&)> cb) {
onBubbleSlotReady = std::move(cb);
void DialogueRuntime::setOnChatBubbleReady(std::function<void(const std::string&, bool)> cb) {
onChatBubbleReady = std::move(cb);
}
void DialogueRuntime::stop() {
@@ -466,8 +466,8 @@ void DialogueRuntime::presentLine(const Node& node) {
if (!node.luaCallback.empty() && onDialogueLineStarted) {
onDialogueLineStarted(node.luaCallback);
}
if (!node.bubbleSlot.empty() && onBubbleSlotReady) {
onBubbleSlotReady(node.bubbleSlot);
if (!node.chatBubble.empty() && onChatBubbleReady) {
onChatBubbleReady(node.text, node.chatBubble == "in");
}
}
+2 -2
View File
@@ -23,7 +23,7 @@ public:
void setOnDialogueLineStarted(std::function<void(const std::string&)> cb);
void setOnCutsceneLineStarted(std::function<void(const std::string&)> cb);
void setOnCutsceneFadeInComplete(std::function<void(const std::string&)> cb);
void setOnBubbleSlotReady(std::function<void(const std::string&)> cb);
void setOnChatBubbleReady(std::function<void(const std::string&, bool)> cb);
void stop();
void update(int deltaMs);
@@ -60,7 +60,7 @@ private:
std::function<void(const std::string&)> onDialogueLineStarted;
std::function<void(const std::string&)> onCutsceneLineStarted;
std::function<void(const std::string&)> onCutsceneFadeInComplete;
std::function<void(const std::string&)> onBubbleSlotReady;
std::function<void(const std::string&, bool)> onChatBubbleReady;
std::string activeCutsceneId;
bool fadeInCallbackFired = false;
+2 -2
View File
@@ -140,8 +140,8 @@ void DialogueSystem::setOnCutsceneFadeInComplete(std::function<void(const std::s
runtime.setOnCutsceneFadeInComplete(std::move(cb));
}
void DialogueSystem::setOnBubbleSlotReady(std::function<void(const std::string&)> cb) {
runtime.setOnBubbleSlotReady(std::move(cb));
void DialogueSystem::setOnChatBubbleReady(std::function<void(const std::string&, bool)> cb) {
runtime.setOnChatBubbleReady(std::move(cb));
}
void DialogueSystem::stopDialogue() {
+1 -1
View File
@@ -28,7 +28,7 @@ public:
void setOnDialogueLineStarted(std::function<void(const std::string&)> cb);
void setOnCutsceneLineStarted(std::function<void(const std::string&)> cb);
void setOnCutsceneFadeInComplete(std::function<void(const std::string&)> cb);
void setOnBubbleSlotReady(std::function<void(const std::string&)> cb);
void setOnChatBubbleReady(std::function<void(const std::string&, bool)> cb);
void setOnDialogueAdvanced(std::function<void()> cb);
void stopDialogue();
+2 -2
View File
@@ -97,8 +97,8 @@ struct Node {
// For CutsceneStart
std::string cutsceneId;
// Name of the UI node (StaticImage) to reveal in the phone chat when this line is shown
std::string bubbleSlot;
// "in" or "out" — creates a dynamic chat bubble; empty = not a chat message
std::string chatBubble;
// Quest actions fired when this line is presented (empty = no action)
std::string questUnlock;