Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
68b93b0
Remove config loading from AOApplications
Salanto Aug 17, 2022
1b56b44
First steps towards UI file
Salanto Aug 17, 2022
18fc734
Fixed your UI layout issue
TrickyLeifa Aug 17, 2022
cf6fbd5
Leifa bullies me
Salanto Aug 18, 2022
f42f21c
Set all the setters
Salanto Aug 18, 2022
982f394
Make layout appear proper
Salanto Aug 19, 2022
37b556f
Minor option dialog update
TrickyLeifa Aug 19, 2022
e32f056
Hookup AOOptionsdialogue to Options Getter/setter
Salanto Aug 19, 2022
7ea700b
More settings menu working
Salanto Aug 19, 2022
b030650
Mostly working settings dialogue
Salanto Aug 19, 2022
db44017
Fix asset widget
Salanto Aug 19, 2022
12bdea6
Tooltips
Salanto Aug 19, 2022
5de995e
Finish Tooltips
Salanto Aug 19, 2022
a65d432
Migrate callwords to config.ini
Salanto Aug 19, 2022
cb8b40c
Fix widget translation
Salanto Aug 20, 2022
47b486b
Language dropdown changes
Salanto Aug 20, 2022
fa6fcad
Remove QSettings from AOApplication
Salanto Aug 20, 2022
3ceef2e
Fix constructor order to prevent runtime crash
Salanto Aug 20, 2022
5cbcb13
Slightly sort implementation file
Salanto Aug 20, 2022
717419f
Remove unused label declarations from header
Salanto Aug 20, 2022
20271e6
Formatting
Salanto Aug 20, 2022
8a40a38
Fix buttons
Salanto Aug 20, 2022
ee747ea
Raise pair list after courtroom construction (#859)
Salanto Aug 20, 2022
7746b95
Don't reset evidence selection (#860)
Salanto Aug 20, 2022
15af6c3
Hitting the emergency exit (#861)
Salanto Aug 20, 2022
a5d53ae
add CI and license badge
stonedDiscord Aug 20, 2022
228c691
add contributors
stonedDiscord Aug 20, 2022
54f6784
Handle config.temp after confirmation
Salanto Aug 21, 2022
b746c4a
Make reset to default destructive
Salanto Aug 21, 2022
dc58a66
Merge pull request #863 from AttorneyOnline/awesome-readme
oldmud0 Aug 25, 2022
dedf6af
Fix case of self_offset received without a y offset (#864)
oldmud0 Sep 6, 2022
e29ac84
Change default settings (#839)
Crystalwarrior Sep 6, 2022
2c2840a
Make it a singleton? Maybe? I dunno? Ask Longbyte
Salanto Sep 12, 2022
3b51996
Commit suggestions
Salanto Sep 12, 2022
369bc63
More suggestions
Salanto Sep 12, 2022
e32f812
Return to dialog
Salanto Sep 13, 2022
9930cf6
Cleanup
Salanto Sep 13, 2022
d5e3c21
Deprecate ooc_name, implement username
Salanto Sep 13, 2022
84d95f8
Consistent naming in AOOptionsDialog
Salanto Sep 13, 2022
f8d04c5
Clang format
Salanto Sep 13, 2022
af3c697
Don't write the username to the showname
Salanto Sep 17, 2022
3845823
Fix theme dropdown being incorrectly set
Salanto Sep 28, 2022
2268295
Bandaid callword playing every message
Salanto Oct 3, 2022
5d0b78a
Remove unused or duplicate includes
Salanto Oct 3, 2022
93c87fc
More include removals
Salanto Oct 3, 2022
46ada8a
Burn baby, burn!
Salanto Oct 3, 2022
5185126
Remove reload_theme function
Salanto Oct 3, 2022
c600570
Remove "Case Alert Supported Message"
Salanto Oct 5, 2022
abb348f
Merge branch 'master' into ui-files-aooptionsdialogue
Salanto Oct 8, 2022
ac56601
Create preliminary lobby design
Salanto Oct 11, 2022
80a8a26
Fix missing header, add necessary search lineedits
Salanto Oct 12, 2022
601dc9b
More UI changes
Salanto Oct 14, 2022
066a999
Start hooking up new UI elements
Salanto Oct 28, 2022
be0d17f
Hookup Serverbrowser to new UI frontend
Salanto Oct 29, 2022
ae5cd09
Fixup demo ui and make demoserver functional
Salanto Nov 2, 2022
fc6c8e4
More demoserver cleanup
Salanto Nov 3, 2022
758c22f
Remove jarring ao_app pointer shenigans
Salanto Nov 3, 2022
2b8119b
*unholy screeches*
Salanto Nov 4, 2022
d35ea26
Rip out loading screen
Salanto Nov 4, 2022
cff47f5
Optimise includes, format header
Salanto Nov 4, 2022
361e79f
Formatting fixes
Salanto Nov 4, 2022
6b49a3a
Why does netmanager never emit when the server is connected
Salanto Nov 4, 2022
b6908ab
Fixup final parts
Salanto Nov 4, 2022
a605536
Merge branch 'devel-2-11' into ui-files-lobby
Salanto Nov 4, 2022
9f47969
Correct start page
Salanto Nov 4, 2022
2d766cf
demo qol
Salanto Nov 4, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions include/aoapplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,19 @@ class AOApplication : public QApplication {
*/
QVector<server_type> read_legacy_favorite_servers();

/**
* @brief Reads the clients log folder and locates potential demo files to populate the demoserver list.
*
* @return A seperated list of servernames and demo logfile filenames.
*
* @details This is to remove the need of delimiters or deal with potential
* harmfully encoding or plattform differences. We always get a combo of servername and filename.
*
* Do note this function assumes all demo files have the .demo extension.
*
*/
QMultiMap<QString, QString> load_demo_logs_list() const;

// Returns the value of p_identifier in the design.ini file in p_design_path
QString read_design_ini(QString p_identifier, VPath p_design_path);
QString read_design_ini(QString p_identifier, QString p_design_path);
Expand Down
3 changes: 3 additions & 0 deletions include/demoserver.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ class DemoServer : public QObject
int port = 27088;
int max_wait = -1;

void set_demo_file(QString filepath);

private:
void handle_packet(AOPacket *packet);
void load_demo(QString filename);
Expand All @@ -39,6 +41,7 @@ class DemoServer : public QObject
QString p_path;
QTimer *timer;
int elapsed_time = 0;
QString filename;

private slots:
void accept_connection();
Expand Down
113 changes: 46 additions & 67 deletions include/lobby.h
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
#ifndef LOBBY_H
#define LOBBY_H

#include "aobutton.h"
#include "aoimage.h"
#include "aopacket.h"
#include "aotextarea.h"

#include <QDebug>
#include <QLabel>
#include <QLineEdit>
#include <QListWidget>
#include <QMainWindow>
#include <QPlainTextEdit>
#include <QProgressBar>
#include <QPushButton>
#include <QTextBrowser>
#include <QTreeWidget>
#include <QDebug>
#include <QScrollBar>
#include <QHeaderView>

#include "networkmanager.h"

#ifdef ANDROID
#include <QtAndroidExtras/QtAndroid>
#endif
Expand All @@ -27,89 +21,74 @@ class Lobby : public QMainWindow {
Q_OBJECT

public:
Lobby(AOApplication *p_ao_app);
Lobby(AOApplication *p_ao_app, NetworkManager *p_net_man = nullptr);
~Lobby();

void set_widgets();
void list_servers();
void list_favorites();
void get_motd();
void check_for_updates();
void append_chatmessage(QString f_name, QString f_message);
void append_error(QString f_message);
void set_player_count(int players_online, int max_players);
void set_server_description(const QString& server_description);
void set_stylesheet(QWidget *widget);
void set_stylesheets();
void set_fonts();
void set_font(QWidget *widget, QString p_identifier);
void set_loading_text(QString p_text);
void show_loading_overlay() { ui_loading_background->show(); }
void hide_loading_overlay() { ui_loading_background->hide(); }
QString get_chatlog();
void set_server_description(const QString &server_description);
void list_servers();
int get_selected_server();
void enable_connect_button();
void reset_selection();

void set_loading_value(int p_value);

bool public_servers_selected = true;
bool doubleclicked = false;
signals:
void settings_requested();

~Lobby();

private:
AOApplication *ao_app;
NetworkManager *net_manager;

AOImage *ui_background;
void list_favorites();
void list_demos();
void get_motd();
void check_for_updates();
void reset_selection();

AOButton *ui_public_servers;
AOButton *ui_favorites;
int last_index = -1;

AOButton *ui_refresh;
AOButton *ui_add_to_fav;
AOButton *ui_remove_from_fav;
AOButton *ui_connect;
enum TabPage { SERVER, FAVORITES, DEMOS };

QLabel *ui_version;
AOButton *ui_about;
// UI-file Lobby

AOButton *ui_settings;
// Top Row
QLabel *ui_game_version_lbl;
QPushButton *ui_settings_button;
QPushButton *ui_about_button;

QTreeWidget *ui_server_list;
QLineEdit *ui_server_search;
// Server, Favs and Demo lists
QTabWidget *ui_connections_tabview;

QLabel *ui_player_count;
AOTextArea *ui_description;
QTreeWidget *ui_serverlist_tree;
QLineEdit *ui_serverlist_search;

AOTextArea *ui_chatbox;
QTreeWidget *ui_favorites_tree;
QLineEdit *ui_favorites_search;

AOImage *ui_loading_background;
QTextEdit *ui_loading_text;
QProgressBar *ui_progress_bar;
AOButton *ui_cancel;
QTreeWidget *ui_demo_tree;
QLineEdit *ui_demo_search;

int last_index = -1;
QPushButton *ui_add_to_favorite_button;
QPushButton *ui_remove_from_favorites_button;
QPushButton *ui_refresh_button;

void set_size_and_pos(QWidget *p_widget, QString p_identifier);
// Serverinfo / MOTD Horizontal Row
QTextBrowser *ui_motd_text;

private slots:
void on_public_servers_clicked();
void on_favorites_clicked();
QLabel *ui_server_player_count_lbl;
QTextBrowser *ui_server_description_text;
QPushButton *ui_connect_button;

void on_refresh_pressed();
private slots:
void on_tab_changed(int index);
void on_refresh_released();
void on_add_to_fav_pressed();
void on_add_to_fav_released();
void on_remove_from_fav_pressed();
void on_remove_from_fav_released();
void on_connect_pressed();
void on_connect_released();
void on_about_clicked();
void on_settings_clicked();
void on_server_list_clicked(QTreeWidgetItem *p_item, int column);
void on_server_list_doubleclicked(QTreeWidgetItem *p_item, int column);
void on_server_list_context_menu_requested(const QPoint &point);
void on_list_doubleclicked(QTreeWidgetItem *p_item, int column);
void on_favorite_list_context_menu_requested(const QPoint &point);
void on_favorite_tree_clicked(QTreeWidgetItem *p_item, int column);
void on_server_search_edited(QString p_text);
void on_demo_clicked(QTreeWidgetItem *item, int column);
};

#endif // LOBBY_H
4 changes: 4 additions & 0 deletions include/networkmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,13 @@ class NetworkManager : public QObject {
void connect_to_server(server_type p_server);
void disconnect_from_server();

signals:
void server_connected(bool state);

public slots:
void get_server_list(const std::function<void()> &cb);
void ship_server_packet(QString p_packet);
void join_to_server();
void handle_server_packet(const QString& p_data);

void request_document(MSDocumentType document_type,
Expand Down
Loading