aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Skoland <davidskoland@gmail.com>2017-01-20 13:51:14 +0100
committerDavid Skoland <davidskoland@gmail.com>2017-01-20 13:51:14 +0100
commit623d67999a96178da30cab427a2c675c1eccd2d0 (patch)
tree7332e49bbc73f21452b5fd3172f8c95cb55d9ddb
parentccc62647b3ed2df4a650c8aa7ae9d8e43b5dfae1 (diff)
added more courtroom structure
-rw-r--r--aoapplication.cpp2
-rw-r--r--aocharbutton.cpp2
-rw-r--r--courtroom.cpp46
-rw-r--r--courtroom.h2
-rw-r--r--lobby.cpp13
5 files changed, 42 insertions, 23 deletions
diff --git a/aoapplication.cpp b/aoapplication.cpp
index 87525a80..70aeb152 100644
--- a/aoapplication.cpp
+++ b/aoapplication.cpp
@@ -28,6 +28,8 @@ void AOApplication::construct_lobby()
w_lobby = new Lobby(this);
lobby_constructed = true;
+
+ w_lobby->show();
}
void AOApplication::destruct_lobby()
diff --git a/aocharbutton.cpp b/aocharbutton.cpp
index 79dc4e8a..41a4f402 100644
--- a/aocharbutton.cpp
+++ b/aocharbutton.cpp
@@ -5,7 +5,7 @@
#include <QFile>
-AOCharButton::AOCharButton(QWidget *parent, AOApplication *p_ao_app)
+AOCharButton::AOCharButton(QWidget *parent, AOApplication *p_ao_app) : QPushButton(parent)
{
m_parent = parent;
diff --git a/courtroom.cpp b/courtroom.cpp
index 72b53d18..f0ad216e 100644
--- a/courtroom.cpp
+++ b/courtroom.cpp
@@ -83,8 +83,22 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow()
ui_char_select_background = new AOImage(this, ao_app);
- //T0D0: allocate and position charbuttons
- //QVector<AOCharButton*> ui_char_button_list;
+ //setting up the grid and positions
+ const int base_x_pos{25};
+ const int base_y_pos{36};
+
+ const int x_modifier{67};
+ int x_mod_count{0};
+
+ const int y_modifier{67};
+ int y_mod_count{0};
+
+ for (int n = 0 ; n < 90 ; ++n)
+ {
+ ui_char_button_list.append(new AOCharButton(ui_char_select_background, ao_app));
+ }
+
+ ui_char_select_background->hide();
ui_selector = new AOImage(ui_char_select_background, ao_app);
@@ -96,12 +110,15 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow()
connect(ui_reload_theme, SIGNAL(clicked()), this, SLOT(on_reload_theme_clicked()));
+ connect(ui_back_to_lobby, SIGNAL(clicked()), this, SLOT(on_back_to_lobby_clicked()));
+
set_widgets();
}
void Courtroom::set_widgets()
{
this->setFixedSize(m_courtroom_width, m_courtroom_height);
+ this->setWindowTitle("Attorney Online 2: Server name here");
ui_background->set_image("courtroombackground.png");
ui_background->move(0, 0);
@@ -146,10 +163,10 @@ void Courtroom::set_widgets()
set_size_and_pos(ui_ooc_toggle, "ooc_toggle");
- set_size_and_pos(ui_witness_testimony, "witness testimony");
+ set_size_and_pos(ui_witness_testimony, "witness_testimony");
set_size_and_pos(ui_cross_examination, "cross_examination");
- set_size_and_pos(ui_change_character, "change_character";
+ set_size_and_pos(ui_change_character, "change_character");
set_size_and_pos(ui_reload_theme, "reload_theme");
ui_reload_theme->setText("Reload theme");
@@ -185,14 +202,19 @@ void Courtroom::set_widgets()
ui_char_select_background->move(0, 0);
ui_char_select_background->resize(m_courtroom_width, m_courtroom_height);
- QVector<AOCharButton*> ui_char_button_list;
- AOImage *ui_selector;
+ //T0D0: uncomment and set position properly
+ //QVector<AOCharButton*> ui_char_button_list;
+
+ ui_selector->set_image("selector.png");
+ ui_selector->hide();
- AOButton *ui_back_to_lobby;
+ ui_back_to_lobby->setText("Back to Lobby");
+ set_size_and_pos(ui_back_to_lobby, "back_to_lobby");
- QLineEdit *ui_char_password;
+ set_size_and_pos(ui_char_password, "char_password");
- AOButton *ui_spectator;
+ ui_spectator->setText("spectator");
+ set_size_and_pos(ui_spectator, "spectator");
}
@@ -227,6 +249,12 @@ void Courtroom::on_reload_theme_clicked()
set_widgets();
}
+void Courtroom::on_back_to_lobby_clicked()
+{
+ ao_app->construct_lobby();
+ ao_app->destruct_courtroom();
+}
+
Courtroom::~Courtroom()
{
diff --git a/courtroom.h b/courtroom.h
index e0dee82f..dee5401d 100644
--- a/courtroom.h
+++ b/courtroom.h
@@ -123,6 +123,8 @@ private:
private slots:
void on_reload_theme_clicked();
+ void on_back_to_lobby_clicked();
+
};
#endif // COURTROOM_H
diff --git a/lobby.cpp b/lobby.cpp
index 17cae5fc..414ce933 100644
--- a/lobby.cpp
+++ b/lobby.cpp
@@ -14,7 +14,6 @@ Lobby::Lobby(AOApplication *p_ao_app) : QMainWindow()
ao_app = p_ao_app;
this->setWindowTitle("Attorney Online 2");
- this->resize(m_lobby_width, m_lobby_height);
this->setFixedSize(m_lobby_width, m_lobby_height);
ui_background = new AOImage(this, ao_app);
@@ -167,18 +166,6 @@ void Lobby::on_add_to_fav_released()
return;
ao_app->add_favorite_server(ui_server_list->currentRow());
- /*
- if (n_server < 0 || n_server >= ao_app->get_server_list().size())
- return;
-
- server_type fav_server = ao_app->get_server_list().at(n_server);
-
- QString str_port = QString::number(fav_server.port);
-
- QString server_line = fav_server.ip + ":" + str_port + ":" + fav_server.name;
-
- write_to_serverlist_txt(server_line);
- */
}
void Lobby::on_connect_pressed()