summaryrefslogtreecommitdiff
path: root/src/gui/viewport.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/viewport.cpp')
-rw-r--r--src/gui/viewport.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index 56274573..7f97d98c 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -1,9 +1,8 @@
/*
- * Aethyra
+ * The Mana World
* Copyright (C) 2004 The Mana World Development Team
*
- * This file is part of Aethyra based on original code
- * from The Mana World.
+ * This file is part of The Mana World.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,6 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include "ministatus.h"
#include "popupmenu.h"
#include "viewport.h"
@@ -64,7 +64,7 @@ Viewport::Viewport():
config.addListener("ScrollLaziness", this);
config.addListener("ScrollRadius", this);
- mPopupMenu = new PopupMenu();
+ mPopupMenu = new PopupMenu;
}
Viewport::~Viewport()
@@ -77,6 +77,8 @@ void Viewport::setMap(Map *map)
mMap = map;
}
+extern MiniStatusWindow *miniStatusWindow;
+
void Viewport::draw(gcn::Graphics *gcnGraphics)
{
static int lastTick = tick_time;
@@ -215,6 +217,9 @@ void Viewport::draw(gcn::Graphics *gcnGraphics)
(*i)->drawEmotion(graphics, (int) mPixelViewX, (int) mPixelViewY);
}
+ if (miniStatusWindow)
+ miniStatusWindow->drawIcons(graphics);
+
// Draw contained widgets
WindowContainer::draw(gcnGraphics);
}
@@ -335,7 +340,8 @@ void Viewport::mousePressed(gcn::MouseEvent &event)
else if (event.getButton() == gcn::MouseEvent::MIDDLE)
{
// Find the being nearest to the clicked position
- Being *target = beingManager->findBeingByPixel(x, y);
+ Being *target = beingManager->findNearestLivingBeing(tilex, tiley, 20,
+ Being::MONSTER);
if (target)
player_node->setTarget(target);