Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/editorwindow.cc15
-rw-r--r--src/editorwindow.h16
-rw-r--r--src/mainwindow.cc4
-rw-r--r--src/mapwidget.cc10
-rw-r--r--src/mapwidget.h11
5 files changed, 55 insertions, 1 deletions
diff --git a/src/editorwindow.cc b/src/editorwindow.cc
index 2423cff..c0f5e41 100644
--- a/src/editorwindow.cc
+++ b/src/editorwindow.cc
@@ -242,5 +242,20 @@ bool EditorWindow::saveFile(const QString &filename)
}
+void EditorWindow::addEntity()
+{
+ EntityWidget *entitywidget = editorwindow_mapwidget->addEntity();
+ entitywidget->properties()->set_type("entity");
+}
+
+void EditorWindow::duplicateSelected()
+{
+ editorwindow_mapwidget->duplicateSelected();
+}
+
+void EditorWindow::deleteSelected()
+{
+ editorwindow_mapwidget->duplicateSelected();
+}
}
diff --git a/src/editorwindow.h b/src/editorwindow.h
index 89dcae4..12aec59 100644
--- a/src/editorwindow.h
+++ b/src/editorwindow.h
@@ -43,6 +43,22 @@ public slots:
bool loadFile(const QString &filename);
bool saveFile(const QString &filename);
+
+ /**
+ * @brief add a new entity to the map
+ * */
+ void addEntity();
+
+ /**
+ * @brief delete selected entities
+ * */
+ void deleteSelected();
+
+ /**
+ * @brief duplicate selected entities
+ * */
+ void duplicateSelected();
+
protected:
virtual void resizeEvent (QResizeEvent *event);
diff --git a/src/mainwindow.cc b/src/mainwindow.cc
index 6985506..18f9630 100644
--- a/src/mainwindow.cc
+++ b/src/mainwindow.cc
@@ -207,7 +207,9 @@ void MainWindow::slot_save()
void MainWindow::slot_add()
{
- qDebug() << "slot_add";
+ if (active_child()) {
+ active_child()->addEntity();
+ }
}
void MainWindow::slot_delete()
diff --git a/src/mapwidget.cc b/src/mapwidget.cc
index fe84ada..44ed785 100644
--- a/src/mapwidget.cc
+++ b/src/mapwidget.cc
@@ -280,4 +280,14 @@ void MapWidget::save(QTextStream &textstream)
}
}
+void MapWidget::duplicateSelected()
+{
+
+}
+
+void MapWidget::deleteSelected()
+{
+
+}
+
}
diff --git a/src/mapwidget.h b/src/mapwidget.h
index a7dbb66..087fd3d 100644
--- a/src/mapwidget.h
+++ b/src/mapwidget.h
@@ -86,6 +86,17 @@ public slots:
* */
void resizeChildren();
+ /**
+ * @brief delete selected entities
+ * */
+ void deleteSelected();
+
+ /**
+ * @brief duplicate selected entities
+ * */
+ void duplicateSelected();
+
+
private slots:
/**
* @brief called when an entity on the map has been clicked