Clean up UI, work on tutorial

This commit is contained in:
Vladislav Khorev committed 2026-06-08 22:09:24 +03:00
1 parent cfbd29d5b1
commit 619de45221
79 files changed
+5122 -316

No files matched your search

+43 -10
View File
@@ -342,6 +342,26 @@ namespace ZL
if (locations["location_dorm"]->player)
locations["location_dorm"]->player->onDeathAnimComplete = [this]() { startDarklandsTransition(); };
locations["location_dorm"]->onPlayerTaxiRequired = [this]() {
menuManager.tutorialShowTaxiHint();
};
menuManager.callTaxiFunc = [this]()
{
if (locations["location_dorm"])
{
locations["location_dorm"]->onPlayerTaxiRequired = nullptr;
}
if (currentLocation)
{
if (currentLocation->teleportZones.size() > 0)
{
currentLocation->teleportZones[0].active = true;
}
}
};
// Teleport callbacks: destination name and position come from the teleport zone data.
auto teleportCallback = [this](const std::string& destName, const Eigen::Vector3f& destPos, float destRotY) {
std::cout << "[TELEPORT] " << " -> " << destName << std::endl;
@@ -388,9 +408,20 @@ namespace ZL
};
}
// Wire inventory item-pickup callback for tutorial step4/5 item tracking.
renderer.textureManager.LoadFromPng("resources/w/ui/img/toast/item_received001.png", CONST_ZIP_FILE, true);
renderer.textureManager.LoadFromPng("resources/w/ui/img/toast/item_removed001.png", CONST_ZIP_FILE, true);
// Wire inventory callbacks: tutorial tracking + toast notifications.
inventory.onItemAdded = [this](const std::string& itemId) {
menuManager.onItemPickedUp(itemId);
const Item* item = ItemRegistry::instance().findById(itemId);
if (item) menuManager.showToast("resources/w/ui/img/toast/item_received001.png", item->name);
};
inventory.onItemRemoved = [this](const std::string& itemId) {
const Item* item = ItemRegistry::instance().findById(itemId);
if (item) menuManager.showToast("resources/w/ui/img/toast/item_removed001.png", item->name);
};
// Wire phone dialogue start function so MenuManager can trigger dialogues.
@@ -431,9 +462,6 @@ namespace ZL
if (currentLocation) currentLocation->dialogueSystem.skipCutscene();
};
currentLocation = locations["location_dorm"];
currentLocation->scriptEngine.callLocationEnterCallback();
std::cout << "Load resurces step 5" << std::endl;
/*
std::cout << "Load resurces step 12" << std::endl;
@@ -478,6 +506,11 @@ namespace ZL
std::cerr << "Failed to load UI: " << e.what() << std::endl;
}
menuManager.startGameFunc = [this]() {
currentLocation = locations["location_dorm"];
currentLocation->scriptEngine.callLocationEnterCallback();
};
// Wire HP-change callbacks so all player instances update the health bar HUD.
for (auto& [name, loc] : locations) {
if (loc->player) {
@@ -564,10 +597,6 @@ namespace ZL
CheckGlError(__FILE__, __LINE__);
}
}
else
{
// ??? Main menu???
}
drawUI();
drawDarklandsFlash();
}
@@ -632,10 +661,12 @@ namespace ZL
lastTickCount = newTickCount;
updateDarklandsFlash(delta);
menuManager.uiManager.update(static_cast<float>(delta));
menuManager.topUiManager.update(static_cast<float>(delta));
if (!menuManager.isMainMenuOpen())
menuManager.update(static_cast<float>(delta));
if (currentLocation)
{
currentLocation->update(delta);
@@ -797,7 +828,7 @@ namespace ZL
}
break;
case SDLK_f:
currentLocation->dialogueSystem.startDialogue("dialog_start001");
currentLocation->dialogueSystem.startDialogue("phone_night_aiperi001");
break;
case SDLK_e:
@@ -836,6 +867,8 @@ namespace ZL
break;
case SDLK_k:
x = x - 1;
std::cout << "current x: " << x << std::endl;
//y = y + 1;
//std::cout << "current y: " << y << std::endl;
//y = y - 0.002;