summaryrefslogtreecommitdiffstats
path: root/Tools/QtBiomeVisualiser/GeneratorSetup.h
diff options
context:
space:
mode:
authorMasy98 <masy@antheruscraft.de>2014-09-26 18:32:31 +0200
committerMasy98 <masy@antheruscraft.de>2014-09-26 18:32:31 +0200
commit2feee3b316bf5cad87f9b9540c6b49f1775ada6e (patch)
tree7e508a2cc3d2c8586327e8074337da537cbbad5f /Tools/QtBiomeVisualiser/GeneratorSetup.h
parentAdded slime block to slime balls recipe (diff)
parentFixed issue with casting (diff)
downloadcuberite-2feee3b316bf5cad87f9b9540c6b49f1775ada6e.tar
cuberite-2feee3b316bf5cad87f9b9540c6b49f1775ada6e.tar.gz
cuberite-2feee3b316bf5cad87f9b9540c6b49f1775ada6e.tar.bz2
cuberite-2feee3b316bf5cad87f9b9540c6b49f1775ada6e.tar.lz
cuberite-2feee3b316bf5cad87f9b9540c6b49f1775ada6e.tar.xz
cuberite-2feee3b316bf5cad87f9b9540c6b49f1775ada6e.tar.zst
cuberite-2feee3b316bf5cad87f9b9540c6b49f1775ada6e.zip
Diffstat (limited to 'Tools/QtBiomeVisualiser/GeneratorSetup.h')
-rw-r--r--Tools/QtBiomeVisualiser/GeneratorSetup.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/Tools/QtBiomeVisualiser/GeneratorSetup.h b/Tools/QtBiomeVisualiser/GeneratorSetup.h
new file mode 100644
index 000000000..e72d3abbc
--- /dev/null
+++ b/Tools/QtBiomeVisualiser/GeneratorSetup.h
@@ -0,0 +1,64 @@
+#pragma once
+
+#include <memory>
+#include <QDialog>
+#include <QComboBox>
+#include <QVBoxLayout>
+#include <QFormLayout>
+
+
+
+
+
+class cIniFile;
+typedef std::shared_ptr<cIniFile> cIniFilePtr;
+
+
+
+
+
+class GeneratorSetup :
+ public QWidget
+{
+ typedef QWidget super;
+
+ Q_OBJECT
+
+public:
+ /** Creates the widget and loads the contents of the INI file, if not empty. */
+ explicit GeneratorSetup(const std::string & a_IniFileName, QWidget * parent = nullptr);
+
+ /** Returns the cIniFile instance that is being edited by this widget. */
+ cIniFilePtr getIniFile() { return m_IniFile; }
+
+signals:
+ /** Emitted when the generator parameters have changed. */
+ void generatorUpdated();
+
+public slots:
+ /** Called when the user selects a different generator from the top combobox.
+ Re-creates m_IniFile and updates the form layout. */
+ void generatorChanged(const QString & a_NewName);
+
+protected slots:
+ /** Called when any of the edit widgets are changed. */
+ void editChanged(const QString & a_NewValue);
+
+protected:
+ QComboBox * m_cbGenerator;
+ QLineEdit * m_eSeed;
+ QVBoxLayout * m_MainLayout;
+ QFormLayout * m_FormLayout;
+
+ cIniFilePtr m_IniFile;
+
+ int m_Seed;
+
+
+ /** Updates the form layout with the values from m_IniFile. */
+ void updateFromIni();
+};
+
+
+
+