The connect button is disabled until you get an FL package from a server.

This commit is contained in:
Cerapter 2018-10-23 10:39:54 +02:00
parent bed38e0b7f
commit fc72ff4234
3 changed files with 12 additions and 0 deletions

View File

@ -48,6 +48,8 @@ Lobby::Lobby(AOApplication *p_ao_app) : QMainWindow()
connect(ui_chatmessage, SIGNAL(returnPressed()), this, SLOT(on_chatfield_return_pressed())); connect(ui_chatmessage, SIGNAL(returnPressed()), this, SLOT(on_chatfield_return_pressed()));
connect(ui_cancel, SIGNAL(clicked()), ao_app, SLOT(loading_cancelled())); connect(ui_cancel, SIGNAL(clicked()), ao_app, SLOT(loading_cancelled()));
ui_connect->setEnabled(false);
set_widgets(); set_widgets();
} }
@ -311,6 +313,8 @@ void Lobby::on_server_list_clicked(QModelIndex p_model)
ui_player_count->setText("Offline"); ui_player_count->setText("Offline");
ui_connect->setEnabled(false);
ao_app->net_manager->connect_to_server(f_server); 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); ui_player_count->setText(f_string);
} }
void Lobby::enable_connect_button()
{
ui_connect->setEnabled(true);
}
Lobby::~Lobby() Lobby::~Lobby()
{ {

View File

@ -37,6 +37,7 @@ public:
void hide_loading_overlay(){ui_loading_background->hide();} void hide_loading_overlay(){ui_loading_background->hide();}
QString get_chatlog(); QString get_chatlog();
int get_selected_server(); int get_selected_server();
void enable_connect_button();
void set_loading_value(int p_value); void set_loading_value(int p_value);

View File

@ -206,6 +206,8 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
arup_enabled = true; arup_enabled = true;
if (f_packet.contains("modcall_reason",Qt::CaseInsensitive)) if (f_packet.contains("modcall_reason",Qt::CaseInsensitive))
modcall_reason_enabled = true; modcall_reason_enabled = true;
w_lobby->enable_connect_button();
} }
else if (header == "PN") else if (header == "PN")
{ {