From ff4d98eeee5a5a799039549c6df885a5208b792f Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sun, 9 Oct 2005 12:35:46 +0000 Subject: Fixed display of [TARGET] and Alt keys for toggling windows. --- src/being.cpp | 10 ++++++++++ src/engine.cpp | 18 ------------------ src/game.cpp | 5 ++--- 3 files changed, 12 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/being.cpp b/src/being.cpp index 9f9c7834..9dccb5f6 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -427,6 +427,16 @@ void Being::drawSpeech(Graphics *graphics, Sint32 offsetX, Sint32 offsetY) gcn::Graphics::CENTER); } + // Potentially draw [TARGET] above this being + if (this == autoTarget) + { + graphics->setFont(speechFont); + int dy = (getType() == PLAYER) ? 90 : 52; + + graphics->drawText("[TARGET]", px + 15, py - dy, + gcn::Graphics::CENTER); + } + // Draw player name if (getType() == PLAYER && this != player_node) { diff --git a/src/engine.cpp b/src/engine.cpp index dda6896c..73974edc 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -340,24 +340,6 @@ void Engine::draw() (*i)->drawSpeech(graphics, -map_x, -map_y); } - if (autoTarget) - { - if (autoTarget->getType() == Being::PLAYER) - { - graphics->drawText("[TARGET]", - autoTarget->getPixelX() + 15, - autoTarget->getPixelY() - 60, - gcn::Graphics::CENTER); - } - else - { - graphics->drawText("[TARGET]", - autoTarget->getPixelX() + 60, - autoTarget->getPixelY(), - gcn::Graphics::CENTER); - } - } - #ifdef DEBUG std::stringstream debugStream; debugStream << "[" << fps << " fps] " << mouseTileX << ", " << mouseTileY; diff --git a/src/game.cpp b/src/game.cpp index e8692fd9..9cac4df0 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -647,7 +647,7 @@ void do_input() } SDL_FreeSurface(screenshot); } - break; + break; default: break; @@ -655,7 +655,7 @@ void do_input() if (requestedWindow) { - requestedWindow->setVisible(requestedWindow->isVisible()); + requestedWindow->setVisible(!requestedWindow->isVisible()); if (requestedWindow->isVisible()) { requestedWindow->requestMoveToTop(); @@ -1492,7 +1492,6 @@ void do_parse() player_node->mFrame = 0; player_node->x = x; player_node->y = y; - player_node->setMap(tiledMap); // Send "map loaded" MessageOut outMsg; -- cgit v1.2.3-70-g09d2