Fixing dialogues

This commit is contained in:
Vladislav Khorev committed 2026-07-05 14:48:46 +03:00
1 parent 8a6366098c
commit 2d8f80b675
11 files changed
+3633 -6454

No files matched your search

+1 -3
View File
@@ -498,7 +498,7 @@ namespace ZL
params_dorm.gameObjectsJsonPath = "resources/config2/gameobjects_dorm_new_x.json";
params_dorm.npcsJsonPath = "resources/config2/npcs_dorm.json";
params_dorm.dialoguesJsonPath = "resources/dialogue/dorm_dialogues.json";
params_dorm.dialoguesJsonPath = "resources/dialogue/dorm_dialogues003.json";
/*
params_dorm.navigationJsonPaths = {
@@ -519,7 +519,6 @@ namespace ZL
"resources/navigation/dorm3_all_open.txt", //5
};
/*
params_dorm.navigationJsonPaths = {
"resources/navigation/dorm0_large.json",
@@ -536,7 +535,6 @@ namespace ZL
params_dorm.interactiveObjectsJsonPath = "resources/config2/interactive_objects_dorm_x.json";
params_dorm.playerPosition = Eigen::Vector3f(6.76345, 0, -14.6022);
gameState.locations["location_dorm"] = std::make_shared<Location>(renderer, gameState.inventory);
gameState.locations["location_dorm"]->setup(params_dorm, &gameState.questJournal);
gameState.locations["location_dorm"]->scriptEngine.setGlobalStore(&gameState.globalInts);
+6 -4
View File
@@ -20,6 +20,7 @@ bool DialogueOverlay::init(Renderer& renderer, const std::string& zipFile) {
textboxTexture = renderer.textureManager.LoadFromPng("resources/dialogue/textbox_bg.png", zipFile);
textboxChoiceTexture = renderer.textureManager.LoadFromPng("resources/dialogue/DialogChoice001.png", zipFile);
textboxChoicePortraitTexture = renderer.textureManager.LoadFromPng("resources/dialogue/DialogChoicePortrait001.png", zipFile);
choiceMainTexture = renderer.textureManager.LoadFromPng("resources/dialogue/ChoiceNormal001.png", zipFile);
choiceOptionalTexture = renderer.textureManager.LoadFromPng("resources/dialogue/ChoiceNormal001.png", zipFile);
@@ -156,10 +157,11 @@ void DialogueOverlay::drawLandscape(Renderer& renderer, const PresentationModel&
if (model.mode == PresentationMode::Choice) {
const float choiceStartY = 270.f-35;
const float choiceHeight = 121.f*0.9;
const float choiceSpacing = -30.f;
const float choiceWidth = 913.f * 0.9;
float choiceStartY = 400.f - (choiceHeight + choiceSpacing) * (model.choices.size());
if (choiceQuads.size() < model.choices.size()) {
choiceQuads.resize(model.choices.size());
@@ -213,8 +215,8 @@ void DialogueOverlay::drawPortrait(Renderer& renderer, const PresentationModel&
const float H = Environment::projectionHeight;
// Panel: DialogChoice001.png scaled to full screen width, aspect ratio preserved.
const float texAspect = static_cast<float>(textboxChoiceTexture->getWidth())
/ static_cast<float>(textboxChoiceTexture->getHeight());
const float texAspect = static_cast<float>(textboxChoicePortraitTexture->getWidth())
/ static_cast<float>(textboxChoicePortraitTexture->getHeight());
const float panelW = W;
const float panelH = panelW / texAspect;
const float clipAtBottom = 18.f;
@@ -259,7 +261,7 @@ void DialogueOverlay::drawPortrait(Renderer& renderer, const PresentationModel&
renderer.LoadIdentity();
renderer.RenderUniform1f("uAlpha", 1.0f);
glBindTexture(GL_TEXTURE_2D, textboxChoiceTexture->getTexID());
glBindTexture(GL_TEXTURE_2D, textboxChoicePortraitTexture->getTexID());
renderer.DrawVertexRenderStruct(portraitPanelQuad.mesh);
if (model.portraitPath != "resources/dialogue/portrait_phone.png")
+1
View File
@@ -28,6 +28,7 @@ private:
std::shared_ptr<Texture> textboxTexture;
std::shared_ptr<Texture> textboxChoiceTexture;
std::shared_ptr<Texture> textboxChoicePortraitTexture;
std::shared_ptr<Texture> choiceMainTexture;
std::shared_ptr<Texture> choiceOptionalTexture;