diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-07-31 20:05:33 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-08-01 23:05:45 +0200 |
commit | a61c57070aa618ac749e4a90a2b83c0e3a15e5fd (patch) | |
tree | 797bf52349e73aaeb2d46e421e8a798478deecb7 /src/game.cpp | |
parent | 9dd1d4339fd186927b35b64024ee88ba615f2a25 (diff) | |
download | mana-a61c57070aa618ac749e4a90a2b83c0e3a15e5fd.tar.gz mana-a61c57070aa618ac749e4a90a2b83c0e3a15e5fd.tar.bz2 mana-a61c57070aa618ac749e4a90a2b83c0e3a15e5fd.tar.xz mana-a61c57070aa618ac749e4a90a2b83c0e3a15e5fd.zip |
Some positioning changes in the game UI
Moved player status bars to the top-right, next to the window menu. Used
the layout for dynamic adjustments to screen resolution.
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/src/game.cpp b/src/game.cpp index aa4be543..07ead33f 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -64,10 +64,12 @@ #include "gui/textdialog.h" #include "gui/tradewindow.h" #include "gui/viewport.h" +#include "gui/windowmenu.h" #include "gui/widgets/chattab.h" #include "gui/widgets/emoteshortcutcontainer.h" #include "gui/widgets/itemshortcutcontainer.h" +#include "gui/widgets/layout.h" #include "net/gamehandler.h" #include "net/generalhandler.h" @@ -98,7 +100,6 @@ QuitDialog *quitDialog = NULL; ChatWindow *chatWindow; StatusWindow *statusWindow; -MiniStatusWindow *miniStatusWindow; InventoryWindow *inventoryWindow; SkillDialog *skillDialog; Minimap *minimap; @@ -148,7 +149,6 @@ static void createGuiWindows() setupWindow->clearWindowsForReset(); // Create dialogs - miniStatusWindow = new MiniStatusWindow; minimap = new Minimap; chatWindow = new ChatWindow; tradeWindow = new TradeWindow; @@ -160,9 +160,9 @@ static void createGuiWindows() debugWindow = new DebugWindow; itemShortcutWindow = new ShortcutWindow("ItemShortcut", new ItemShortcutContainer); - outfitWindow = new OutfitWindow(); - specialsWindow = new SpecialsWindow(); - socialWindow = new SocialWindow(); + outfitWindow = new OutfitWindow; + specialsWindow = new SpecialsWindow; + socialWindow = new SocialWindow; localChatTab = new ChatTab(_("General")); @@ -183,7 +183,6 @@ static void destroyGuiWindows() del_0(localChatTab) // Need to do this first, so it can remove itself del_0(chatWindow) del_0(statusWindow) - del_0(miniStatusWindow) del_0(inventoryWindow) del_0(skillDialog) del_0(minimap) @@ -219,10 +218,14 @@ Game::Game(): top->add(viewport); viewport->requestMoveToBottom(); - createGuiWindows(); - mWindowMenu = new WindowMenu; - windowContainer->add(mWindowMenu); + mMiniStatusWindow = new MiniStatusWindow; + + windowContainer->place(2, 0, mMiniStatusWindow); + windowContainer->place(1, 0, mWindowMenu).setHAlign(Layout::RIGHT); + windowContainer->updateLayout(); + + createGuiWindows(); initEngines(); @@ -245,6 +248,7 @@ Game::~Game() Event::trigger(Event::GameChannel, Event::Destructing); delete mWindowMenu; + delete mMiniStatusWindow; destroyGuiWindows(); @@ -976,8 +980,12 @@ int Game::getCurrentTileHeight() const return DEFAULT_TILE_LENGTH; } +void Game::updateWindowMenuCaptions() +{ + mWindowMenu->updatePopUpCaptions(); +} + void Game::videoResized(int width, int height) { viewport->setSize(width, height); - mWindowMenu->setPosition(width - 3 - mWindowMenu->getWidth(), 3); } |