From 85500fcb7a8aae73da87af337e2984cc91425eb8 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 19 Feb 2012 16:11:07 +0000 Subject: Added subsections textbox --- src/editorwindow.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/editorwindow.cc') 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")) { -- cgit v1.2.3