Fixing ui bugs, added cutscenes

This commit is contained in:
Vladislav Khorev committed 2026-06-27 22:05:19 +03:00
1 parent 9aeb0b1194
commit 5516d02e2c
18 files changed
+2100 -222

No files matched your search

+16 -1
View File
@@ -480,6 +480,7 @@ namespace ZL {
}
void MenuManager::selectInventoryItem(int index) {
std::cout << "MenuManager::selectInventoryItem: " << index << std::endl;
const auto& items = inventory->getItems();
if (index < 0 || index >= static_cast<int>(items.size())) return;
@@ -1336,7 +1337,8 @@ namespace ZL {
uiManager.setText("quest_title", def.title);
static const char* kCheckboxes[3] = { "objective1checkbox", "objective2checkbox", "objective3checkbox" };
static const char* kObjNames[3] = { "objective1name", "objective2name", "objective3name" };
static const char* kObjNames[3] = { "objective1name", "objective2name", "objective3name" };
static const char* kObjNameLayouts[3] = { "objective1nameLayout", "objective2nameLayout", "objective3nameLayout" };
std::vector<const Quest::QuestObjective*> visibleObjs;
for (const auto& obj : def.objectives)
@@ -1347,6 +1349,7 @@ namespace ZL {
const auto& obj = *visibleObjs[i];
const bool isActive = (&obj - def.objectives.data() == quest->activeObjectiveIndex);
auto img = uiManager.findStaticImage(kCheckboxes[i]);
auto textView = uiManager.findTextView(kObjNames[i]);
if (img) img->texture = obj.completed ? texObjectiveCompleted_ : texObjectiveBlank_;
std::array<float, 4> color;
if (obj.completed) {
@@ -1356,6 +1359,18 @@ namespace ZL {
} else {
color = { 0.996f, 0.977f, 0.761f, 0.9f };
}
const int numLines = countWrappedLines(obj.text, *textView->textRenderer, 540);
if (numLines == 1)
{
uiManager.findNode(kObjNameLayouts[i])->height = 80.0f;
}
else
{
uiManager.findNode(kObjNameLayouts[i])->height = 60.0f;
}
uiManager.setText(kObjNames[i], obj.text);
uiManager.setTextColor(kObjNames[i], color);
uiManager.setNodeVisible(kCheckboxes[i], true);