Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Updated Ranked Box
fixed some small things + found bugs in testing. things that need to be fixed/added:
- if someone leaved a lobby they hosted with ranked enabled and joins a lobby without it enabled, dolphin crashes
- only the host can click the box, but i'm not sure if the other players get the "information" that the ranked button is toggled
  • Loading branch information
LittleCoaks committed Aug 20, 2021
1 parent f36396d commit 89e11ad
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Source/Core/DolphinQt/NetPlay/NetPlayDialog.cpp
Expand Up @@ -108,8 +108,6 @@ void NetPlayDialog::CreateMainLayout()
m_menu_bar = new QMenuBar(this);
m_ranked_box = new QCheckBox(tr("Ranked"));

m_ranked_box->setChecked(false);
m_current_ranked_value = 0;
m_data_menu = m_menu_bar->addMenu(tr("Data"));
m_data_menu->setToolTipsVisible(true);
m_write_save_data_action = m_data_menu->addAction(tr("Write Save Data"));
Expand Down Expand Up @@ -519,6 +517,7 @@ void NetPlayDialog::show(std::string nickname, bool use_traversal)
m_hostcode_action_button->setHidden(!is_hosting);
m_game_button->setEnabled(is_hosting);
m_kick_button->setEnabled(false);
m_ranked_box->setDisabled(!is_hosting);

SetOptionsEnabled(true);

Expand Down Expand Up @@ -767,6 +766,7 @@ void NetPlayDialog::OnMsgChangeGame(const NetPlay::SyncIdentifier& sync_identifi
UpdateDiscordPresence();
});
DisplayMessage(tr("Game changed to \"%1\"").arg(qname), "magenta");
m_ranked_box->setChecked(false);
}

void NetPlayDialog::OnMsgChangeGBARom(int pad, const NetPlay::GBAConfig& config)
Expand Down Expand Up @@ -843,7 +843,9 @@ void NetPlayDialog::OnMsgStopGame()
g_netplay_chat_ui.reset();
g_netplay_golf_ui.reset();
QueueOnObject(this, [this] { UpdateDiscordPresence(); });
m_ranked_box->setEnabled(true);

const bool is_hosting = IsHosting();
m_ranked_box->setEnabled(is_hosting);
}

void NetPlayDialog::OnMsgPowerButton()
Expand Down

0 comments on commit 89e11ad

Please sign in to comment.