From 2a21ffb8c79db6e07d1591b5a62489ff309e052c Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 Date: Mon, 10 Jan 2022 01:43:41 +0100 Subject: [PATCH] Added functionality to manage time lines, objects and rooms too --- QtGameMaker.pro | 9 + dialogs/backgroundpropertiesdialog.cpp | 2 +- dialogs/fontpropertiesdialog.cpp | 2 +- dialogs/objectpropertiesdialog.cpp | 11 + dialogs/objectpropertiesdialog.h | 21 + dialogs/objectpropertiesdialog.ui | 25 + dialogs/pathpropertiesdialog.cpp | 2 +- dialogs/roompropertiesdialog.cpp | 11 + dialogs/roompropertiesdialog.h | 21 + dialogs/roompropertiesdialog.ui | 25 + dialogs/scriptpropertiesdialog.cpp | 2 +- dialogs/soundpropertiesdialog.cpp | 2 +- dialogs/spritepropertiesdialog.cpp | 2 +- dialogs/timelinepropertiesdialog.cpp | 11 + dialogs/timelinepropertiesdialog.h | 21 + dialogs/timelinepropertiesdialog.ui | 25 + icons/room-file.png | Bin 0 -> 10579 bytes icons/timeline-file.png | Bin 0 -> 12929 bytes mainwindow.cpp | 684 ++++------ mainwindow.h | 34 +- projectcontainer.cpp | 248 ++-- projectcontainer.h | 31 +- projecttreemodel.cpp | 1682 +++++++----------------- projecttreemodel.h | 105 +- resources.qrc | 2 + 25 files changed, 1139 insertions(+), 1839 deletions(-) create mode 100644 dialogs/objectpropertiesdialog.cpp create mode 100644 dialogs/objectpropertiesdialog.h create mode 100644 dialogs/objectpropertiesdialog.ui create mode 100644 dialogs/roompropertiesdialog.cpp create mode 100644 dialogs/roompropertiesdialog.h create mode 100644 dialogs/roompropertiesdialog.ui create mode 100644 dialogs/timelinepropertiesdialog.cpp create mode 100644 dialogs/timelinepropertiesdialog.h create mode 100644 dialogs/timelinepropertiesdialog.ui create mode 100644 icons/room-file.png create mode 100644 icons/timeline-file.png diff --git a/QtGameMaker.pro b/QtGameMaker.pro index 50b5eae..40540fd 100644 --- a/QtGameMaker.pro +++ b/QtGameMaker.pro @@ -11,8 +11,11 @@ HEADERS += \ dialogs/fontpropertiesdialog.h \ dialogs/imageeditordialog.h \ dialogs/objectinformationdialog.h \ + dialogs/objectpropertiesdialog.h \ dialogs/pathpropertiesdialog.h \ + dialogs/roompropertiesdialog.h \ dialogs/scriptpropertiesdialog.h \ + dialogs/timelinepropertiesdialog.h \ futurecpp.h \ jshighlighter.h \ mainwindow.h \ @@ -34,8 +37,11 @@ SOURCES += main.cpp \ dialogs/fontpropertiesdialog.cpp \ dialogs/imageeditordialog.cpp \ dialogs/objectinformationdialog.cpp \ + dialogs/objectpropertiesdialog.cpp \ dialogs/pathpropertiesdialog.cpp \ + dialogs/roompropertiesdialog.cpp \ dialogs/scriptpropertiesdialog.cpp \ + dialogs/timelinepropertiesdialog.cpp \ jshighlighter.cpp \ mainwindow.cpp \ projectcontainer.cpp \ @@ -55,8 +61,11 @@ FORMS += \ dialogs/fontpropertiesdialog.ui \ dialogs/imageeditordialog.ui \ dialogs/objectinformationdialog.ui \ + dialogs/objectpropertiesdialog.ui \ dialogs/pathpropertiesdialog.ui \ + dialogs/roompropertiesdialog.ui \ dialogs/scriptpropertiesdialog.ui \ + dialogs/timelinepropertiesdialog.ui \ mainwindow.ui \ dialogs/backgroundpropertiesdialog.ui \ dialogs/editspritedialog.ui \ diff --git a/dialogs/backgroundpropertiesdialog.cpp b/dialogs/backgroundpropertiesdialog.cpp index 78ce2a8..3824188 100644 --- a/dialogs/backgroundpropertiesdialog.cpp +++ b/dialogs/backgroundpropertiesdialog.cpp @@ -51,7 +51,7 @@ void BackgroundPropertiesDialog::accept() { if (m_background.name != m_ui->lineEditName->text()) { - if (!m_projectModel.renameBackground(m_background, m_ui->lineEditName->text())) + if (!m_projectModel.rename(m_background, m_ui->lineEditName->text())) { QMessageBox::critical(this, tr("Renaming Background failed!"), tr("Renaming Background failed!")); return; diff --git a/dialogs/fontpropertiesdialog.cpp b/dialogs/fontpropertiesdialog.cpp index c2de8e0..22ba06f 100644 --- a/dialogs/fontpropertiesdialog.cpp +++ b/dialogs/fontpropertiesdialog.cpp @@ -66,7 +66,7 @@ void FontPropertiesDialog::accept() { if (m_font.name != m_ui->lineEditName->text()) { - if (!m_projectModel.renameFont(m_font, m_ui->lineEditName->text())) + if (!m_projectModel.rename(m_font, m_ui->lineEditName->text())) { QMessageBox::critical(this, tr("Renaming Font failed!"), tr("Renaming Font failed!")); return; diff --git a/dialogs/objectpropertiesdialog.cpp b/dialogs/objectpropertiesdialog.cpp new file mode 100644 index 0000000..5c34295 --- /dev/null +++ b/dialogs/objectpropertiesdialog.cpp @@ -0,0 +1,11 @@ +#include "objectpropertiesdialog.h" +#include "ui_objectpropertiesdialog.h" + +ObjectPropertiesDialog::ObjectPropertiesDialog(Object &object, ProjectTreeModel &projectModel, QWidget *parent) : + QDialog{parent}, + m_ui{std::make_unique()} +{ + m_ui->setupUi(this); +} + +ObjectPropertiesDialog::~ObjectPropertiesDialog() = default; diff --git a/dialogs/objectpropertiesdialog.h b/dialogs/objectpropertiesdialog.h new file mode 100644 index 0000000..be33e33 --- /dev/null +++ b/dialogs/objectpropertiesdialog.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +#include + +namespace Ui { class ObjectPropertiesDialog; } +struct Object; +class ProjectTreeModel; + +class ObjectPropertiesDialog : public QDialog +{ + Q_OBJECT + +public: + explicit ObjectPropertiesDialog(Object &object, ProjectTreeModel &projectModel, QWidget *parent = nullptr); + ~ObjectPropertiesDialog(); + +private: + const std::unique_ptr m_ui; +}; diff --git a/dialogs/objectpropertiesdialog.ui b/dialogs/objectpropertiesdialog.ui new file mode 100644 index 0000000..139e94c --- /dev/null +++ b/dialogs/objectpropertiesdialog.ui @@ -0,0 +1,25 @@ + + + ObjectPropertiesDialog + + + + 0 + 0 + 400 + 300 + + + + Object Properties + + + + :/qtgameengine/icons/object-file.png:/qtgameengine/icons/object-file.png + + + + + + + diff --git a/dialogs/pathpropertiesdialog.cpp b/dialogs/pathpropertiesdialog.cpp index b7d9e27..20e40df 100644 --- a/dialogs/pathpropertiesdialog.cpp +++ b/dialogs/pathpropertiesdialog.cpp @@ -55,7 +55,7 @@ void PathPropertiesDialog::accept() { if (m_path.name != m_ui->lineEditName->text()) { - if (!m_projectModel.renamePath(m_path, m_ui->lineEditName->text())) + if (!m_projectModel.rename(m_path, m_ui->lineEditName->text())) { QMessageBox::critical(this, tr("Renaming Path failed!"), tr("Renaming Path failed!")); return; diff --git a/dialogs/roompropertiesdialog.cpp b/dialogs/roompropertiesdialog.cpp new file mode 100644 index 0000000..20a72b6 --- /dev/null +++ b/dialogs/roompropertiesdialog.cpp @@ -0,0 +1,11 @@ +#include "roompropertiesdialog.h" +#include "ui_roompropertiesdialog.h" + +RoomPropertiesDialog::RoomPropertiesDialog(Room &room, ProjectTreeModel &projectModel, QWidget *parent) : + QDialog{parent}, + m_ui{std::make_unique()} +{ + m_ui->setupUi(this); +} + +RoomPropertiesDialog::~RoomPropertiesDialog() = default; diff --git a/dialogs/roompropertiesdialog.h b/dialogs/roompropertiesdialog.h new file mode 100644 index 0000000..4799276 --- /dev/null +++ b/dialogs/roompropertiesdialog.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +#include + +namespace Ui { class RoomPropertiesDialog; } +struct Room; +class ProjectTreeModel; + +class RoomPropertiesDialog : public QDialog +{ + Q_OBJECT + +public: + explicit RoomPropertiesDialog(Room &room, ProjectTreeModel &projectModel, QWidget *parent = nullptr); + ~RoomPropertiesDialog(); + +private: + const std::unique_ptr m_ui; +}; diff --git a/dialogs/roompropertiesdialog.ui b/dialogs/roompropertiesdialog.ui new file mode 100644 index 0000000..7c3f317 --- /dev/null +++ b/dialogs/roompropertiesdialog.ui @@ -0,0 +1,25 @@ + + + RoomPropertiesDialog + + + + 0 + 0 + 400 + 300 + + + + Room Properties + + + + :/qtgameengine/icons/room-file.png:/qtgameengine/icons/room-file.png + + + + + + + diff --git a/dialogs/scriptpropertiesdialog.cpp b/dialogs/scriptpropertiesdialog.cpp index b63baef..00537a1 100644 --- a/dialogs/scriptpropertiesdialog.cpp +++ b/dialogs/scriptpropertiesdialog.cpp @@ -76,7 +76,7 @@ void ScriptPropertiesDialog::accept() { if (m_script.name != m_lineEditName->text()) { - if (!m_projectModel.renameScript(m_script, m_lineEditName->text())) + if (!m_projectModel.rename