Minor fixing

This commit is contained in:
Vladislav Khorev committed 2026-03-06 22:34:03 +03:00
1 parent 4af20c65e6
commit 41f370f2ee
4 files changed
+86 -9

No files matched your search

+17
View File
@@ -195,6 +195,7 @@ namespace ZL
space.boxAlive.clear();
space.serverBoxesApplied = false;
connectingStartTicks = SDL_GetTicks();
lastTickCount = 0;
};
@@ -470,6 +471,22 @@ namespace ZL
}
//#endif
networkClient->Poll();
if (menuManager.getState() == GameState::Connecting) {
if (networkClient->IsConnected()) {
menuManager.notifyConnected();
// Enable/disable shoot buttons based on ship type
if (Environment::shipState.shipType == 1) {
if (auto b = menuManager.uiManager.findButton("shootButton")) b->state = ButtonState::Disabled;
if (auto b = menuManager.uiManager.findButton("shootButton2")) b->state = ButtonState::Disabled;
} else {
if (auto b = menuManager.uiManager.findButton("shootButton")) b->state = ButtonState::Normal;
if (auto b = menuManager.uiManager.findButton("shootButton2")) b->state = ButtonState::Normal;
}
} else if (SDL_GetTicks() - connectingStartTicks > CONNECTING_TIMEOUT_MS) {
menuManager.notifyConnectionFailed();
}
}
#ifdef NETWORK
auto* wsBase = dynamic_cast<ZL::WebSocketClientBase*>(networkClient.get());
if (wsBase) {