feat: add online functionality

This commit is contained in:
2025-12-28 16:24:00 +08:00
parent ef8011c090
commit 0b937336c2
14 changed files with 407 additions and 80 deletions

View File

@@ -49,3 +49,15 @@ void OnlineGameUIManager::setOnlineTypeCallback(OnlineTypeEvent onlineTypeEvent)
m_onlineTypeEvent = onlineTypeEvent;
}
void OnlineGameUIManager::hideOnlineButtons() {
auto hostIt = m_buttons.find(makeHash("OnlineHostButton"));
if (hostIt != m_buttons.end()) {
hostIt->second->setVisible(false);
hostIt->second->setEnabled(false);
}
auto joinIt = m_buttons.find(makeHash("OnlineJoinButton"));
if (joinIt != m_buttons.end()) {
joinIt->second->setVisible(false);
joinIt->second->setEnabled(false);
}
}

View File

@@ -8,6 +8,9 @@ public:
~OnlineGameUIManager();
void init() override;
void setOnlineTypeCallback(OnlineTypeEvent type);
void hideOnlineButtons();
private:
OnlineTypeEvent m_onlineTypeEvent;
};