diff options
author | Mattes D <github@xoft.cz> | 2014-10-03 19:41:42 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-10-03 19:41:42 +0200 |
commit | 0aa1b5667e0ba97101f60343323c595cc7866c6d (patch) | |
tree | 5d39793f4b9e6662a7e53f8cdb4c375bdc7f23ff /Tools/QtBiomeVisualiser/MainWindow.cpp | |
parent | QtBiomeVisualiser: Zoom is now limited and aligned to steps. (diff) | |
download | cuberite-0aa1b5667e0ba97101f60343323c595cc7866c6d.tar cuberite-0aa1b5667e0ba97101f60343323c595cc7866c6d.tar.gz cuberite-0aa1b5667e0ba97101f60343323c595cc7866c6d.tar.bz2 cuberite-0aa1b5667e0ba97101f60343323c595cc7866c6d.tar.lz cuberite-0aa1b5667e0ba97101f60343323c595cc7866c6d.tar.xz cuberite-0aa1b5667e0ba97101f60343323c595cc7866c6d.tar.zst cuberite-0aa1b5667e0ba97101f60343323c595cc7866c6d.zip |
Diffstat (limited to '')
-rw-r--r-- | Tools/QtBiomeVisualiser/MainWindow.cpp | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/Tools/QtBiomeVisualiser/MainWindow.cpp b/Tools/QtBiomeVisualiser/MainWindow.cpp index 25a88d442..63d72f992 100644 --- a/Tools/QtBiomeVisualiser/MainWindow.cpp +++ b/Tools/QtBiomeVisualiser/MainWindow.cpp @@ -7,6 +7,7 @@ #include <QFileDialog> #include <QSettings> #include <QDirIterator> +#include <QStatusBar> #include "inifile/iniFile.h" #include "ChunkSource.h" #include "src/Generating/BioGen.h" @@ -40,6 +41,15 @@ MainWindow::MainWindow(QWidget * parent) : connect(m_BiomeView, SIGNAL(wheelUp()), this, SLOT(increaseZoom())); connect(m_BiomeView, SIGNAL(wheelDown()), this, SLOT(decreaseZoom())); + m_StatusBar = new QStatusBar(); + this->setStatusBar(m_StatusBar); + m_StatusBlockX = new QLabel(tr("X")); + m_StatusBlockZ = new QLabel(tr("Z")); + m_StatusBiome = new QLabel(tr("B")); + m_StatusBar->addPermanentWidget(m_StatusBlockX); + m_StatusBar->addPermanentWidget(m_StatusBlockZ); + m_StatusBar->addPermanentWidget(m_StatusBiome); + m_MainLayout = new QHBoxLayout(); m_MainLayout->addWidget(m_BiomeView, 1); m_MainLayout->setMenuBar(menuBar()); @@ -50,6 +60,8 @@ MainWindow::MainWindow(QWidget * parent) : createActions(); createMenus(); + + connect(m_BiomeView, SIGNAL(hoverChanged(int, int, int)), this, SLOT(hoverChanged(int, int, int))); } @@ -205,6 +217,17 @@ void MainWindow::decreaseZoom() +void MainWindow::hoverChanged(int a_BlockX, int a_BlockZ, int a_Biome) +{ + m_StatusBlockX->setText(tr("X: %1").arg(a_BlockX)); + m_StatusBlockZ->setText(tr("Z: %1").arg(a_BlockZ)); + m_StatusBiome->setText (tr("B: %1 (%2)").arg(BiomeToString(a_Biome).c_str()).arg(a_Biome)); +} + + + + + void MainWindow::initMinecraftPath() { #ifdef Q_OS_MAC @@ -322,7 +345,7 @@ void MainWindow::createMenus() file->addAction(m_actNewGen); file->addAction(m_actOpenGen); file->addSeparator(); - QMenu * worlds = file->addMenu(tr("Open existing")); + QMenu * worlds = file->addMenu(tr("Open &existing")); worlds->addActions(m_WorldActions); if (m_WorldActions.empty()) { |