summaryrefslogtreecommitdiff
path: root/src/gui/popupmenu.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-07-16 19:26:59 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-07-16 19:26:59 +0000
commita6db4d8004da5ad985a5ff26c0c01976a5618449 (patch)
tree5ed3dea6a28222de87840a4d1966338098123993 /src/gui/popupmenu.cpp
parentf4aedad02e8994f89a4137d175dba2666a7005bc (diff)
downloadmana-a6db4d8004da5ad985a5ff26c0c01976a5618449.tar.gz
mana-a6db4d8004da5ad985a5ff26c0c01976a5618449.tar.bz2
mana-a6db4d8004da5ad985a5ff26c0c01976a5618449.tar.xz
mana-a6db4d8004da5ad985a5ff26c0c01976a5618449.zip
Updated changelog, got rid of remaining extern SDL_Surface *screen cases,
fixed double free and cleaned up a bit.
Diffstat (limited to 'src/gui/popupmenu.cpp')
-rw-r--r--src/gui/popupmenu.cpp26
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())