Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2012-02-19 16:11:07 +0000
committerStijn Buys <ingar@osirion.org>2012-02-19 16:11:07 +0000
commit85500fcb7a8aae73da87af337e2984cc91425eb8 (patch)
treef8cc7ca6dacd72fa72cf0ba6a6d8cc1054706965 /src/editorwindow.cc
parent7a9c504720e494ee07d16a6234b77c500af4da93 (diff)
Added subsections textbox
Diffstat (limited to 'src/editorwindow.cc')
-rw-r--r--src/editorwindow.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/editorwindow.cc b/src/editorwindow.cc
index ec7ebe2..1ced0c0 100644
--- a/src/editorwindow.cc
+++ b/src/editorwindow.cc
@@ -55,6 +55,7 @@ bool EditorWindow::loadFile(const QString &filename)
EntityWidget *entity = 0;
bool in_entity = false;
+ bool in_subsection = false;
float x, y, z;
float f;
QString str;
@@ -64,6 +65,7 @@ bool EditorWindow::loadFile(const QString &filename)
if (ini.got_section()) {
//qDebug() << "got section" << ini.section();
+ in_subsection = false;
if (ini.got_section("zone")) {
in_entity = false;
@@ -89,6 +91,14 @@ bool EditorWindow::loadFile(const QString &filename)
} else if (ini.got_section("planet")) {
in_entity = true;
+ } else if (ini.got_section("cargo")) {
+ in_entity = false;
+ in_subsection = true;
+
+ } else if (ini.got_section("ship")) {
+ in_entity = false;
+ in_subsection = true;
+
} else {
entity = 0;
in_entity = false;
@@ -97,6 +107,9 @@ bool EditorWindow::loadFile(const QString &filename)
if (in_entity) {
entity = editorwindow_mapwidget->addEntity();
}
+ if (entity && in_subsection) {
+ entity->add_subsection(ini.section());
+ }
} else if(ini.got_key()) {
@@ -119,6 +132,9 @@ bool EditorWindow::loadFile(const QString &filename)
} else if (ini.got_key()) {
entity->add_property(ini.key(), ini.value());
}
+
+ } else if (entity && in_subsection) {
+ entity->add_subsection_property(ini.key(), ini.value());
} else if (ini.in_section("zone")) {