network: Move global state into a seperate class

Co-Authored-By: Narr the Reg <5944268+german77@users.noreply.github.com>
This commit is contained in:
FearlessTobi 2022-07-22 16:31:13 +02:00
parent 899c8bb330
commit 7d82e57b91
21 changed files with 152 additions and 98 deletions

View file

@ -273,7 +273,7 @@ GMainWindow::GMainWindow(bool has_broken_vulkan)
SetDiscordEnabled(UISettings::values.enable_discord_presence.GetValue());
discord_rpc->Update();
Network::Init();
system->GetRoomNetwork().Init();
RegisterMetaTypes();
@ -463,7 +463,7 @@ GMainWindow::~GMainWindow() {
if (render_window->parent() == nullptr) {
delete render_window;
}
Network::Shutdown();
system->GetRoomNetwork().Shutdown();
}
void GMainWindow::RegisterMetaTypes() {
@ -828,7 +828,7 @@ void GMainWindow::InitializeWidgets() {
});
multiplayer_state = new MultiplayerState(this, game_list->GetModel(), ui->action_Leave_Room,
ui->action_Show_Room);
ui->action_Show_Room, system->GetRoomNetwork());
multiplayer_state->setVisible(false);
// Create status bar