Working on UI fixing
This commit is contained in:
1 parent
7031a21922
commit
2b32fce5e0
7 files changed
+28
-11
No files matched your search
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -72,6 +72,7 @@ void CutsceneRuntime::stop() {
|
||||
activeCutsceneId.clear();
|
||||
active = false;
|
||||
fadeInCallbackFired = false;
|
||||
skipPending = false;
|
||||
currentCutsceneLine = -1;
|
||||
cutsceneTimerMs = 0;
|
||||
cutsceneElapsedMs = 0;
|
||||
@@ -114,6 +115,15 @@ void CutsceneRuntime::update(int deltaMs) {
|
||||
if (cutsceneElapsedMs >= fadeInCompleteMs && !activeCutscene->onFadeInCallback.empty()) {
|
||||
fadeInCallbackFired = true;
|
||||
onFadeInComplete(activeCutscene->onFadeInCallback);
|
||||
|
||||
// The callback may have stopped the cutscene. Guard before touching
|
||||
// state, then honour a skip that was deferred until fade-in completed.
|
||||
if (!active || !activeCutscene) return;
|
||||
if (skipPending) {
|
||||
skipPending = false;
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,6 +155,15 @@ bool CutsceneRuntime::canSkip() const {
|
||||
|
||||
void CutsceneRuntime::skip() {
|
||||
if (!canSkip()) return;
|
||||
|
||||
// If the onFadeInCallback hasn't fired yet, defer the skip.
|
||||
// The scene change triggered by that callback must happen while the screen
|
||||
// is still black; calling finish() now would skip the callback entirely.
|
||||
if (!fadeInCallbackFired && activeCutscene && !activeCutscene->onFadeInCallback.empty()) {
|
||||
skipPending = true;
|
||||
return;
|
||||
}
|
||||
|
||||
finish();
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ private:
|
||||
std::string activeCutsceneId;
|
||||
bool active = false;
|
||||
bool fadeInCallbackFired = false;
|
||||
bool skipPending = false;
|
||||
|
||||
int currentCutsceneLine = -1;
|
||||
int cutsceneTimerMs = 0;
|
||||
|
||||
Reference in new issue
Block a user