summaryrefslogtreecommitdiffstats
path: root/Tools/QtBiomeVisualiser/MainWindow.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-09-20 18:41:21 +0200
committermadmaxoft <github@xoft.cz>2014-09-20 18:41:21 +0200
commit66ef05c765a7e66ec3d77cd1a1eaff4f03b28688 (patch)
tree649c0af43fd98a0afff66c95770a1cbb1a3890b6 /Tools/QtBiomeVisualiser/MainWindow.cpp
parentFixed typos in items.ini. (diff)
downloadcuberite-66ef05c765a7e66ec3d77cd1a1eaff4f03b28688.tar
cuberite-66ef05c765a7e66ec3d77cd1a1eaff4f03b28688.tar.gz
cuberite-66ef05c765a7e66ec3d77cd1a1eaff4f03b28688.tar.bz2
cuberite-66ef05c765a7e66ec3d77cd1a1eaff4f03b28688.tar.lz
cuberite-66ef05c765a7e66ec3d77cd1a1eaff4f03b28688.tar.xz
cuberite-66ef05c765a7e66ec3d77cd1a1eaff4f03b28688.tar.zst
cuberite-66ef05c765a7e66ec3d77cd1a1eaff4f03b28688.zip
Diffstat (limited to 'Tools/QtBiomeVisualiser/MainWindow.cpp')
-rw-r--r--Tools/QtBiomeVisualiser/MainWindow.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/Tools/QtBiomeVisualiser/MainWindow.cpp b/Tools/QtBiomeVisualiser/MainWindow.cpp
index 65d0ccf5e..b6db806f9 100644
--- a/Tools/QtBiomeVisualiser/MainWindow.cpp
+++ b/Tools/QtBiomeVisualiser/MainWindow.cpp
@@ -39,6 +39,10 @@ MainWindow::~MainWindow()
void MainWindow::generate()
{
QString worldIni = QFileDialog::getOpenFileName(this, tr("Open world.ini"), QString(), tr("world.ini (world.ini)"));
+ if (worldIni.isEmpty())
+ {
+ return;
+ }
m_BiomeView->setChunkSource(std::shared_ptr<BioGenSource>(new BioGenSource(worldIni)));
m_BiomeView->redraw();
}
@@ -49,7 +53,13 @@ void MainWindow::generate()
void MainWindow::open()
{
- // TODO
+ QString regionFolder = QFileDialog::getExistingDirectory(this, tr("Select the region folder"), QString());
+ if (regionFolder.isEmpty())
+ {
+ return;
+ }
+ m_BiomeView->setChunkSource(std::shared_ptr<AnvilSource>(new AnvilSource(regionFolder)));
+ m_BiomeView->redraw();
}