This commit is contained in:
David Skoland 2017-01-28 14:47:23 +01:00
parent 1956b9d853
commit ab321a4a7a
5 changed files with 20 additions and 10 deletions

View File

@ -1,5 +1,5 @@
lobby = 0, 0, 517, 666 lobby = 0, 0, 517, 666
public_servers = 46, 88, 114, 30 publi_servers = 46, 88, 114, 30
favorites = 164, 88, 114, 30 favorites = 164, 88, 114, 30
refresh = 56, 381, 132, 28 refresh = 56, 381, 132, 28
add_to_fav = 194, 381, 132, 28 add_to_fav = 194, 381, 132, 28

View File

@ -10,6 +10,6 @@ void call_error(QString p_message)
msgBox->setWindowTitle("Error"); msgBox->setWindowTitle("Error");
msgBox->setWindowModality(Qt::NonModal); //msgBox->setWindowModality(Qt::NonModal);
msgBox->show(); msgBox->show();
} }

View File

@ -133,10 +133,7 @@ void Lobby::set_size_and_pos(QWidget *p_widget, QString p_identifier)
if (design_ini_result.width < 0 || design_ini_result.height < 0) if (design_ini_result.width < 0 || design_ini_result.height < 0)
{ {
//at this point it's pretty much game over call_error(" could not find \"" + p_identifier + "\" in lobby_design.ini");
//T0D0: add message box
qDebug() << "CRITICAL ERROR: NO SUITABLE DATA FOR SETTING " << p_identifier;
ao_app->quit();
} }
} }
@ -288,6 +285,10 @@ void Lobby::on_chatfield_return_pressed()
void Lobby::list_servers() void Lobby::list_servers()
{ {
public_servers_selected = true;
ui_favorites->set_image("favorites.png");
ui_public_servers->set_image("publicservers_selected.png");
ui_server_list->clear(); ui_server_list->clear();
for (server_type i_server : ao_app->get_server_list()) for (server_type i_server : ao_app->get_server_list())

View File

@ -32,6 +32,8 @@ public:
QString get_chatlog(); QString get_chatlog();
int get_selected_server(); int get_selected_server();
bool public_servers_selected = true;
~Lobby(); ~Lobby();
private: private:
@ -40,8 +42,6 @@ private:
const int m_lobby_width = 517; const int m_lobby_width = 517;
const int m_lobby_height = 666; const int m_lobby_height = 666;
bool public_servers_selected = true;
AOImage *ui_background; AOImage *ui_background;
AOButton *ui_public_servers; AOButton *ui_public_servers;

View File

@ -143,8 +143,17 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
QString window_title = "Attorney Online 2"; QString window_title = "Attorney Online 2";
int selected_server = w_lobby->get_selected_server(); int selected_server = w_lobby->get_selected_server();
if (w_lobby->public_servers_selected)
{
if (selected_server >= 0 && selected_server < server_list.size()) if (selected_server >= 0 && selected_server < server_list.size())
window_title += ": " + server_list.at(selected_server).name; window_title += ": " + server_list.at(selected_server).name;
}
else
{
if (selected_server >= 0 && selected_server < favorite_list.size())
window_title += ": " + favorite_list.at(selected_server).name;
}
w_courtroom->set_window_title(window_title); w_courtroom->set_window_title(window_title);