diff options
author | Philipp Sehmisch <tmw@crushnet.org> | 2008-07-01 14:51:23 +0000 |
---|---|---|
committer | Philipp Sehmisch <tmw@crushnet.org> | 2008-07-01 14:51:23 +0000 |
commit | d3ccf6a0b97ce4189eef4fde606cf5b5f93fac14 (patch) | |
tree | f4c4e5b1cc87b34d0a3946c3409882ba222e2ad7 /src/gui/minimap.cpp | |
parent | 59c17d5f465ddcf1956e8cdf1aae1dbda0a1431f (diff) | |
download | mana-d3ccf6a0b97ce4189eef4fde606cf5b5f93fac14.tar.gz mana-d3ccf6a0b97ce4189eef4fde606cf5b5f93fac14.tar.bz2 mana-d3ccf6a0b97ce4189eef4fde606cf5b5f93fac14.tar.xz mana-d3ccf6a0b97ce4189eef4fde606cf5b5f93fac14.zip |
Ported some GUI improvements from Legend of Mazeroth (GUI skinning via XML files, item descriptions on mouse-over, map names in minimap window, speech bubbles)
Diffstat (limited to 'src/gui/minimap.cpp')
-rw-r--r-- | src/gui/minimap.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/gui/minimap.cpp b/src/gui/minimap.cpp index d205338f..4e5664d6 100644 --- a/src/gui/minimap.cpp +++ b/src/gui/minimap.cpp @@ -36,8 +36,11 @@ Minimap::Minimap(): Window(_("MiniMap")), mMapImage(NULL) { - setDefaultSize(5, 25, 100, 100); + setDefaultSize(0, 0, 100, 100); loadWindowState("MiniMap"); + // LEEOR: The Window class needs to modified to accept + // setAlignment calls. + setAlignment(gcn::Graphics::CENTER); } Minimap::~Minimap() @@ -60,7 +63,14 @@ void Minimap::setMapImage(Image *img) if (mMapImage) { mMapImage->setAlpha(0.7); + setSize( mMapImage->getWidth() + 6, mMapImage->getHeight() + 23 ); + setVisible(true); } + else + { + setVisible(false); + } + } void Minimap::draw(gcn::Graphics *graphics) @@ -69,8 +79,7 @@ void Minimap::draw(gcn::Graphics *graphics) if (mMapImage != NULL) { - static_cast<Graphics*>(graphics)-> - drawImage(mMapImage, getPadding(), getTitleBarHeight()); + static_cast<Graphics*>(graphics)->drawImage(mMapImage, getPadding(), getTitleBarHeight()); } Beings &beings = beingManager->getAll(); @@ -92,6 +101,10 @@ void Minimap::draw(gcn::Graphics *graphics) graphics->setColor(gcn::Color(61, 52, 209)); break; + case Being::NPC: + graphics->setColor(gcn::Color(255, 255, 0)); + break; + case Being::MONSTER: graphics->setColor(gcn::Color(209, 52, 61)); break; |