diff options
author | Jared Adams <jaxad0127@gmail.com> | 2010-08-02 02:32:18 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-08-02 02:48:03 -0600 |
commit | 42f6993e0deacc857302f48004031dd45b739874 (patch) | |
tree | f8a25e94b32257c1364864824fcf61c83b834d6d /src/gui/viewport.cpp | |
parent | 6a0e5f20c9faf7623a465daa4a8b350d3a52e5e6 (diff) | |
download | mana-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.cpp | 10 |
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; } |