diff options
| author | Cerapter <cerap@protonmail.com> | 2018-10-23 10:39:54 +0200 |
|---|---|---|
| committer | Cerapter <cerap@protonmail.com> | 2018-10-23 10:39:54 +0200 |
| commit | fc72ff42345fdda694cd6cf62a77c6cc99a59bc5 (patch) | |
| tree | fc8d5e773313c7caa414fca76c8385679d88800e | |
| parent | bed38e0b7f42629c373e6a78b482541f1b3a4294 (diff) | |
The connect button is disabled until you get an FL package from a server.
| -rw-r--r-- | lobby.cpp | 9 | ||||
| -rw-r--r-- | lobby.h | 1 | ||||
| -rw-r--r-- | packet_distribution.cpp | 2 |
3 files changed, 12 insertions, 0 deletions
@@ -48,6 +48,8 @@ Lobby::Lobby(AOApplication *p_ao_app) : QMainWindow() connect(ui_chatmessage, SIGNAL(returnPressed()), this, SLOT(on_chatfield_return_pressed())); connect(ui_cancel, SIGNAL(clicked()), ao_app, SLOT(loading_cancelled())); + ui_connect->setEnabled(false); + set_widgets(); } @@ -311,6 +313,8 @@ void Lobby::on_server_list_clicked(QModelIndex p_model) ui_player_count->setText("Offline"); + ui_connect->setEnabled(false); + ao_app->net_manager->connect_to_server(f_server); } @@ -371,6 +375,11 @@ void Lobby::set_player_count(int players_online, int max_players) ui_player_count->setText(f_string); } +void Lobby::enable_connect_button() +{ + ui_connect->setEnabled(true); +} + Lobby::~Lobby() { @@ -37,6 +37,7 @@ public: void hide_loading_overlay(){ui_loading_background->hide();} QString get_chatlog(); int get_selected_server(); + void enable_connect_button(); void set_loading_value(int p_value); diff --git a/packet_distribution.cpp b/packet_distribution.cpp index a0d3ccac..6a11958e 100644 --- a/packet_distribution.cpp +++ b/packet_distribution.cpp @@ -206,6 +206,8 @@ void AOApplication::server_packet_received(AOPacket *p_packet) arup_enabled = true; if (f_packet.contains("modcall_reason",Qt::CaseInsensitive)) modcall_reason_enabled = true; + + w_lobby->enable_connect_button(); } else if (header == "PN") { |
