From a6b39c1d4f0ee0c9d6ffae14de20188d1dedb2ea Mon Sep 17 00:00:00 2001 From: David Skoland Date: Tue, 24 Jan 2017 14:30:18 +0100 Subject: added hdid implementation for linux and did more work on courtroom --- lobby.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'lobby.cpp') diff --git a/lobby.cpp b/lobby.cpp index 414ce933..04ec4f99 100644 --- a/lobby.cpp +++ b/lobby.cpp @@ -2,7 +2,6 @@ #include "path_functions.h" #include "text_file_functions.h" -#include "global_variables.h" #include "debug_functions.h" #include "aoapplication.h" #include "networkmanager.h" -- cgit From b606b55cae1c1244ec9de19c54acf1a1824013f4 Mon Sep 17 00:00:00 2001 From: David Skoland Date: Tue, 24 Jan 2017 21:00:56 +0100 Subject: started implementing legacy loading protocol --- lobby.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'lobby.cpp') diff --git a/lobby.cpp b/lobby.cpp index 04ec4f99..4a43df73 100644 --- a/lobby.cpp +++ b/lobby.cpp @@ -176,15 +176,11 @@ void Lobby::on_connect_released() { ui_connect->set_image("connect.png"); - //D3BUG START + AOPacket *f_packet = new AOPacket("askchaa#%"); - ao_app->construct_courtroom(); + ao_app->send_server_packet(f_packet); - ao_app->destruct_lobby(); - - //D3BUG END - - //T0D0: call ao_app to initialize loading sequence + delete f_packet; } void Lobby::on_about_clicked() -- cgit From 723582574094e4b7db6c25569c2b180c426ae513 Mon Sep 17 00:00:00 2001 From: David Skoland Date: Wed, 25 Jan 2017 15:54:00 +0100 Subject: characters now load successfully --- lobby.cpp | 69 ++++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 37 insertions(+), 32 deletions(-) (limited to 'lobby.cpp') diff --git a/lobby.cpp b/lobby.cpp index 4a43df73..9ff0990a 100644 --- a/lobby.cpp +++ b/lobby.cpp @@ -50,68 +50,79 @@ void Lobby::set_widgets() ao_app->set_user_theme(); ui_background->set_image("lobbybackground.png"); - ui_background->move(0, 0); ui_background->resize(m_lobby_width, m_lobby_height); ui_public_servers->set_image("publicservers_selected.png"); - ui_public_servers->move(46, 88); - ui_public_servers->resize(114, 30); + set_size_and_pos(ui_public_servers, "public_servers"); ui_favorites->set_image("favorites.png"); - ui_favorites->move(164, 88); - ui_favorites->resize(114, 30); + set_size_and_pos(ui_favorites, "favorites"); ui_refresh->set_image("refresh.png"); - ui_refresh->move(56, 381); - ui_refresh->resize(132, 28); + set_size_and_pos(ui_refresh, "refresh"); ui_add_to_fav->set_image("addtofav.png"); - ui_add_to_fav->move(194, 381); - ui_add_to_fav->resize(132, 28); + set_size_and_pos(ui_add_to_fav, "add_to_fav"); ui_connect->set_image("connect.png"); - ui_connect->move(332, 381); - ui_connect->resize(132, 28); + set_size_and_pos(ui_connect, "connect"); ui_about->set_image("about.png"); - ui_about->move(428, 1); - ui_about->resize(88, 21); + set_size_and_pos(ui_about, "about"); - ui_server_list->move(20, 125); - ui_server_list->resize(286, 240); + set_size_and_pos(ui_server_list, "server_list"); ui_server_list->setStyleSheet("background-color: rgba(0, 0, 0, 0);" - "font: bold;"); + "font: bold;"); - ui_player_count->move(336, 91); - ui_player_count->resize(173, 16); + set_size_and_pos(ui_player_count, "player_count"); ui_player_count->setText("Offline"); ui_player_count->setStyleSheet("font: bold;" "color: white;" "qproperty-alignment: AlignCenter;"); - ui_description->move(337, 109); - ui_description->resize(173, 245); + set_size_and_pos(ui_description, "description"); ui_description->setReadOnly(true); ui_description->setStyleSheet("background-color: rgba(0, 0, 0, 0);" "color: white;"); - ui_chatbox->move(2, 445); - ui_chatbox->resize(515, 198); + set_size_and_pos(ui_chatbox, "chatbox"); ui_chatbox->setReadOnly(true); ui_chatbox->setStyleSheet("background-color: rgba(0, 0, 0, 0);"); - ui_chatname->move(3, 646); - ui_chatname->resize(85, 19); + set_size_and_pos(ui_chatname, "chatname"); ui_chatname->setStyleSheet("background-color: rgba(0, 0, 0, 0);" "selection-background-color: rgba(0, 0, 0, 0);"); - ui_chatmessage->move(93, 646); - ui_chatmessage->resize(424, 19); + set_size_and_pos(ui_chatmessage, "chatmessage"); ui_chatmessage->setStyleSheet("background-color: rgba(0, 0, 0, 0);" "selection-background-color: rgba(0, 0, 0, 0);"); } +void Lobby::set_size_and_pos(QWidget *p_widget, QString p_identifier) +{ + QString design_ini_path = ao_app->get_theme_path() + "lobby_design.ini"; + QString default_ini_path = ao_app->get_base_path() + "themes/default/lobby_design.ini"; + + pos_size_type design_ini_result = ao_app->get_pos_and_size(p_identifier, design_ini_path); + + if (design_ini_result.width < 0 || design_ini_result.height < 0) + { + design_ini_result = ao_app->get_pos_and_size(p_identifier, default_ini_path); + + if (design_ini_result.width < 0 || design_ini_result.height < 0) + { + //at this point it's pretty much game over + //T0D0: add message box + qDebug() << "CRITICAL ERROR: NO SUITABLE DATA FOR SETTING " << p_identifier; + ao_app->quit(); + } + } + + p_widget->move(design_ini_result.x, design_ini_result.y); + p_widget->resize(design_ini_result.width, design_ini_result.height); +} + void Lobby::on_public_servers_clicked() { ui_public_servers->set_image("publicservers_selected.png"); @@ -147,8 +158,6 @@ void Lobby::on_refresh_released() AOPacket *f_packet = new AOPacket("ALL#%"); ao_app->send_ms_packet(f_packet); - - delete f_packet; } void Lobby::on_add_to_fav_pressed() @@ -179,8 +188,6 @@ void Lobby::on_connect_released() AOPacket *f_packet = new AOPacket("askchaa#%"); ao_app->send_server_packet(f_packet); - - delete f_packet; } void Lobby::on_about_clicked() @@ -233,8 +240,6 @@ void Lobby::on_chatfield_return_pressed() ao_app->send_ms_packet(f_packet); ui_chatmessage->clear(); - - delete f_packet; } void Lobby::list_servers() -- cgit From ddce06f42c776fd7ab5540ad281676baae1bb4f8 Mon Sep 17 00:00:00 2001 From: David Skoland Date: Wed, 25 Jan 2017 15:56:26 +0100 Subject: debug version for corno --- lobby.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lobby.cpp') diff --git a/lobby.cpp b/lobby.cpp index 9ff0990a..0a1a88ee 100644 --- a/lobby.cpp +++ b/lobby.cpp @@ -185,9 +185,11 @@ void Lobby::on_connect_released() { ui_connect->set_image("connect.png"); - AOPacket *f_packet = new AOPacket("askchaa#%"); - - ao_app->send_server_packet(f_packet); + //D3BUG + //AOPacket *f_packet = new AOPacket("askchaa#%"); + ao_app->construct_courtroom(); + //ao_app->send_server_packet(f_packet); + //D3BUG END } void Lobby::on_about_clicked() -- cgit From 58d98e41bea77dac1b5726b4ead8b3f072750b38 Mon Sep 17 00:00:00 2001 From: David Skoland Date: Wed, 25 Jan 2017 18:09:55 +0100 Subject: started making the loading screen --- lobby.cpp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'lobby.cpp') diff --git a/lobby.cpp b/lobby.cpp index 0a1a88ee..a0b37a89 100644 --- a/lobby.cpp +++ b/lobby.cpp @@ -28,6 +28,10 @@ Lobby::Lobby(AOApplication *p_ao_app) : QMainWindow() ui_chatbox = new QPlainTextEdit(this); ui_chatname = new QLineEdit(this); ui_chatmessage = new QLineEdit(this); + ui_loading_background = new AOImage(this, ao_app); + ui_loading_label = new QLabel(ui_loading_background); + ui_progress_bar = new QProgressBar(ui_loading_background); + ui_cancel = new AOButton(ui_loading_background, ao_app); connect(ui_public_servers, SIGNAL(clicked()), this, SLOT(on_public_servers_clicked())); connect(ui_favorites, SIGNAL(clicked()), this, SLOT(on_favorites_clicked())); @@ -97,6 +101,16 @@ void Lobby::set_widgets() ui_chatmessage->setStyleSheet("background-color: rgba(0, 0, 0, 0);" "selection-background-color: rgba(0, 0, 0, 0);"); + ui_loading_background->set_image("loadingbackground.png"); + ui_loading_background->resize(m_lobby_width, m_lobby_height); + + set_size_and_pos(ui_loading_label, "loading_label"); + set_size_and_pos(ui_progress_bar, "progress_bar"); + set_size_and_pos(ui_cancel, "cancel"); + ui_cancel->setText("Cancel"); + + ui_loading_background->hide(); + } void Lobby::set_size_and_pos(QWidget *p_widget, QString p_identifier) @@ -185,11 +199,8 @@ void Lobby::on_connect_released() { ui_connect->set_image("connect.png"); - //D3BUG - //AOPacket *f_packet = new AOPacket("askchaa#%"); - ao_app->construct_courtroom(); - //ao_app->send_server_packet(f_packet); - //D3BUG END + AOPacket *f_packet = new AOPacket("askchaa#%"); + ao_app->send_server_packet(f_packet); } void Lobby::on_about_clicked() -- cgit From c262bb4974ed293bf8e67524576477d2e92fd4f0 Mon Sep 17 00:00:00 2001 From: David Skoland Date: Wed, 25 Jan 2017 19:13:15 +0100 Subject: set attributes on loading screen widgets --- lobby.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lobby.cpp') diff --git a/lobby.cpp b/lobby.cpp index a0b37a89..feeff23e 100644 --- a/lobby.cpp +++ b/lobby.cpp @@ -105,11 +105,16 @@ void Lobby::set_widgets() ui_loading_background->resize(m_lobby_width, m_lobby_height); set_size_and_pos(ui_loading_label, "loading_label"); + ui_loading_label->setFont(QFont("Arial", 20, QFont::Bold)); + ui_loading_label->setStyleSheet("color: rgba(255, 128, 0, 255);" + "qproperty-alignment: AlignCenter;"); + ui_loading_label->setText("Loading"); + set_size_and_pos(ui_progress_bar, "progress_bar"); set_size_and_pos(ui_cancel, "cancel"); ui_cancel->setText("Cancel"); - ui_loading_background->hide(); + //ui_loading_background->hide(); } -- cgit From 99aa327318ab00f2049cfcefadd353c3a4e06bf7 Mon Sep 17 00:00:00 2001 From: David Skoland Date: Wed, 25 Jan 2017 19:50:49 +0100 Subject: loading characters now works with overlay --- lobby.cpp | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'lobby.cpp') diff --git a/lobby.cpp b/lobby.cpp index feeff23e..37091146 100644 --- a/lobby.cpp +++ b/lobby.cpp @@ -29,7 +29,7 @@ Lobby::Lobby(AOApplication *p_ao_app) : QMainWindow() ui_chatname = new QLineEdit(this); ui_chatmessage = new QLineEdit(this); ui_loading_background = new AOImage(this, ao_app); - ui_loading_label = new QLabel(ui_loading_background); + ui_loading_text = new QTextEdit(ui_loading_background); ui_progress_bar = new QProgressBar(ui_loading_background); ui_cancel = new AOButton(ui_loading_background, ao_app); @@ -44,6 +44,7 @@ Lobby::Lobby(AOApplication *p_ao_app) : QMainWindow() connect(ui_about, SIGNAL(clicked()), this, SLOT(on_about_clicked())); connect(ui_server_list, SIGNAL(clicked(QModelIndex)), this, SLOT(on_server_list_clicked(QModelIndex))); connect(ui_chatmessage, SIGNAL(returnPressed()), this, SLOT(on_chatfield_return_pressed())); + connect(ui_cancel, SIGNAL(clicked()), ao_app, SLOT(loading_cancelled())); set_widgets(); } @@ -104,17 +105,19 @@ void Lobby::set_widgets() ui_loading_background->set_image("loadingbackground.png"); ui_loading_background->resize(m_lobby_width, m_lobby_height); - set_size_and_pos(ui_loading_label, "loading_label"); - ui_loading_label->setFont(QFont("Arial", 20, QFont::Bold)); - ui_loading_label->setStyleSheet("color: rgba(255, 128, 0, 255);" - "qproperty-alignment: AlignCenter;"); - ui_loading_label->setText("Loading"); + set_size_and_pos(ui_loading_text, "loading_label"); + ui_loading_text->setFont(QFont("Arial", 20, QFont::Bold)); + ui_loading_text->setReadOnly(true); + ui_loading_text->setAlignment(Qt::AlignCenter); + ui_loading_text->setStyleSheet("background-color: rgba(0, 0, 0, 0);" + "color: rgba(255, 128, 0, 255);"); + ui_loading_text->append("Loading"); set_size_and_pos(ui_progress_bar, "progress_bar"); set_size_and_pos(ui_cancel, "cancel"); ui_cancel->setText("Cancel"); - //ui_loading_background->hide(); + ui_loading_background->hide(); } @@ -142,6 +145,13 @@ void Lobby::set_size_and_pos(QWidget *p_widget, QString p_identifier) p_widget->resize(design_ini_result.width, design_ini_result.height); } +void Lobby::set_loading_text(QString p_text) +{ + ui_loading_text->clear(); + ui_loading_text->setAlignment(Qt::AlignCenter); + ui_loading_text->append(p_text); +} + void Lobby::on_public_servers_clicked() { ui_public_servers->set_image("publicservers_selected.png"); -- cgit From 9682087667e2de26e14406efde960b8c7f0c3c98 Mon Sep 17 00:00:00 2001 From: David Skoland Date: Fri, 27 Jan 2017 01:17:33 +0100 Subject: implemented ooc chat and cleaned up some old headers --- lobby.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'lobby.cpp') diff --git a/lobby.cpp b/lobby.cpp index 37091146..8bc67bd4 100644 --- a/lobby.cpp +++ b/lobby.cpp @@ -1,7 +1,5 @@ #include "lobby.h" -#include "path_functions.h" -#include "text_file_functions.h" #include "debug_functions.h" #include "aoapplication.h" #include "networkmanager.h" @@ -27,6 +25,7 @@ Lobby::Lobby(AOApplication *p_ao_app) : QMainWindow() ui_description = new QPlainTextEdit(this); ui_chatbox = new QPlainTextEdit(this); ui_chatname = new QLineEdit(this); + ui_chatname->setPlaceholderText("Name"); ui_chatmessage = new QLineEdit(this); ui_loading_background = new AOImage(this, ao_app); ui_loading_text = new QTextEdit(ui_loading_background); @@ -152,6 +151,13 @@ void Lobby::set_loading_text(QString p_text) ui_loading_text->append(p_text); } +QString Lobby::get_chatlog() +{ + QString return_value = ui_chatbox->toPlainText(); + + return return_value; +} + void Lobby::on_public_servers_clicked() { ui_public_servers->set_image("publicservers_selected.png"); @@ -260,6 +266,11 @@ void Lobby::on_server_list_clicked(QModelIndex p_model) void Lobby::on_chatfield_return_pressed() { + //no you can't send empty messages + if (ui_chatname->text() == "" || ui_chatmessage->text() == "") + return; + + QString f_header = "CT"; QStringList f_contents{ui_chatname->text(), ui_chatmessage->text()}; -- cgit