Added some dialogs for transitions
This commit is contained in:
1 parent
59e0b2d77a
commit
1d3bea452c
11 files changed
+224
-24
No files matched your search
+39
-16
@@ -312,7 +312,7 @@ namespace ZL
|
||||
params_dorm.npcsJsonPath = "resources/config2/npcs_dorm.json";
|
||||
params_dorm.dialoguesJsonPath = "resources/dialogue/dorm_dialogues.json";
|
||||
|
||||
/*
|
||||
|
||||
params_dorm.navigationJsonPaths = {
|
||||
"resources/navigation/dorm3_bca.json",
|
||||
"resources/navigation/dorm3_ca.json",
|
||||
@@ -320,7 +320,7 @@ namespace ZL
|
||||
"resources/navigation/dorm3_a.json",
|
||||
"resources/navigation/dorm3_b.json",
|
||||
"resources/navigation/dorm3_all_open.json",
|
||||
};*/
|
||||
};
|
||||
/*
|
||||
params_dorm.navigationJsonPaths = {
|
||||
"resources/navigation/dorm2_bca2.json",
|
||||
@@ -341,16 +341,14 @@ namespace ZL
|
||||
"resources/navigation/dorm2_b.txt",
|
||||
"resources/navigation/dorm2_all_open.txt",
|
||||
};*/
|
||||
|
||||
params_dorm.navigationJsonPaths = {
|
||||
/* params_dorm.navigationJsonPaths = {
|
||||
"resources/navigation/dorm0_large.json",
|
||||
"resources/navigation/dorm0_large.json",
|
||||
"resources/navigation/dorm0_large.json",
|
||||
"resources/navigation/dorm0_large.json",
|
||||
"resources/navigation/dorm0_large.json",
|
||||
"resources/navigation/dorm0_large.json",
|
||||
};
|
||||
|
||||
};*/
|
||||
|
||||
params_dorm.teleportsJsonPath = "resources/config2/teleports_dorm.json";
|
||||
params_dorm.triggerZonesJsonPath = "resources/config2/trigger_zones_dorm.json";
|
||||
@@ -422,6 +420,10 @@ namespace ZL
|
||||
startDarklandsTransition();
|
||||
};
|
||||
|
||||
menuManager.startNightTransitionFunc = [this]() {
|
||||
startNightTransition();
|
||||
};
|
||||
|
||||
// Wire bubble-slot callback so chat bubbles appear as dialogue lines are shown.
|
||||
for (auto& [name, loc] : locations) {
|
||||
loc->dialogueSystem.setOnBubbleSlotReady([this](const std::string& bubbleSlot) {
|
||||
@@ -760,11 +762,12 @@ namespace ZL
|
||||
if (editorMode == EditorMode::InteractiveObjects && currentLocation) {
|
||||
currentLocation->editor.selectInteractiveObject(9);
|
||||
} else {
|
||||
if (menuManager.isDawn) {
|
||||
startNightTransition();
|
||||
/*if (menuManager.isDawn) {
|
||||
menuManager.isDawn = false; // step back: dawn → plain night
|
||||
} else {
|
||||
menuManager.isNight = !menuManager.isNight;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
break;
|
||||
case SDLK_0:
|
||||
@@ -1163,6 +1166,17 @@ namespace ZL
|
||||
darklandsFlashActive = true;
|
||||
darklandsFlashFadingIn = true;
|
||||
darklandsFlashAlpha = 0.0f;
|
||||
isNightTransition = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Game::startNightTransition()
|
||||
{
|
||||
if (darklandsFlashActive) return false;
|
||||
darklandsFlashActive = true;
|
||||
darklandsFlashFadingIn = true;
|
||||
darklandsFlashAlpha = 0.0f;
|
||||
isNightTransition = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1175,16 +1189,21 @@ namespace ZL
|
||||
if (darklandsFlashFadingIn) {
|
||||
darklandsFlashAlpha = min(darklandsFlashAlpha + step, 1.0f);
|
||||
if (darklandsFlashAlpha >= 1.0f) {
|
||||
isDarklands = !isDarklands;
|
||||
if (isNightTransition) {
|
||||
menuManager.isNight = !menuManager.isNight;
|
||||
if (currentLocation) currentLocation->dialogueSystem.startDialogue("dialog_video001");
|
||||
} else {
|
||||
isDarklands = !isDarklands;
|
||||
|
||||
// Change HUD
|
||||
menuManager.setDarklandsMode(isDarklands);
|
||||
// Change HUD
|
||||
menuManager.setDarklandsMode(isDarklands);
|
||||
|
||||
if (currentLocation) {
|
||||
if (isDarklands)
|
||||
currentLocation->scriptEngine.callDarklandsEnterCallback();
|
||||
else
|
||||
currentLocation->scriptEngine.callDarklandsExitCallback();
|
||||
if (currentLocation) {
|
||||
if (isDarklands)
|
||||
currentLocation->scriptEngine.callDarklandsEnterCallback();
|
||||
else
|
||||
currentLocation->scriptEngine.callDarklandsExitCallback();
|
||||
}
|
||||
}
|
||||
darklandsFlashFadingIn = false;
|
||||
}
|
||||
@@ -1193,6 +1212,7 @@ namespace ZL
|
||||
if (darklandsFlashAlpha <= 0.0f) {
|
||||
darklandsFlashAlpha = 0.0f;
|
||||
darklandsFlashActive = false;
|
||||
isNightTransition = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1229,6 +1249,9 @@ namespace ZL
|
||||
renderer.LoadIdentity();
|
||||
|
||||
renderer.RenderUniform1f("uAlpha", darklandsFlashAlpha);
|
||||
static const float kWhite[3] = { 1.f, 1.f, 1.f };
|
||||
static const float kBlack[3] = { 0.f, 0.f, 0.f };
|
||||
renderer.RenderUniform3fv("uFlashColor", isNightTransition ? kBlack : kWhite);
|
||||
renderer.DrawVertexRenderStruct(darklandsFlashQuad);
|
||||
|
||||
renderer.PopMatrix();
|
||||
|
||||
+3
-1
@@ -51,6 +51,7 @@ namespace ZL {
|
||||
bool isDarklands = false;
|
||||
// Returns false if a transition is already in progress.
|
||||
bool startDarklandsTransition();
|
||||
bool startNightTransition();
|
||||
|
||||
Inventory inventory;
|
||||
InteractiveObject* pickedUpObject = nullptr;
|
||||
@@ -118,10 +119,11 @@ namespace ZL {
|
||||
static void onResourcesZipError(const char* filename);
|
||||
#endif
|
||||
|
||||
// White-flash transition state
|
||||
// Screen-flash transition state (shared by darklands and night transitions)
|
||||
float darklandsFlashAlpha = 0.0f;
|
||||
bool darklandsFlashActive = false;
|
||||
bool darklandsFlashFadingIn = true;
|
||||
bool isNightTransition = false; // true → black flash toggling isNight; false → white flash toggling isDarklands
|
||||
VertexRenderStruct darklandsFlashQuad;
|
||||
float darklandsFlashQuadW = -1.0f;
|
||||
float darklandsFlashQuadH = -1.0f;
|
||||
|
||||
+8
-1
@@ -384,8 +384,15 @@ namespace ZL {
|
||||
uiManager.popMenu();
|
||||
});
|
||||
uiManager.setButtonCallback("videoSkip", [this](const std::string&) {
|
||||
// TODO: trigger time-skip game feature
|
||||
closePhoneEntirely();
|
||||
if (isNight)
|
||||
{
|
||||
startDialogueFunc("dialog_video002");
|
||||
}
|
||||
else
|
||||
{
|
||||
startNightTransitionFunc();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -69,6 +69,7 @@ namespace ZL {
|
||||
|
||||
std::function<void(const std::string&)> startDialogueFunc;
|
||||
std::function<void()> startDarklandsTransitionFunc;
|
||||
std::function<void()> startNightTransitionFunc;
|
||||
|
||||
void setDarklandsMode(bool enabled);
|
||||
void advanceTutorialStep();
|
||||
|
||||
@@ -222,6 +222,12 @@ namespace ZL {
|
||||
std::cout << "Set dawn called" << std::endl;
|
||||
});
|
||||
|
||||
|
||||
api.set_function("is_night",
|
||||
[game]() {
|
||||
return game->isNight;
|
||||
});
|
||||
|
||||
// advance_darklands_hud()
|
||||
// Advances the uni_interior darklands HUD from step12 to step13.
|
||||
// Call when the player enters the ghost trigger zone in darklands.
|
||||
|
||||
Reference in new issue
Block a user