Added room objects to store placed objects in rooms
This commit is contained in:
1 parent
e5406ed0ce
commit
0cbde44138
6 files changed
+148
-36
No files matched your search
@@ -19,6 +19,7 @@ RoomPropertiesDialog::RoomPropertiesDialog(Room &room, ProjectTreeModel &project
|
||||
m_ui{std::make_unique<Ui::RoomPropertiesDialog>()},
|
||||
m_room{room},
|
||||
m_projectModel{projectModel},
|
||||
m_objects{m_room.objects},
|
||||
m_scene{std::make_unique<RoomScene>(this)},
|
||||
m_creationCode{m_room.creationCode},
|
||||
m_spinBoxSnapX{new QSpinBox{this}},
|
||||
@@ -31,6 +32,7 @@ RoomPropertiesDialog::RoomPropertiesDialog(Room &room, ProjectTreeModel &project
|
||||
|
||||
updateTitle();
|
||||
|
||||
m_ui->roomEditWidget->setObjects(&m_objects);
|
||||
m_ui->roomEditWidget->setFixedWidth(m_room.width);
|
||||
m_ui->roomEditWidget->setFixedHeight(m_room.height);
|
||||
m_ui->roomEditWidget->setSnapX(m_room.snapX);
|
||||
@@ -181,6 +183,8 @@ RoomPropertiesDialog::RoomPropertiesDialog(Room &room, ProjectTreeModel &project
|
||||
m_ui->actionIsometricGrid, &QAction::setChecked);
|
||||
connect(m_ui->roomEditWidget, &RoomEditWidget::cursorMoved,
|
||||
this, &RoomPropertiesDialog::cursorMoved);
|
||||
connect(m_ui->roomEditWidget, &RoomEditWidget::changed,
|
||||
this, &RoomPropertiesDialog::changed);
|
||||
|
||||
connect(m_menuObjects, &QMenu::aboutToShow,
|
||||
this, &RoomPropertiesDialog::objectsMenuAboutToShow);
|
||||
@@ -219,6 +223,8 @@ void RoomPropertiesDialog::accept()
|
||||
m_room.gridEnabled = m_ui->actionGridEnabled->isChecked();
|
||||
m_room.isometricGrid = m_ui->actionIsometricGrid->isChecked();
|
||||
|
||||
m_room.objects = m_objects;
|
||||
|
||||
QDialog::accept();
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "projectcontainer.h"
|
||||
|
||||
class QSpinBox;
|
||||
class QLabel;
|
||||
class QMenu;
|
||||
@@ -56,6 +58,8 @@ private:
|
||||
Room &m_room;
|
||||
ProjectTreeModel &m_projectModel;
|
||||
|
||||
std::vector<Room::Object> m_objects;
|
||||
|
||||
const std::unique_ptr<RoomScene> m_scene;
|
||||
|
||||
QString m_creationCode;
|
||||
|
||||
Reference in new issue
Block a user