Working on cutscene skip
This commit is contained in:
1 parent
c991b5dbc1
commit
7011bbb754
16 files changed
+112
-17
No files matched your search
@@ -4,6 +4,10 @@ namespace ZL::Dialogue {
|
||||
|
||||
bool DialogueSystem::init(Renderer& renderer, const std::string& zipFile) {
|
||||
runtime.setDatabase(&database);
|
||||
runtime.setOnCutsceneFinished([this](const std::string& id) {
|
||||
if (onCutsceneFinishedCallback) onCutsceneFinishedCallback(id);
|
||||
if (onCutsceneFinishedExtraCallback) onCutsceneFinishedExtraCallback(id);
|
||||
});
|
||||
return overlay.init(renderer, zipFile);
|
||||
}
|
||||
|
||||
@@ -121,11 +125,25 @@ bool DialogueSystem::startDialogue(const std::string& dialogueId) {
|
||||
}
|
||||
|
||||
bool DialogueSystem::startCutscene(const std::string& cutsceneId) {
|
||||
return runtime.startStandaloneCutscene(cutsceneId);
|
||||
bool result = runtime.startStandaloneCutscene(cutsceneId);
|
||||
if (result && onCutsceneStartedCallback) onCutsceneStartedCallback();
|
||||
return result;
|
||||
}
|
||||
|
||||
void DialogueSystem::skipCutscene() {
|
||||
runtime.skipCurrentCutscene();
|
||||
}
|
||||
|
||||
void DialogueSystem::setOnCutsceneStarted(std::function<void()> cb) {
|
||||
onCutsceneStartedCallback = std::move(cb);
|
||||
}
|
||||
|
||||
void DialogueSystem::setOnCutsceneFinished(std::function<void(const std::string&)> cb) {
|
||||
runtime.setOnCutsceneFinished(std::move(cb));
|
||||
onCutsceneFinishedCallback = std::move(cb);
|
||||
}
|
||||
|
||||
void DialogueSystem::setOnCutsceneFinishedExtra(std::function<void(const std::string&)> cb) {
|
||||
onCutsceneFinishedExtraCallback = std::move(cb);
|
||||
}
|
||||
|
||||
void DialogueSystem::setOnDialogueLineStarted(std::function<void(const std::string&)> cb) {
|
||||
|
||||
@@ -24,7 +24,10 @@ public:
|
||||
|
||||
bool startDialogue(const std::string& dialogueId);
|
||||
bool startCutscene(const std::string& cutsceneId);
|
||||
void skipCutscene();
|
||||
void setOnCutsceneStarted(std::function<void()> cb);
|
||||
void setOnCutsceneFinished(std::function<void(const std::string&)> cb);
|
||||
void setOnCutsceneFinishedExtra(std::function<void(const std::string&)> cb);
|
||||
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);
|
||||
@@ -47,6 +50,9 @@ private:
|
||||
DialogueRuntime runtime;
|
||||
DialogueOverlay overlay;
|
||||
std::function<void()> onDialogueAdvancedCallback;
|
||||
std::function<void()> onCutsceneStartedCallback;
|
||||
std::function<void(const std::string&)> onCutsceneFinishedCallback;
|
||||
std::function<void(const std::string&)> onCutsceneFinishedExtraCallback;
|
||||
};
|
||||
|
||||
} // namespace ZL::Dialogue
|
||||
Reference in new issue
Block a user