From 14123c6d1653b79b6c58e7766dc97e5d06bf1fc9 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sat, 20 Sep 2014 23:03:13 +0200 Subject: QtBiomeVisualiser: Added list of vanilla worlds. --- Tools/QtBiomeVisualiser/MainWindow.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'Tools/QtBiomeVisualiser/MainWindow.h') diff --git a/Tools/QtBiomeVisualiser/MainWindow.h b/Tools/QtBiomeVisualiser/MainWindow.h index b37bf4120..997d7a5d2 100644 --- a/Tools/QtBiomeVisualiser/MainWindow.h +++ b/Tools/QtBiomeVisualiser/MainWindow.h @@ -1,5 +1,6 @@ #pragma once +#include #include #include "BiomeView.h" @@ -25,6 +26,9 @@ private slots: /** Opens an existing world and displays the loaded biomes. */ void open(); + /** Opens a vanilla world that is specified by the calling action. */ + void openVanillaWorld(); + protected: // Actions: QAction * m_actGen; @@ -32,12 +36,28 @@ protected: QAction * m_actReload; QAction * m_actExit; + /** List of actions that open the specific vanilla world. */ + QList m_WorldActions; + + /** Path to the vanilla folder. */ + QString m_MinecraftPath; + + + /** Initializes the m_MinecraftPath based on the proper MC path */ + void initMinecraftPath(); /** Creates the actions that the UI supports. */ void createActions(); + /** Creates the actions that open a specific vanilla world. Iterates over the minecraft saves folder. */ + void createWorldActions(); + /** Creates the menu bar and connects its events. */ void createMenus(); + + /** Returns the name of the vanilla world in the specified path. + Reads the level.dat file for the name. Returns an empty string on failure. */ + QString getWorldName(const AString & a_Path); }; -- cgit v1.2.3 From dda66ea6efaa1ae3305dae97a9ab9bdb4254cf46 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sun, 21 Sep 2014 22:58:09 +0200 Subject: QtBiomeVisualiser: Added the base for INI editting. --- Tools/QtBiomeVisualiser/MainWindow.h | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'Tools/QtBiomeVisualiser/MainWindow.h') diff --git a/Tools/QtBiomeVisualiser/MainWindow.h b/Tools/QtBiomeVisualiser/MainWindow.h index 997d7a5d2..840e01b0f 100644 --- a/Tools/QtBiomeVisualiser/MainWindow.h +++ b/Tools/QtBiomeVisualiser/MainWindow.h @@ -1,5 +1,6 @@ #pragma once +#include #include #include #include "BiomeView.h" @@ -8,6 +9,13 @@ +// fwd: +class GeneratorSetupDlg; + + + + + class MainWindow : public QMainWindow { @@ -16,23 +24,27 @@ class MainWindow : BiomeView * m_BiomeView; public: - MainWindow(QWidget *parent = 0); + MainWindow(QWidget * parent = nullptr); ~MainWindow(); private slots: + /** Creates a generator definition from scratch, lets user modify generator params in realtime. */ + void newGenerator(); + /** Opens a generator definition and generates the biomes based on that. */ - void generate(); + void openGenerator(); /** Opens an existing world and displays the loaded biomes. */ - void open(); + void openWorld(); /** Opens a vanilla world that is specified by the calling action. */ void openVanillaWorld(); protected: // Actions: - QAction * m_actGen; - QAction * m_actOpen; + QAction * m_actNewGen; + QAction * m_actOpenGen; + QAction * m_actOpenWorld; QAction * m_actReload; QAction * m_actExit; @@ -42,6 +54,9 @@ protected: /** Path to the vanilla folder. */ QString m_MinecraftPath; + /** The dialog for setting up the generator. */ + std::unique_ptr m_GeneratorSetupDlg; + /** Initializes the m_MinecraftPath based on the proper MC path */ void initMinecraftPath(); -- cgit v1.2.3 From 10c5d5056691f0a03798c7e9439138126da30b8a Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Mon, 22 Sep 2014 18:26:35 +0200 Subject: QtBiomeVisualiser: Moved the generator setup into a side-pane. --- Tools/QtBiomeVisualiser/MainWindow.h | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'Tools/QtBiomeVisualiser/MainWindow.h') diff --git a/Tools/QtBiomeVisualiser/MainWindow.h b/Tools/QtBiomeVisualiser/MainWindow.h index 840e01b0f..6490a937f 100644 --- a/Tools/QtBiomeVisualiser/MainWindow.h +++ b/Tools/QtBiomeVisualiser/MainWindow.h @@ -3,6 +3,7 @@ #include #include #include +#include #include "BiomeView.h" @@ -10,7 +11,7 @@ // fwd: -class GeneratorSetupDlg; +class GeneratorSetup; @@ -21,8 +22,6 @@ class MainWindow : { Q_OBJECT - BiomeView * m_BiomeView; - public: MainWindow(QWidget * parent = nullptr); ~MainWindow(); @@ -54,8 +53,17 @@ protected: /** Path to the vanilla folder. */ QString m_MinecraftPath; - /** The dialog for setting up the generator. */ - std::unique_ptr m_GeneratorSetupDlg; + /** The pane for setting up the generator, available when visualising a generator. */ + GeneratorSetup * m_GeneratorSetup; + + /** The main biome display widget. */ + BiomeView * m_BiomeView; + + /** The layout for the window. */ + QHBoxLayout * m_MainLayout; + + /** The separator line between biome view and generator setup. */ + QWidget * m_LineSeparator; /** Initializes the m_MinecraftPath based on the proper MC path */ @@ -73,6 +81,12 @@ protected: /** Returns the name of the vanilla world in the specified path. Reads the level.dat file for the name. Returns an empty string on failure. */ QString getWorldName(const AString & a_Path); + + /** Opens the generator setup pane, if not already open, and loads the specified INI file to it. */ + void openGeneratorSetup(const AString & a_IniFileName); + + /** Closes and destroys the generator setup pane, if there is one. */ + void closeGeneratorSetup(); }; -- cgit v1.2.3