This commit is contained in:
Vladislav Khorev committed 2026-02-08 15:53:55 +03:00
commit cf1ec1e76f
6 files changed
+110 -3

No files matched your search

+19
View File
@@ -275,6 +275,15 @@ namespace ZL
loadGameplayUI = [this]() {
uiManager.loadFromFile("resources/config/ui.json", renderer, CONST_ZIP_FILE);
auto velocityTv = uiManager.findTextView("velocityText");
if (velocityTv) {
velocityTv->rect.x = 10.0f;
velocityTv->rect.y = static_cast<float>(Environment::height) - velocityTv->rect.h - 10.0f;
}
else {
std::cerr << "Failed to find velocityText in UI" << std::endl;
}
uiManager.startAnimationOnNode("backgroundNode", "bgScroll");
static bool isExitButtonAnimating = false;
uiManager.setAnimationCallback("settingsButton", "buttonsExit", [this]() {
@@ -812,6 +821,7 @@ namespace ZL
for (auto const& [id, remotePlayer] : remotePlayerStates)
{
//<<<<<<< HEAD
const ClientState& st = remotePlayer;
// Позиция корабля в мире
Vector3f shipWorld = st.position;
@@ -1233,6 +1243,15 @@ namespace ZL
}
}*/
// update velocity text
if (shipAlive && !gameOver) {
auto velocityTv = uiManager.findTextView("velocityText");
if (velocityTv) {
std::string velocityStr = "Velocity: " + std::to_string(static_cast<int>(Environment::shipState.velocity));
uiManager.setText("velocityText", velocityStr);
}
}
uiManager.update(static_cast<float>(delta));
lastTickCount = newTickCount;
}