Fixing minor bugs in scripts

This commit is contained in:
Vladislav Khorev committed 2026-06-09 23:57:27 +03:00
1 parent 80133aa8c8
commit 87fb6d4655
14 files changed
+490 -234

No files matched your search

+7 -6
View File
@@ -48,6 +48,7 @@ void DialogueOverlay::update(const PresentationModel& model, int deltaMs) {
}
}
void DialogueOverlay::draw(Renderer& renderer, const PresentationModel& model) {
if (model.mode != PresentationMode::Dialogue && model.mode != PresentationMode::Choice) {
lastChoiceRects.clear();
@@ -59,7 +60,7 @@ void DialogueOverlay::draw(Renderer& renderer, const PresentationModel& model) {
UiRect portraitRect{ 24.0f + 90, 24.0f + 16, 176.0f, 176.0f };
UiRect textboxRect{ 30.f, -48.f, 1222.f, 340.0f };
UiRect textboxChoiceRect{ 30.f, -48.f, 1200.f, 619.5f };
UiRect textboxChoiceRect{ 30.f, -90.f, 1200.f, 619.5f };
lastDialogueAdvanceRect = { portraitRect.x, portraitRect.y, textboxRect.x + textboxRect.w - portraitRect.x, textboxRect.h };
@@ -87,7 +88,7 @@ void DialogueOverlay::draw(Renderer& renderer, const PresentationModel& model) {
if (model.mode == PresentationMode::Choice)
{
glBindTexture(GL_TEXTURE_2D, textboxTexture->getTexID());
glBindTexture(GL_TEXTURE_2D, textboxChoiceTexture->getTexID());
renderer.DrawVertexRenderStruct(textboxChoiceQuad.mesh);
}
else
@@ -101,7 +102,7 @@ void DialogueOverlay::draw(Renderer& renderer, const PresentationModel& model) {
if (model.mode == PresentationMode::Choice)
{
renderer.TranslateMatrix(Vector3f{ 0, 230, 0 });
renderer.TranslateMatrix(Vector3f{ 20, 230, 0 });
}
auto portrait = loadTextureCached(model.portraitPath);
@@ -128,12 +129,12 @@ void DialogueOverlay::draw(Renderer& renderer, const PresentationModel& model) {
if (model.mode == PresentationMode::Choice)
{
nameRenderer->drawText(model.speaker, nameX+x, nameY+230, 1.0f, false, { 1.0f, 0.88f, 0.45f, 1.0f });
nameRenderer->drawText(model.speaker, nameX+20, nameY+230, 1.0f, false, { 1.0f, 0.88f, 0.45f, 1.0f });
}
else
{
nameRenderer->drawText(model.speaker, nameX+x, nameY, 1.0f, false, { 1.0f, 0.88f, 0.45f, 1.0f });
nameRenderer->drawText(model.speaker, nameX, nameY, 1.0f, false, { 1.0f, 0.88f, 0.45f, 1.0f });
}
}
@@ -164,7 +165,7 @@ void DialogueOverlay::draw(Renderer& renderer, const PresentationModel& model) {
for (size_t i = 0; i < model.choices.size(); ++i) {
const float cy = choiceStartY + (choiceHeight + choiceSpacing) * static_cast<float>(model.choices.size() - 1 - i);
UiRect rect{ 300.f, cy, choiceWidth, choiceHeight };
UiRect rect{ 320.f, cy, choiceWidth, choiceHeight };
lastChoiceRects.push_back(rect);
choiceQuads[i].rebuild(rect);