summaryrefslogtreecommitdiffstats
path: root/Tools/QtBiomeVisualiser
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-09-29 21:20:58 +0200
committermadmaxoft <github@xoft.cz>2014-09-29 21:32:02 +0200
commitf424a0ec60afe92b9c0a4d7f56e422cc5e921401 (patch)
tree4a2e61cd84b5b2ed74ec72765b3a0a3b5dd804be /Tools/QtBiomeVisualiser
parentFixed codestyle again. (diff)
downloadcuberite-f424a0ec60afe92b9c0a4d7f56e422cc5e921401.tar
cuberite-f424a0ec60afe92b9c0a4d7f56e422cc5e921401.tar.gz
cuberite-f424a0ec60afe92b9c0a4d7f56e422cc5e921401.tar.bz2
cuberite-f424a0ec60afe92b9c0a4d7f56e422cc5e921401.tar.lz
cuberite-f424a0ec60afe92b9c0a4d7f56e422cc5e921401.tar.xz
cuberite-f424a0ec60afe92b9c0a4d7f56e422cc5e921401.tar.zst
cuberite-f424a0ec60afe92b9c0a4d7f56e422cc5e921401.zip
Diffstat (limited to 'Tools/QtBiomeVisualiser')
-rw-r--r--Tools/QtBiomeVisualiser/ChunkSource.cpp2
-rw-r--r--Tools/QtBiomeVisualiser/GeneratorSetup.cpp15
2 files changed, 8 insertions, 9 deletions
diff --git a/Tools/QtBiomeVisualiser/ChunkSource.cpp b/Tools/QtBiomeVisualiser/ChunkSource.cpp
index bebf89a0a..2d180f00f 100644
--- a/Tools/QtBiomeVisualiser/ChunkSource.cpp
+++ b/Tools/QtBiomeVisualiser/ChunkSource.cpp
@@ -171,7 +171,7 @@ void BioGenSource::getChunkBiomes(int a_ChunkX, int a_ChunkZ, ChunkPtr a_DestChu
void BioGenSource::reload()
{
- int seed = m_IniFile->GetValueSetI("Generator", "Seed", 0);
+ int seed = m_IniFile->GetValueSetI("Seed", "Seed", 0);
bool unused = false;
QMutexLocker lock(&m_Mtx);
m_BiomeGen.reset(cBiomeGen::CreateBiomeGen(*m_IniFile, seed, unused));
diff --git a/Tools/QtBiomeVisualiser/GeneratorSetup.cpp b/Tools/QtBiomeVisualiser/GeneratorSetup.cpp
index f5412404c..d6348ee00 100644
--- a/Tools/QtBiomeVisualiser/GeneratorSetup.cpp
+++ b/Tools/QtBiomeVisualiser/GeneratorSetup.cpp
@@ -31,6 +31,7 @@ GeneratorSetup::GeneratorSetup(const AString & a_IniFileName, QWidget * a_Parent
m_eSeed = new QLineEdit();
m_eSeed->setValidator(new QIntValidator());
m_eSeed->setText("0");
+ m_eSeed->setProperty("INI.SectionName", QVariant("Seed"));
m_eSeed->setProperty("INI.ItemName", QVariant("Seed"));
m_cbGenerator = new QComboBox();
m_cbGenerator->setMinimumWidth(120);
@@ -53,12 +54,7 @@ GeneratorSetup::GeneratorSetup(const AString & a_IniFileName, QWidget * a_Parent
setLayout(m_MainLayout);
// Load the INI file, if specified, otherwise set defaults:
- if (!a_IniFileName.empty() && m_IniFile->ReadFile(a_IniFileName))
- {
- m_cbGenerator->setCurrentText(QString::fromStdString(m_IniFile->GetValue("Generator", "BiomeGen")));
- m_eSeed->setText(QString::number(m_IniFile->GetValueI("Generator", "Seed")));
- }
- else
+ if (a_IniFileName.empty() || !m_IniFile->ReadFile(a_IniFileName))
{
m_IniFile->SetValue("Generator", "Generator", "Composable");
m_IniFile->SetValue("Generator", "BiomeGen", m_cbGenerator->currentText().toStdString());
@@ -110,8 +106,9 @@ void GeneratorSetup::generatorChanged(const QString & a_NewName)
void GeneratorSetup::editChanged(const QString & a_NewValue)
{
- QString itemName = sender()->property("INI.ItemName").toString();
- m_IniFile->SetValue("Generator", itemName.toStdString(), a_NewValue.toStdString());
+ QString sectionName = sender()->property("INI.SectionName").toString();
+ QString itemName = sender()->property("INI.ItemName").toString();
+ m_IniFile->SetValue(sectionName.toStdString(), itemName.toStdString(), a_NewValue.toStdString());
emit generatorUpdated();
}
@@ -121,6 +118,7 @@ void GeneratorSetup::editChanged(const QString & a_NewValue)
void GeneratorSetup::updateFromIni()
{
+ m_eSeed->setText(QString::number(m_IniFile->GetValueI("Seed", "Seed", 0)));
int keyID = m_IniFile->FindKey("Generator");
if (keyID <= -1)
{
@@ -141,6 +139,7 @@ void GeneratorSetup::updateFromIni()
QLineEdit * edit = new QLineEdit();
edit->setText(QString::fromStdString(itemValue));
+ edit->setProperty("INI.SectionName", QVariant("Generator"));
edit->setProperty("INI.ItemName", QVariant(QString::fromStdString(itemName)));
// Remove the generator name prefix from the item name, for clarity purposes: