perf(ui): optimize online UI display

This commit is contained in:
2025-12-28 21:04:58 +08:00
parent 152d210f00
commit 0885e925ad
2 changed files with 33 additions and 4 deletions

View File

@@ -43,6 +43,24 @@ void OnlineGameUIManager::init() {
}
);
m_buttons.emplace(onlineJoinButton->getNameHash(), std::move(onlineJoinButton));
auto onlineHostConnectLabel = UIWidgetFactory::createStandardLabel(
"OnlineHostConnectLabel",
"Waiting for player to connect...",
200,
200
);
onlineHostConnectLabel->setVisible(false);
m_labels.emplace(onlineHostConnectLabel->getNameHash(), std::move(onlineHostConnectLabel));
auto onlineJoinConnectLabel = UIWidgetFactory::createStandardLabel(
"OnlineJoinConnectLabel",
"Connecting to host...",
200,
200
);
onlineJoinConnectLabel->setVisible(false);
m_labels.emplace(onlineJoinConnectLabel->getNameHash(), std::move(onlineJoinConnectLabel));
}
void OnlineGameUIManager::setOnlineTypeCallback(OnlineTypeEvent onlineTypeEvent) {