diff options
Diffstat (limited to 'src/gui/popupmenu.cpp')
-rw-r--r-- | src/gui/popupmenu.cpp | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp index ea8034d8..dbaa1e70 100644 --- a/src/gui/popupmenu.cpp +++ b/src/gui/popupmenu.cpp @@ -22,6 +22,7 @@ */ #include "popupmenu.h" +#include "gui.h" #include "../graphics.h" #include "../game.h" #include "../engine.h" @@ -29,9 +30,6 @@ #include "../resources/itemmanager.h" #include <iostream> -// TODO Remove this once setVisible doesn't need it anymore -extern SDL_Surface *screen; - PopupMenu::PopupMenu(): Window() { @@ -58,20 +56,6 @@ PopupMenu::~PopupMenu() delete floorItem; } -void PopupMenu::setVisible(bool visible) -{ - if (visible == false) - { - if (hasFocus()) - { - mFocusHandler->focusNone(); - } - setPosition(screen->w, screen->h); - } - - mVisible = visible; -} - void PopupMenu::showPopup(int mx, int my) { being = findNode(mx, my); @@ -108,7 +92,7 @@ void PopupMenu::showPopup(int mx, int my) // If there is nothing of interest, don't display menu. return; } - + //browserBox->addRow("@@look|Look To@@"); browserBox->addRow("##3---"); browserBox->addRow("@@cancel|Cancel@@"); @@ -116,9 +100,9 @@ void PopupMenu::showPopup(int mx, int my) setContentSize(browserBox->getWidth() + 8, browserBox->getHeight() + 8); mx = (mx - camera_x) * 32 + 25; my = (my - camera_y) * 32 + 25; - if (screen->w < (mx + getWidth() + 5)) + if (guiGraphics->getWidth() < (mx + getWidth() + 5)) mx -= (getWidth() + 50); - if (screen->h < (my + getHeight() + 5)) + if (guiGraphics->getHeight() < (my + getHeight() + 5)) my -= (getHeight() + 50); setPosition(mx, my); setVisible(true); @@ -149,7 +133,7 @@ void PopupMenu::handleLink(const std::string& link) else if (link == "follow") { }*/ - + /* // Add Buddy action else if ((link == "buddy") && being && being->isPlayer()) |