diff options
author | Stijn Buys <ingar@osirion.org> | 2012-02-26 11:52:25 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2012-02-26 11:52:25 +0000 |
commit | edaf63323dfb5cff1aa2187bf1e1244c88ed0cae (patch) | |
tree | dfa6b43a5977f9dd95b2b29ccdc5d3fe5dadcdb0 | |
parent | 0921b67bca379566478979e61207efbf179ee055 (diff) |
Mapped edit entity actions to MapWidget,
added initial addEntity action.
-rw-r--r-- | src/editorwindow.cc | 15 | ||||
-rw-r--r-- | src/editorwindow.h | 16 | ||||
-rw-r--r-- | src/mainwindow.cc | 4 | ||||
-rw-r--r-- | src/mapwidget.cc | 10 | ||||
-rw-r--r-- | src/mapwidget.h | 11 |
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 |