diff options
author | Stefan Beller <stefanbeller@googlemail.com> | 2012-08-01 23:25:41 +0200 |
---|---|---|
committer | Stefan Beller <stefanbeller@googlemail.com> | 2012-08-02 20:58:04 +0200 |
commit | d2df9cfb227ab8d6a302183c5f4a3377bb8f5140 (patch) | |
tree | 013922ba1773a658fd469dc8042637301cd49e20 /src/gui/viewport.cpp | |
parent | 7011c8eddfdf1b12a1249e01323db57f05e0334e (diff) | |
download | mana-d2df9cfb227ab8d6a302183c5f4a3377bb8f5140.tar.gz mana-d2df9cfb227ab8d6a302183c5f4a3377bb8f5140.tar.bz2 mana-d2df9cfb227ab8d6a302183c5f4a3377bb8f5140.tar.xz mana-d2df9cfb227ab8d6a302183c5f4a3377bb8f5140.zip |
Add a checkbox to the debugging window to show being ids.
Reviewed-by: Ablu
Diffstat (limited to 'src/gui/viewport.cpp')
-rw-r--r-- | src/gui/viewport.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index 1b5b00c3..e06c5f8d 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -249,6 +249,26 @@ void Viewport::draw(gcn::Graphics *gcnGraphics) b->drawSpeech((int) mPixelViewX, (int) mPixelViewY); } + if (mDebugFlags & Map::DEBUG_BEING_IDS) + { + graphics->setColor(gcn::Color(255, 0, 255, 255)); + ActorSpritesConstIterator it, it_end; + const ActorSprites &actors = actorSpriteManager->getAll(); + for (it = actors.begin(), it_end = actors.end(); it != it_end; ++it) + { + Being *being = dynamic_cast<Being*>(*it); + if (!being) + continue; + + const Vector &beingPos = being->getPosition(); + std::string idString = toString(being->getId()); + graphics->drawText(idString, + beingPos.x - mPixelViewX, + beingPos.y - mPixelViewY, + gcn::Graphics::CENTER); + } + } + if (miniStatusWindow) miniStatusWindow->drawIcons(graphics); @@ -364,7 +384,7 @@ void Viewport::_drawDebugPath(Graphics *graphics) // Draw the path debug information for every beings. ActorSpritesConstIterator it, it_end; const ActorSprites &actors = actorSpriteManager->getAll(); - for (it = actors.begin(), it_end = actors.end() ; it != it_end; it++) + for (it = actors.begin(), it_end = actors.end(); it != it_end; it++) { Being *being = dynamic_cast<Being*>(*it); if (!being) |