diff options
author | Howaner <franzi.moos@googlemail.com> | 2014-09-19 14:31:18 +0200 |
---|---|---|
committer | Howaner <franzi.moos@googlemail.com> | 2014-09-19 14:31:18 +0200 |
commit | 4398156b2e56ccfcb41f750906501ecf446be045 (patch) | |
tree | dc1c070c6c7490619d8b05e30ace2c959f085bb2 /Tools/QtBiomeVisualiser/MainWindow.cpp | |
parent | Derp (diff) | |
parent | QtBiomeVisualiser: More gcc fixes. (diff) | |
download | cuberite-4398156b2e56ccfcb41f750906501ecf446be045.tar cuberite-4398156b2e56ccfcb41f750906501ecf446be045.tar.gz cuberite-4398156b2e56ccfcb41f750906501ecf446be045.tar.bz2 cuberite-4398156b2e56ccfcb41f750906501ecf446be045.tar.lz cuberite-4398156b2e56ccfcb41f750906501ecf446be045.tar.xz cuberite-4398156b2e56ccfcb41f750906501ecf446be045.tar.zst cuberite-4398156b2e56ccfcb41f750906501ecf446be045.zip |
Diffstat (limited to '')
-rw-r--r-- | Tools/QtBiomeVisualiser/MainWindow.cpp | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/Tools/QtBiomeVisualiser/MainWindow.cpp b/Tools/QtBiomeVisualiser/MainWindow.cpp index 8b98c0b0e..65d0ccf5e 100644 --- a/Tools/QtBiomeVisualiser/MainWindow.cpp +++ b/Tools/QtBiomeVisualiser/MainWindow.cpp @@ -16,11 +16,11 @@ MainWindow::MainWindow(QWidget * parent) : QMainWindow(parent) { - createActions(); - createMenus(); - m_BiomeView = new BiomeView(this); setCentralWidget(m_BiomeView); + + createActions(); + createMenus(); } @@ -39,19 +39,7 @@ MainWindow::~MainWindow() void MainWindow::generate() { QString worldIni = QFileDialog::getOpenFileName(this, tr("Open world.ini"), QString(), tr("world.ini (world.ini)")); - cIniFile ini; - if (!ini.ReadFile(worldIni.toStdString())) - { - return; - } - int seed = ini.GetValueSetI("Seed", "Seed", 0); - bool unused = false; - cBiomeGen * biomeGen = cBiomeGen::CreateBiomeGen(ini, seed, unused); - if (biomeGen == nullptr) - { - return; - } - m_BiomeView->setChunkSource(std::shared_ptr<BioGenSource>(new BioGenSource(biomeGen))); + m_BiomeView->setChunkSource(std::shared_ptr<BioGenSource>(new BioGenSource(worldIni))); m_BiomeView->redraw(); } @@ -80,6 +68,11 @@ void MainWindow::createActions() m_actOpen->setStatusTip(tr("Open an existing world and display its biomes")); connect(m_actOpen, SIGNAL(triggered()), this, SLOT(open())); + m_actReload = new QAction(tr("&Reload"), this); + m_actReload->setShortcut(tr("F5")); + m_actReload->setStatusTip(tr("Open an existing world and display its biomes")); + connect(m_actReload, SIGNAL(triggered()), m_BiomeView, SLOT(reload())); + m_actExit = new QAction(tr("E&xit"), this); m_actExit->setShortcut(tr("Alt+X")); m_actExit->setStatusTip(tr("Exit %1").arg(QApplication::instance()->applicationName())); @@ -96,6 +89,8 @@ void MainWindow::createMenus() mFile->addAction(m_actGen); mFile->addAction(m_actOpen); mFile->addSeparator(); + mFile->addAction(m_actReload); + mFile->addSeparator(); mFile->addAction(m_actExit); } |