diff options
author | Blue Sans Douze <bluesansdouze@gmail.com> | 2010-01-23 17:31:21 +0100 |
---|---|---|
committer | Blue Sans Douze <bluesansdouze@gmail.com> | 2010-01-23 18:37:30 +0100 |
commit | 943166059f5e0b7403b00f5d5fc19bd72c706657 (patch) | |
tree | 4f05e25d6c4d2c30632938b9bdc29b24e0c46c18 /src/gui/minimap.cpp | |
parent | 7fa3653824e7aacf15aa4fc14f2465addc831851 (diff) | |
download | mana-943166059f5e0b7403b00f5d5fc19bd72c706657.tar.gz mana-943166059f5e0b7403b00f5d5fc19bd72c706657.tar.bz2 mana-943166059f5e0b7403b00f5d5fc19bd72c706657.tar.xz mana-943166059f5e0b7403b00f5d5fc19bd72c706657.zip |
Autoload a minimap is no minimap info is given
Looks for "graphics/minimap/MAPID.png"
Diffstat (limited to 'src/gui/minimap.cpp')
-rw-r--r-- | src/gui/minimap.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gui/minimap.cpp b/src/gui/minimap.cpp index b8f8ef57..539bfbaa 100644 --- a/src/gui/minimap.cpp +++ b/src/gui/minimap.cpp @@ -78,6 +78,7 @@ void Minimap::setMap(Map *map) { // Set the title for the Minimap std::string caption = ""; + std::string minimapName; if (map) caption = map->getName(); @@ -96,8 +97,16 @@ void Minimap::setMap(Map *map) if (map) { + std::string tempname = "graphics/minimaps/"+(*map->getMapId())+".png"; + ResourceManager *resman = ResourceManager::getInstance(); - mMapImage = resman->getImage(map->getProperty("minimap")); + minimapName = map->getProperty("minimap"); + if (minimapName.empty() && resman->exists(tempname)) + { + minimapName = tempname; + } + std::cout << "Minimap name : " << minimapName << std::endl; + mMapImage = resman->getImage(minimapName); } if (mMapImage) |