summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-10-09 12:35:46 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-10-09 12:35:46 +0000
commitff4d98eeee5a5a799039549c6df885a5208b792f (patch)
tree1e3a770cac29ed3f3e2d2f7b62e6286d8d5bb24d
parent6f706879515b4e37a78994aaae6b0e36d00b5f32 (diff)
downloadmana-ff4d98eeee5a5a799039549c6df885a5208b792f.tar.gz
mana-ff4d98eeee5a5a799039549c6df885a5208b792f.tar.bz2
mana-ff4d98eeee5a5a799039549c6df885a5208b792f.tar.xz
mana-ff4d98eeee5a5a799039549c6df885a5208b792f.zip
Fixed display of [TARGET] and Alt keys for toggling windows.
-rw-r--r--ChangeLog4
-rw-r--r--src/being.cpp10
-rw-r--r--src/engine.cpp18
-rw-r--r--src/game.cpp5
4 files changed, 15 insertions, 22 deletions
diff --git a/ChangeLog b/ChangeLog
index 838ce6df..c9acc4f4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -30,7 +30,9 @@
contain the desert tiles that are twice and three times the height of
a normal tile. One well in new_3-1 has been converted to use the new
double tiles for testing purposes.
- * src/game.cpp, src/engine.cpp: Fixed map switch crashing the client.
+ * src/being.cpp, src/game.cpp, src/engine.cpp: Fixed map switch
+ crashing the client, display of [TARGET] and Alt keys for toggling
+ windows.
2005-10-06 Bjørn Lindeijer <bjorn@lindeijer.nl>
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;