added dialog start radius and background by time in cutscenes

This commit is contained in:
Vlad committed 2026-04-14 18:07:46 +06:00
1 parent db8b9b7a18
commit f7e6f063d1
10 files changed
+35 -10

No files matched your search

+1
View File
@@ -121,6 +121,7 @@ CutsceneLine DialogueDatabase::parseCutsceneLine(const json& j) {
line.text = j.value("text", "");
line.portrait = j.value("portrait", "");
line.sfx = j.value("sfx", "");
line.background = j.value("background", "");
line.durationMs = j.value("durationMs", 0);
line.waitForConfirm = j.value("waitForConfirm", false);
return line;
+8 -1
View File
@@ -325,6 +325,7 @@ void DialogueRuntime::startCutscene(const std::string& cutsceneId, const std::st
activeCutscene = cutscene;
pendingNodeAfterCutscene = nextNodeAfterCutscene;
currentCutsceneBackground = cutscene->background;
mode = Mode::PlayingCutscene;
currentCutsceneLine = -1;
cutsceneTimerMs = 0;
@@ -363,12 +364,18 @@ void DialogueRuntime::refreshCutscenePresentation() {
}
const CutsceneLine& line = activeCutscene->lines[currentCutsceneLine];
if (!line.background.empty()) {
currentCutsceneBackground = line.background;
}
presentation.mode = PresentationMode::Cutscene;
presentation.speaker = line.speaker;
presentation.fullText = line.text;
presentation.visibleText = line.text;
presentation.portraitPath = line.portrait;
presentation.backgroundPath = activeCutscene->background;
//presentation.backgroundPath = activeCutscene->background;
presentation.backgroundPath = currentCutsceneBackground;
presentation.choices.clear();
presentation.selectedChoice = 0;
presentation.revealCompleted = true;
+2
View File
@@ -64,6 +64,8 @@ private:
int currentCutsceneLine = -1;
int cutsceneTimerMs = 0;
std::string currentCutsceneBackground;
bool evaluateConditions(const std::vector<Condition>& conditions) const;
void applyEffects(const std::vector<Effect>& effects);
+1
View File
@@ -87,6 +87,7 @@ struct CutsceneLine {
std::string text;
std::string portrait;
std::string sfx;
std::string background;
int durationMs = 0;
bool waitForConfirm = false;
};