summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhilipp Sehmisch <crush@themanaworld.org>2009-01-18 14:34:53 +0100
committerPhilipp Sehmisch <crush@themanaworld.org>2009-01-18 14:34:53 +0100
commit2a7c63f6070606e6623a9730aa1ca9d52c942055 (patch)
tree1dc1e47ffcbaa8f217352159f7e4b65105826942 /src
parent833b4ee6b06a0d23781153ad117d638fa9cc9ace (diff)
downloadmana-2a7c63f6070606e6623a9730aa1ca9d52c942055.tar.gz
mana-2a7c63f6070606e6623a9730aa1ca9d52c942055.tar.bz2
mana-2a7c63f6070606e6623a9730aa1ca9d52c942055.tar.xz
mana-2a7c63f6070606e6623a9730aa1ca9d52c942055.zip
Added current map filename to debug window.
Diffstat (limited to 'src')
-rw-r--r--src/gui/debugwindow.cpp35
-rw-r--r--src/gui/debugwindow.h2
-rw-r--r--src/resources/mapreader.cpp2
3 files changed, 25 insertions, 14 deletions
diff --git a/src/gui/debugwindow.cpp b/src/gui/debugwindow.cpp
index 36e4c8e1..ab09ec4e 100644
--- a/src/gui/debugwindow.cpp
+++ b/src/gui/debugwindow.cpp
@@ -42,27 +42,31 @@ DebugWindow::DebugWindow():
setWindowName("Debug");
setResizable(true);
setCloseButton(true);
- setDefaultSize(0, 0, 400, 100);
+ setDefaultSize(0, 0, 400, 60);
loadWindowState();
mFPSLabel = new gcn::Label("[0 FPS]");
mFPSLabel->setPosition(0,0);
- mMusicFileLabel = new gcn::Label("Music File: ");
- mMusicFileLabel->setPosition(0, 20);
+ mMusicFileLabel = new gcn::Label("Music: ");
+ mMusicFileLabel->setPosition(0, 15);
- mMapFileLabel = new gcn::Label("Mini-Map File: ");
- mMapFileLabel->setPosition(0, 40);
+ mMapLabel = new gcn::Label("Map: ");
+ mMapLabel->setPosition(0, 30);
+
+ mMiniMapLabel = new gcn::Label("Mini-Map: ");
+ mMiniMapLabel->setPosition(0, 45);
mTileMouseLabel = new gcn::Label("[Mouse: 0, 0]");
- mTileMouseLabel->setPosition(100, 0);
+ mTileMouseLabel->setPosition(200, 0);
mParticleCountLabel = new gcn::Label("[Particle count: 0]");
- mParticleCountLabel->setPosition(100, 60);
+ mParticleCountLabel->setPosition(200, 15);
add(mFPSLabel);
add(mMusicFileLabel);
- add(mMapFileLabel);
+ add(mMiniMapLabel);
+ add(mMapLabel);
add(mTileMouseLabel);
add(mParticleCountLabel);
}
@@ -76,7 +80,7 @@ DebugWindow::logic()
int mouseTileX = mouseX + viewport->getCameraX();
int mouseTileY = mouseY + viewport->getCameraY();
- mFPSLabel->setCaption("[" + toString(fps) + " FPS");
+ mFPSLabel->setCaption("[" + toString(fps) + " FPS]");
mFPSLabel->adjustSize();
mTileMouseLabel->setCaption("[Mouse: " +
@@ -87,14 +91,19 @@ DebugWindow::logic()
if (currentMap != NULL)
{
const std::string music =
- " [Music File: " + currentMap->getProperty("music") + "]";
+ " [Music: " + currentMap->getProperty("music") + "]";
mMusicFileLabel->setCaption(music);
mMusicFileLabel->adjustSize();
const std::string minimap =
- " [MiniMap File: " + currentMap->getProperty("minimap") + "]";
- mMapFileLabel->setCaption(minimap);
- mMapFileLabel->adjustSize();
+ " [MiniMap: " + currentMap->getProperty("minimap") + "]";
+ mMiniMapLabel->setCaption(minimap);
+ mMiniMapLabel->adjustSize();
+
+ const std::string map =
+ " [Map: " + currentMap->getProperty("_filename") + "]";
+ mMapLabel->setCaption(map);
+ mMapLabel->adjustSize();
}
mParticleCountLabel->setCaption("[Particle count: " +
diff --git a/src/gui/debugwindow.h b/src/gui/debugwindow.h
index ae1d8b14..8d8b7822 100644
--- a/src/gui/debugwindow.h
+++ b/src/gui/debugwindow.h
@@ -49,7 +49,7 @@ class DebugWindow : public Window
void logic();
private:
- gcn::Label *mMusicFileLabel, *mMapFileLabel;
+ gcn::Label *mMusicFileLabel, *mMapLabel, *mMiniMapLabel;
gcn::Label *mTileMouseLabel, *mFPSLabel;
gcn::Label *mParticleCountLabel;
};
diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp
index 949d7913..b812b2ce 100644
--- a/src/resources/mapreader.cpp
+++ b/src/resources/mapreader.cpp
@@ -195,6 +195,8 @@ Map *MapReader::readMap(const std::string &filename)
logger->log("Error while parsing map file (%s)!", filename.c_str());
}
+ if (map) map->setProperty("_filename", filename);
+
return map;
}