1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Some tweaks

This commit is contained in:
nordsoft 2022-11-16 04:42:43 +04:00
parent 15ba4cda70
commit 20573073c9

View File

@ -214,7 +214,9 @@ void Lobby::on_connectButton_toggled(bool checked)
node["lobbyUsername"].String() = username.toStdString();
sysMessage("Connecting to " + ui->hostEdit->text() + ":" + ui->portEdit->text());
//show text immediately
ui->chat->repaint();
qApp->processEvents();
socketLobby.connectServer(ui->hostEdit->text(), ui->portEdit->text().toInt(), username, connectionTimeout);
}
@ -233,7 +235,13 @@ void Lobby::on_joinButton_clicked()
{
auto * item = ui->sessionsTable->item(ui->sessionsTable->currentRow(), 0);
if(item)
new LobbyRoomRequest(socketLobby, item->text(), this);
{
auto isPrivate = ui->sessionsTable->item(ui->sessionsTable->currentRow(), 2)->text(); //check if private
if(isPrivate == "True")
new LobbyRoomRequest(socketLobby, item->text(), this);
else
socketLobby.requestJoinSession(item->text(), "");
}
}