Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
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")) {