This repository has been archived by the owner on Jun 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lobby.h
103 lines (79 loc) · 2.21 KB
/
lobby.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
//////////////////////////////////////////////////
//
// This work is licensed under the MIT license.
//
// You are free to copy, modify and distribute
// this work freely given that proper attribution
// is supplied and the author is not held liable.
// See LICENSE for details.
//
// Copyright (c) 2016-2018 David "OmniTroid" Skoland
//
//////////////////////////////////////////////////
#ifndef LOBBY_H
#define LOBBY_H
#include "aoimage.h"
#include "aobutton.h"
#include "aopacket.h"
#include "aotextarea.h"
#include <QMainWindow>
#include <QListWidget>
#include <QLabel>
#include <QPlainTextEdit>
#include <QLineEdit>
#include <QProgressBar>
#include <QTextBrowser>
class AOApplication;
class Lobby : public QMainWindow
{
Q_OBJECT
public:
Lobby(AOApplication *p_ao_app);
void set_widgets();
void list_servers();
void list_favorites();
void append_chatmessage(QString f_name, QString f_message);
void set_player_count(int players_online, int max_players);
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();
int get_selected_server();
void set_loading_value(int p_value);
bool public_servers_selected = true;
~Lobby();
private:
AOApplication *ao_app;
AOImage *ui_background;
AOButton *ui_public_servers;
AOButton *ui_favorites;
AOButton *ui_refresh;
AOButton *ui_add_to_fav;
AOButton *ui_connect;
QLabel *ui_version;
AOButton *ui_about;
QListWidget *ui_server_list;
QLabel *ui_player_count;
AOTextArea *ui_description;
AOTextArea *ui_chatbox;
QLineEdit *ui_chatname;
QLineEdit *ui_chatmessage;
AOImage *ui_loading_background;
QTextEdit *ui_loading_text;
QProgressBar *ui_progress_bar;
AOButton *ui_cancel;
void set_size_and_pos(QWidget *p_widget, QString p_identifier);
private slots:
void on_public_servers_clicked();
void on_favorites_clicked();
void on_refresh_pressed();
void on_refresh_released();
void on_add_to_fav_pressed();
void on_add_to_fav_released();
void on_connect_pressed();
void on_connect_released();
void on_about_clicked();
void on_server_list_clicked(QModelIndex p_model);
void on_chatfield_return_pressed();
};
#endif // LOBBY_H