From d3ccf6a0b97ce4189eef4fde606cf5b5f93fac14 Mon Sep 17 00:00:00 2001 From: Philipp Sehmisch Date: Tue, 1 Jul 2008 14:51:23 +0000 Subject: 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) --- src/gui/minimap.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'src/gui/minimap.cpp') 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)-> - drawImage(mMapImage, getPadding(), getTitleBarHeight()); + static_cast(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; -- cgit v1.2.3-70-g09d2