summaryrefslogtreecommitdiff
path: root/src/gui/viewport.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-08-02 02:32:18 -0600
committerJared Adams <jaxad0127@gmail.com>2010-08-02 02:48:03 -0600
commit42f6993e0deacc857302f48004031dd45b739874 (patch)
treef8a25e94b32257c1364864824fcf61c83b834d6d /src/gui/viewport.cpp
parent6a0e5f20c9faf7623a465daa4a8b350d3a52e5e6 (diff)
downloadmana-42f6993e0deacc857302f48004031dd45b739874.tar.gz
mana-42f6993e0deacc857302f48004031dd45b739874.tar.bz2
mana-42f6993e0deacc857302f48004031dd45b739874.tar.xz
mana-42f6993e0deacc857302f48004031dd45b739874.zip
Remove non-GUI references to MiniStatusWindow
Reviewed-by: Freeyorp
Diffstat (limited to 'src/gui/viewport.cpp')
-rw-r--r--src/gui/viewport.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index fc9adab1..b6e4f71d 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -495,14 +495,17 @@ void Viewport::mouseMoved(gcn::MouseEvent &event)
const int x = (event.getX() + (int) mPixelViewX);
const int y = (event.getY() + (int) mPixelViewY);
+ mHoverBeing->removeActorSpriteListener(this);
mHoverBeing = actorSpriteManager->findBeingByPixel(x, y);
mBeingPopup->show(getMouseX(), getMouseY(), mHoverBeing);
+ mHoverItem->removeActorSpriteListener(this);
mHoverItem = actorSpriteManager->findItem(x / mMap->getTileWidth(),
y / mMap->getTileHeight());
if (mHoverBeing)
{
+ mHoverBeing->addActorSpriteListener(this);
switch (mHoverBeing->getType())
{
// NPCs
@@ -522,6 +525,7 @@ void Viewport::mouseMoved(gcn::MouseEvent &event)
}
else if (mHoverItem)
{
+ mHoverItem->addActorSpriteListener(this);
gui->setCursorType(Gui::CURSOR_PICKUP);
}
else
@@ -546,11 +550,11 @@ void Viewport::hideBeingPopup()
mBeingPopup->setVisible(false);
}
-void Viewport::clearHover(ActorSprite *actor)
+void Viewport::actorSpriteDestroyed(const ActorSprite &actorSprite)
{
- if (mHoverBeing == actor)
+ if (&actorSprite == mHoverBeing)
mHoverBeing = 0;
- if (mHoverItem == actor)
+ if (&actorSprite == mHoverItem)
mHoverItem = 0;
}