diff options
Diffstat (limited to 'src/gui/debugwindow.cpp')
-rw-r--r-- | src/gui/debugwindow.cpp | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/src/gui/debugwindow.cpp b/src/gui/debugwindow.cpp index f3dbe5e2..59c0f254 100644 --- a/src/gui/debugwindow.cpp +++ b/src/gui/debugwindow.cpp @@ -21,6 +21,7 @@ #include "gui/debugwindow.h" +#include "gui/setup.h" #include "gui/viewport.h" #include "gui/widgets/label.h" @@ -31,31 +32,33 @@ #include "particle.h" #include "map.h" +#include "utils/gettext.h" #include "utils/stringutils.h" DebugWindow::DebugWindow(): - Window("Debug") + Window(_("Debug")) { setWindowName("Debug"); + setupWindow->registerWindowForReset(this); setResizable(true); setCloseButton(true); setSaveVisible(true); setDefaultSize(400, 100, ImageRect::CENTER); - mFPSLabel = new Label("0 FPS"); - mMusicFileLabel = new Label("Music: "); - mMapLabel = new Label("Map: "); - mMiniMapLabel = new Label("Mini-Map: "); - mTileMouseLabel = new Label("Mouse: 0, 0"); - mParticleCountLabel = new Label("Particle count: 0"); + mFPSLabel = new Label(strprintf(_("%d FPS"), 0)); + mMusicFileLabel = new Label(strprintf(_("Music: %s"), "")); + mMapLabel = new Label(strprintf(_("Map: %s"), "")); + mMinimapLabel = new Label(strprintf(_("Minimap: %s"), "")); + mTileMouseLabel = new Label(strprintf(_("Tile: (%d, %d)"), 0, 0)); + mParticleCountLabel = new Label(strprintf(_("Particle count: %d"), 0)); place(0, 0, mFPSLabel, 3); place(3, 0, mTileMouseLabel); place(0, 1, mMusicFileLabel, 3); place(3, 1, mParticleCountLabel); place(0, 2, mMapLabel, 4); - place(0, 3, mMiniMapLabel, 4); + place(0, 3, mMinimapLabel, 4); loadWindowState(); } @@ -69,27 +72,28 @@ void DebugWindow::logic() int mouseTileX = (viewport->getMouseX() + viewport->getCameraX()) / 32; int mouseTileY = (viewport->getMouseY() + viewport->getCameraY()) / 32; - mFPSLabel->setCaption(toString(fps) + " FPS"); + mFPSLabel->setCaption(strprintf(_("%d FPS"), fps)); - mTileMouseLabel->setCaption("Tile: (" + toString(mouseTileX) + ", " + - toString(mouseTileY) + ")"); + mTileMouseLabel->setCaption(strprintf(_("Tile: (%d, %d)"), mouseTileX, + mouseTileY)); Map *currentMap = engine->getCurrentMap(); if (currentMap) { + // TODO: Add gettext support below const std::string music = "Music: " + currentMap->getProperty("music"); mMusicFileLabel->setCaption(music); const std::string minimap = - "MiniMap: " + currentMap->getProperty("minimap"); - mMiniMapLabel->setCaption(minimap); + "Minimap: " + currentMap->getProperty("minimap"); + mMinimapLabel->setCaption(minimap); const std::string map = "Map: " + currentMap->getProperty("_filename"); mMapLabel->setCaption(map); } - mParticleCountLabel->setCaption("Particle count: " + - toString(Particle::particleCount)); + mParticleCountLabel->setCaption(strprintf(_("Particle count: %d"), + Particle::particleCount)); } |