Working on UI fixing
This commit is contained in:
parent
7031a21922
commit
2b32fce5e0
BIN
resources/w/ui/img/toast/item_received001.png
(Stored with Git LFS)
BIN
resources/w/ui/img/toast/item_received001.png
(Stored with Git LFS)
Binary file not shown.
BIN
resources/w/ui/img/toast/item_removed001.png
(Stored with Git LFS)
BIN
resources/w/ui/img/toast/item_removed001.png
(Stored with Git LFS)
Binary file not shown.
BIN
resources/w/ui/img/toast/objective_completed001.png
(Stored with Git LFS)
BIN
resources/w/ui/img/toast/objective_completed001.png
(Stored with Git LFS)
Binary file not shown.
BIN
resources/w/ui/img/toast/quest_failed001.png
(Stored with Git LFS)
BIN
resources/w/ui/img/toast/quest_failed001.png
(Stored with Git LFS)
Binary file not shown.
BIN
resources/w/ui/img/toast/quest_new001.png
(Stored with Git LFS)
BIN
resources/w/ui/img/toast/quest_new001.png
(Stored with Git LFS)
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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user