diff options
| author | Salanto <62221668+Salanto@users.noreply.github.com> | 2024-07-11 16:18:06 +0200 |
|---|---|---|
| committer | Salanto <62221668+Salanto@users.noreply.github.com> | 2024-07-11 16:18:06 +0200 |
| commit | 3cc0b8f2816fe34f8ee00dbcca31aad0902287cf (patch) | |
| tree | 9a38abb32cbe7a44012061f582d40dc0afea877f /src/aoapplication.cpp | |
| parent | 1a2036d4b624a74caf9799e843e385dc6618748f (diff) | |
Add to lobby
Diffstat (limited to 'src/aoapplication.cpp')
| -rw-r--r-- | src/aoapplication.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/aoapplication.cpp b/src/aoapplication.cpp index 7a8e4ea3..6a0600a0 100644 --- a/src/aoapplication.cpp +++ b/src/aoapplication.cpp @@ -54,10 +54,18 @@ void AOApplication::construct_lobby() w_lobby = new Lobby(this, net_manager); - QRect geometry = QGuiApplication::primaryScreen()->geometry(); - int x = (geometry.width() - w_lobby->width()) / 2; - int y = (geometry.height() - w_lobby->height()) / 2; - w_lobby->move(x, y); + auto point = Options::getInstance().windowPosition("lobby"); + if (!Options::getInstance().restoreWindowPositionEnabled() || !point.has_value()) + { + QRect geometry = QGuiApplication::primaryScreen()->geometry(); + int x = (geometry.width() - w_lobby->width()) / 2; + int y = (geometry.height() - w_lobby->height()) / 2; + w_lobby->move(x, y); + } + else + { + w_lobby->move(point->x(), point->y()); + } if (Options::getInstance().discordEnabled()) { |
