aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstonedDiscord <stoned@derpymail.org>2017-03-18 17:54:28 +0100
committerstonedDiscord <stoned@derpymail.org>2017-03-18 17:54:34 +0100
commit5ddde2bf9c4c8babba1dfea8c7de76b4c25f77f0 (patch)
tree22e6da61507ea5a2d0cf1c07e84c728907960eca
parent1fe3f25a256703f798b6f1fd69a9b7b37476f2df (diff)
made lobby resizeable from design ini
-rw-r--r--lobby.cpp20
-rw-r--r--lobby.h4
2 files changed, 21 insertions, 3 deletions
diff --git a/lobby.cpp b/lobby.cpp
index 91b5667e..c29bf97a 100644
--- a/lobby.cpp
+++ b/lobby.cpp
@@ -59,7 +59,25 @@ void Lobby::set_widgets()
{
ao_app->set_user_theme();
- ui_background->resize(m_lobby_width, m_lobby_height);
+ QString filename = "lobby_design.ini";
+
+ pos_size_type f_lobby = ao_app->get_element_dimensions("lobby", filename);
+
+ if (f_lobby.width < 0 || f_lobby.height < 0)
+ {
+ qDebug() << "W: did not find courtroom width or height in " << filename;
+
+ this->resize(517, 666);
+ }
+ else
+ {
+ m_lobby_width = f_lobby.width;
+ m_lobby_height = f_lobby.height;
+
+ this->setFixedSize(f_lobby.width, f_lobby.height);
+ }
+
+ set_size_and_pos(ui_background, "lobby");
ui_background->set_image("lobbybackground.png");
set_size_and_pos(ui_public_servers, "public_servers");
diff --git a/lobby.h b/lobby.h
index 83b9cb40..bbe177b0 100644
--- a/lobby.h
+++ b/lobby.h
@@ -42,8 +42,8 @@ public:
private:
AOApplication *ao_app;
- const int m_lobby_width = 517;
- const int m_lobby_height = 666;
+ int m_lobby_width = 517;
+ int m_lobby_height = 666;
AOImage *ui_background;