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();
|
||||
|
||||
Reference in new issue
Block a user