Included Files and Triggers improvements
This commit is contained in:
@ -27,6 +27,7 @@ INCLUDEPATH += \
|
|||||||
HEADERS += \
|
HEADERS += \
|
||||||
src/closeeventfilter.h \
|
src/closeeventfilter.h \
|
||||||
src/editor/dialogs/genericcodeeditordialog.h \
|
src/editor/dialogs/genericcodeeditordialog.h \
|
||||||
|
src/editor/dialogs/includedfilepropertiesdialog.h \
|
||||||
src/editor/dialogs/transparentbackgroundsettingsdialog.h \
|
src/editor/dialogs/transparentbackgroundsettingsdialog.h \
|
||||||
src/editor/editorguiutils.h \
|
src/editor/editorguiutils.h \
|
||||||
src/editor/roomscene.h \
|
src/editor/roomscene.h \
|
||||||
@ -89,6 +90,7 @@ HEADERS += \
|
|||||||
SOURCES += \
|
SOURCES += \
|
||||||
src/closeeventfilter.cpp \
|
src/closeeventfilter.cpp \
|
||||||
src/editor/dialogs/genericcodeeditordialog.cpp \
|
src/editor/dialogs/genericcodeeditordialog.cpp \
|
||||||
|
src/editor/dialogs/includedfilepropertiesdialog.cpp \
|
||||||
src/editor/dialogs/transparentbackgroundsettingsdialog.cpp \
|
src/editor/dialogs/transparentbackgroundsettingsdialog.cpp \
|
||||||
src/editor/editorguiutils.cpp \
|
src/editor/editorguiutils.cpp \
|
||||||
src/editor/roomscene.cpp \
|
src/editor/roomscene.cpp \
|
||||||
@ -148,6 +150,7 @@ SOURCES += \
|
|||||||
src/projectserialization.cpp
|
src/projectserialization.cpp
|
||||||
|
|
||||||
FORMS += \
|
FORMS += \
|
||||||
|
src/editor/dialogs/includedfilepropertiesdialog.ui \
|
||||||
src/editor/dialogs/transparentbackgroundsettingsdialog.ui \
|
src/editor/dialogs/transparentbackgroundsettingsdialog.ui \
|
||||||
src/editor/mainwindow.ui \
|
src/editor/mainwindow.ui \
|
||||||
src/editor/dialogs/addeventdialog.ui \
|
src/editor/dialogs/addeventdialog.ui \
|
||||||
|
@ -5,10 +5,12 @@
|
|||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
|
|
||||||
#include "models/projecttreemodel.h"
|
#include "models/projecttreemodel.h"
|
||||||
|
#include "mainwindow.h"
|
||||||
|
|
||||||
AddEventDialog::AddEventDialog(ProjectTreeModel &projectModel, QWidget *parent) :
|
AddEventDialog::AddEventDialog(ProjectTreeModel &projectModel, MainWindow &mainWindow, QWidget *parent) :
|
||||||
QDialog{parent},
|
QDialog{parent},
|
||||||
m_projectModel{projectModel},
|
m_projectModel{projectModel},
|
||||||
|
m_mainWindow{mainWindow},
|
||||||
m_ui{std::make_unique<Ui::AddEventDialog>()}
|
m_ui{std::make_unique<Ui::AddEventDialog>()}
|
||||||
{
|
{
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
@ -80,6 +82,12 @@ AddEventDialog::AddEventDialog(ProjectTreeModel &projectModel, QWidget *parent)
|
|||||||
});
|
});
|
||||||
m_ui->pushButtonCollision->setMenu(menu);
|
m_ui->pushButtonCollision->setMenu(menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
auto menu = new QMenu;
|
||||||
|
menu->addAction(tr("Add/Modify Triggers..."), this, [this](){ m_mainWindow.showDefineTriggers(); reject(); });
|
||||||
|
m_ui->pushButtonTrigger->setMenu(menu);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AddEventDialog::~AddEventDialog() = default;
|
AddEventDialog::~AddEventDialog() = default;
|
||||||
|
@ -10,13 +10,14 @@
|
|||||||
namespace Ui { class AddEventDialog; }
|
namespace Ui { class AddEventDialog; }
|
||||||
|
|
||||||
class ProjectTreeModel;
|
class ProjectTreeModel;
|
||||||
|
class MainWindow;
|
||||||
|
|
||||||
class AddEventDialog : public QDialog
|
class AddEventDialog : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AddEventDialog(ProjectTreeModel &projectModel, QWidget *parent = nullptr);
|
explicit AddEventDialog(ProjectTreeModel &projectModel, MainWindow &mainWindow, QWidget *parent = nullptr);
|
||||||
~AddEventDialog();
|
~AddEventDialog();
|
||||||
|
|
||||||
const std::optional<std::variant<Object::EventType, QString>> &eventType() const { return m_eventType; }
|
const std::optional<std::variant<Object::EventType, QString>> &eventType() const { return m_eventType; }
|
||||||
@ -26,6 +27,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
ProjectTreeModel &m_projectModel;
|
ProjectTreeModel &m_projectModel;
|
||||||
|
MainWindow &m_mainWindow;
|
||||||
|
|
||||||
const std::unique_ptr<Ui::AddEventDialog> m_ui;
|
const std::unique_ptr<Ui::AddEventDialog> m_ui;
|
||||||
|
|
||||||
|
@ -122,6 +122,10 @@
|
|||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Trigger</string>
|
<string>&Trigger</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../resources_editor.qrc">
|
||||||
|
<normaloff>:/qtgameengine/icons/trigger.png</normaloff>:/qtgameengine/icons/trigger.png</iconset>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
@ -8,9 +8,10 @@
|
|||||||
#include "projectcontainer.h"
|
#include "projectcontainer.h"
|
||||||
#include "models/projecttreemodel.h"
|
#include "models/projecttreemodel.h"
|
||||||
#include "imageeditordialog.h"
|
#include "imageeditordialog.h"
|
||||||
|
#include "mainwindow.h"
|
||||||
|
|
||||||
BackgroundPropertiesDialog::BackgroundPropertiesDialog(Background &background, ProjectTreeModel &projectModel, QWidget *parent) :
|
BackgroundPropertiesDialog::BackgroundPropertiesDialog(Background &background, ProjectTreeModel &projectModel, MainWindow &mainWindow) :
|
||||||
QDialog{parent},
|
QDialog{&mainWindow},
|
||||||
m_ui{std::make_unique<Ui::BackgroundPropertiesDialog>()},
|
m_ui{std::make_unique<Ui::BackgroundPropertiesDialog>()},
|
||||||
m_background{background},
|
m_background{background},
|
||||||
m_projectModel{projectModel},
|
m_projectModel{projectModel},
|
||||||
|
@ -8,13 +8,14 @@
|
|||||||
namespace Ui { class BackgroundPropertiesDialog; }
|
namespace Ui { class BackgroundPropertiesDialog; }
|
||||||
struct Background;
|
struct Background;
|
||||||
class ProjectTreeModel;
|
class ProjectTreeModel;
|
||||||
|
class MainWindow;
|
||||||
|
|
||||||
class BackgroundPropertiesDialog : public QDialog
|
class BackgroundPropertiesDialog : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit BackgroundPropertiesDialog(Background &background, ProjectTreeModel &projectModel, QWidget *parent = nullptr);
|
explicit BackgroundPropertiesDialog(Background &background, ProjectTreeModel &projectModel, MainWindow &mainWindow);
|
||||||
~BackgroundPropertiesDialog();
|
~BackgroundPropertiesDialog();
|
||||||
|
|
||||||
void accept() override;
|
void accept() override;
|
||||||
|
@ -6,9 +6,10 @@
|
|||||||
|
|
||||||
#include "projectcontainer.h"
|
#include "projectcontainer.h"
|
||||||
#include "models/projecttreemodel.h"
|
#include "models/projecttreemodel.h"
|
||||||
|
#include "mainwindow.h"
|
||||||
|
|
||||||
FontPropertiesDialog::FontPropertiesDialog(Font &font, ProjectTreeModel &projectModel, QWidget *parent) :
|
FontPropertiesDialog::FontPropertiesDialog(Font &font, ProjectTreeModel &projectModel, MainWindow &mainWindow) :
|
||||||
QDialog{parent},
|
QDialog{&mainWindow},
|
||||||
m_ui{std::make_unique<Ui::FontPropertiesDialog>()},
|
m_ui{std::make_unique<Ui::FontPropertiesDialog>()},
|
||||||
m_font{font},
|
m_font{font},
|
||||||
m_projectModel{projectModel}
|
m_projectModel{projectModel}
|
||||||
|
@ -7,13 +7,14 @@
|
|||||||
namespace Ui { class FontPropertiesDialog; }
|
namespace Ui { class FontPropertiesDialog; }
|
||||||
struct Font;
|
struct Font;
|
||||||
class ProjectTreeModel;
|
class ProjectTreeModel;
|
||||||
|
class MainWindow;
|
||||||
|
|
||||||
class FontPropertiesDialog : public QDialog
|
class FontPropertiesDialog : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit FontPropertiesDialog(Font &font, ProjectTreeModel &projectModel, QWidget *parent = nullptr);
|
explicit FontPropertiesDialog(Font &font, ProjectTreeModel &projectModel, MainWindow &mainWindow);
|
||||||
~FontPropertiesDialog();
|
~FontPropertiesDialog();
|
||||||
|
|
||||||
void accept() override;
|
void accept() override;
|
||||||
|
@ -13,19 +13,184 @@
|
|||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Game Information</string>
|
<string>Game Information</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QLabel" name="label">
|
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,0,1">
|
||||||
<property name="geometry">
|
<item>
|
||||||
<rect>
|
<widget class="QMenuBar" name="menuBar">
|
||||||
<x>50</x>
|
<widget class="QMenu" name="menuFile">
|
||||||
<y>50</y>
|
<property name="title">
|
||||||
<width>201</width>
|
<string>&File</string>
|
||||||
<height>16</height>
|
</property>
|
||||||
</rect>
|
<addaction name="actionNew"/>
|
||||||
</property>
|
<addaction name="actionOpen"/>
|
||||||
|
<addaction name="separator"/>
|
||||||
|
<addaction name="actionSave"/>
|
||||||
|
<addaction name="actionSaveAs"/>
|
||||||
|
<addaction name="separator"/>
|
||||||
|
<addaction name="actionPrint"/>
|
||||||
|
<addaction name="actionPrintPreview"/>
|
||||||
|
<addaction name="actionExportPDF"/>
|
||||||
|
</widget>
|
||||||
|
<widget class="QMenu" name="menuEdit">
|
||||||
|
<property name="title">
|
||||||
|
<string>&Edit</string>
|
||||||
|
</property>
|
||||||
|
<addaction name="actionUndo"/>
|
||||||
|
<addaction name="actionRedo"/>
|
||||||
|
<addaction name="separator"/>
|
||||||
|
<addaction name="actionCut"/>
|
||||||
|
<addaction name="actionCopy"/>
|
||||||
|
<addaction name="actionPaste"/>
|
||||||
|
</widget>
|
||||||
|
<widget class="QMenu" name="menuFormat">
|
||||||
|
<property name="title">
|
||||||
|
<string>F&ormat</string>
|
||||||
|
</property>
|
||||||
|
<addaction name="actionBold"/>
|
||||||
|
<addaction name="actionItalic"/>
|
||||||
|
<addaction name="actionUnderline"/>
|
||||||
|
<addaction name="separator"/>
|
||||||
|
<addaction name="actionLeft"/>
|
||||||
|
<addaction name="actionCenter"/>
|
||||||
|
<addaction name="actionRight"/>
|
||||||
|
<addaction name="actionIndent"/>
|
||||||
|
<addaction name="actionUnindent"/>
|
||||||
|
<addaction name="separator"/>
|
||||||
|
<addaction name="actionColor"/>
|
||||||
|
<addaction name="separator"/>
|
||||||
|
<addaction name="actionChecked"/>
|
||||||
|
</widget>
|
||||||
|
<addaction name="menuFile"/>
|
||||||
|
<addaction name="menuEdit"/>
|
||||||
|
<addaction name="menuFormat"/>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolBar" name="toolBar">
|
||||||
|
<addaction name="actionNew"/>
|
||||||
|
<addaction name="actionOpen"/>
|
||||||
|
<addaction name="actionSave"/>
|
||||||
|
<addaction name="actionPrint"/>
|
||||||
|
<addaction name="actionExportPDF"/>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="text">
|
||||||
|
<string>Not yet implemented</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
<action name="actionNew">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Not yet implemented</string>
|
<string>&New</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</action>
|
||||||
|
<action name="actionOpen">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Open...</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionSave">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Save</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionSaveAs">
|
||||||
|
<property name="text">
|
||||||
|
<string>Save &As...</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionPrint">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Print...</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionPrintPreview">
|
||||||
|
<property name="text">
|
||||||
|
<string>Print Preview...</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionExportPDF">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Export PDF...</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionUndo">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Undo</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionRedo">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Redo</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionCut">
|
||||||
|
<property name="text">
|
||||||
|
<string>Cu&t</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionCopy">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Copy</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionPaste">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Paste</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionBold">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Bold</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionItalic">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Italic</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionUnderline">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Underline</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionLeft">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Left</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionCenter">
|
||||||
|
<property name="text">
|
||||||
|
<string>C&enter</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionRight">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Justify</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionIndent">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Indent</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionUnindent">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Unindent</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionColor">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Color</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionChecked">
|
||||||
|
<property name="text">
|
||||||
|
<string>Chec&ked</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
22
src/editor/dialogs/includedfilepropertiesdialog.cpp
Normal file
22
src/editor/dialogs/includedfilepropertiesdialog.cpp
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#include "includedfilepropertiesdialog.h"
|
||||||
|
#include "ui_includedfilepropertiesdialog.h"
|
||||||
|
|
||||||
|
IncludedFilePropertiesDialog::IncludedFilePropertiesDialog(IncludedFile &includedFile, QWidget *parent) :
|
||||||
|
QDialog{parent},
|
||||||
|
m_includedFile{includedFile},
|
||||||
|
m_ui{std::make_unique<Ui::IncludedFilePropertiesDialog>()}
|
||||||
|
{
|
||||||
|
m_ui->setupUi(this);
|
||||||
|
|
||||||
|
#ifdef Q_OS_LINUX
|
||||||
|
setWindowFlags((windowFlags() & ~Qt::Dialog) | Qt::Window);
|
||||||
|
#endif
|
||||||
|
setWindowFlag(Qt::WindowCloseButtonHint);
|
||||||
|
}
|
||||||
|
|
||||||
|
IncludedFilePropertiesDialog::~IncludedFilePropertiesDialog() = default;
|
||||||
|
|
||||||
|
void IncludedFilePropertiesDialog::accept()
|
||||||
|
{
|
||||||
|
QDialog::reject();
|
||||||
|
}
|
25
src/editor/dialogs/includedfilepropertiesdialog.h
Normal file
25
src/editor/dialogs/includedfilepropertiesdialog.h
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QDialog>
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
namespace Ui { class IncludedFilePropertiesDialog; }
|
||||||
|
struct IncludedFile;
|
||||||
|
|
||||||
|
class IncludedFilePropertiesDialog : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit IncludedFilePropertiesDialog(IncludedFile &includedFile, QWidget *parent = nullptr);
|
||||||
|
~IncludedFilePropertiesDialog() override;
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void accept() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
IncludedFile &m_includedFile;
|
||||||
|
|
||||||
|
const std::unique_ptr<Ui::IncludedFilePropertiesDialog> m_ui;
|
||||||
|
};
|
68
src/editor/dialogs/includedfilepropertiesdialog.ui
Normal file
68
src/editor/dialogs/includedfilepropertiesdialog.ui
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>IncludedFilePropertiesDialog</class>
|
||||||
|
<widget class="QDialog" name="IncludedFilePropertiesDialog">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>400</width>
|
||||||
|
<height>300</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Dialog</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>30</x>
|
||||||
|
<y>240</y>
|
||||||
|
<width>341</width>
|
||||||
|
<height>32</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="standardButtons">
|
||||||
|
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonBox</sender>
|
||||||
|
<signal>accepted()</signal>
|
||||||
|
<receiver>IncludedFilePropertiesDialog</receiver>
|
||||||
|
<slot>accept()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>248</x>
|
||||||
|
<y>254</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>157</x>
|
||||||
|
<y>274</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonBox</sender>
|
||||||
|
<signal>rejected()</signal>
|
||||||
|
<receiver>IncludedFilePropertiesDialog</receiver>
|
||||||
|
<slot>reject()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>316</x>
|
||||||
|
<y>260</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>286</x>
|
||||||
|
<y>274</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
</connections>
|
||||||
|
</ui>
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include "projectcontainer.h"
|
#include "projectcontainer.h"
|
||||||
#include "models/includedfilesmodel.h"
|
#include "models/includedfilesmodel.h"
|
||||||
|
#include "dialogs/includedfilepropertiesdialog.h"
|
||||||
|
|
||||||
IncludedFilesDialog::IncludedFilesDialog(ProjectContainer &project, QWidget *parent) :
|
IncludedFilesDialog::IncludedFilesDialog(ProjectContainer &project, QWidget *parent) :
|
||||||
QDialog{parent},
|
QDialog{parent},
|
||||||
@ -18,6 +19,18 @@ IncludedFilesDialog::IncludedFilesDialog(ProjectContainer &project, QWidget *par
|
|||||||
button->setIcon(QIcon{":/qtgameengine/icons/delete.png"});
|
button->setIcon(QIcon{":/qtgameengine/icons/delete.png"});
|
||||||
|
|
||||||
m_ui->listView->setModel(m_model.get());
|
m_ui->listView->setModel(m_model.get());
|
||||||
|
|
||||||
|
connect(m_ui->pushButtonAdd, &QAbstractButton::clicked, this, &IncludedFilesDialog::addPressed);
|
||||||
}
|
}
|
||||||
|
|
||||||
IncludedFilesDialog::~IncludedFilesDialog() = default;
|
IncludedFilesDialog::~IncludedFilesDialog() = default;
|
||||||
|
|
||||||
|
void IncludedFilesDialog::addPressed()
|
||||||
|
{
|
||||||
|
IncludedFile includedFile;
|
||||||
|
IncludedFilePropertiesDialog dialog{includedFile, this};
|
||||||
|
if (dialog.exec() == QDialog::Accepted)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -16,6 +16,9 @@ public:
|
|||||||
explicit IncludedFilesDialog(ProjectContainer &project, QWidget *parent = nullptr);
|
explicit IncludedFilesDialog(ProjectContainer &project, QWidget *parent = nullptr);
|
||||||
~IncludedFilesDialog();
|
~IncludedFilesDialog();
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void addPressed();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const std::unique_ptr<Ui::IncludedFilesDialog> m_ui;
|
const std::unique_ptr<Ui::IncludedFilesDialog> m_ui;
|
||||||
|
|
||||||
|
@ -7,12 +7,16 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>400</width>
|
<width>400</width>
|
||||||
<height>300</height>
|
<height>462</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Included Files</string>
|
<string>Included Files</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="windowIcon">
|
||||||
|
<iconset resource="../resources_editor.qrc">
|
||||||
|
<normaloff>:/qtgameengine/icons/included-files.png</normaloff>:/qtgameengine/icons/included-files.png</iconset>
|
||||||
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout" stretch="1,0">
|
<layout class="QVBoxLayout" name="verticalLayout" stretch="1,0">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox">
|
<widget class="QGroupBox" name="groupBox">
|
||||||
|
@ -12,8 +12,8 @@
|
|||||||
#include "models/objecteventsmodel.h"
|
#include "models/objecteventsmodel.h"
|
||||||
#include "addeventdialog.h"
|
#include "addeventdialog.h"
|
||||||
|
|
||||||
ObjectPropertiesDialog::ObjectPropertiesDialog(Object &object, ProjectTreeModel &projectModel, MainWindow *mainWindow) :
|
ObjectPropertiesDialog::ObjectPropertiesDialog(Object &object, ProjectTreeModel &projectModel, MainWindow &mainWindow) :
|
||||||
QDialog{mainWindow},
|
QDialog{&mainWindow},
|
||||||
m_ui{std::make_unique<Ui::ObjectPropertiesDialog>()},
|
m_ui{std::make_unique<Ui::ObjectPropertiesDialog>()},
|
||||||
m_object{object},
|
m_object{object},
|
||||||
m_projectModel{projectModel},
|
m_projectModel{projectModel},
|
||||||
@ -191,12 +191,6 @@ void ObjectPropertiesDialog::newSprite()
|
|||||||
|
|
||||||
void ObjectPropertiesDialog::editSprite()
|
void ObjectPropertiesDialog::editSprite()
|
||||||
{
|
{
|
||||||
if (!m_mainWindow)
|
|
||||||
{
|
|
||||||
qCritical() << "no mainWindow available";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto &sprites = m_projectModel.project()->sprites;
|
auto &sprites = m_projectModel.project()->sprites;
|
||||||
const auto iter = std::find_if(std::begin(sprites), std::end(sprites),
|
const auto iter = std::find_if(std::begin(sprites), std::end(sprites),
|
||||||
[&](const Sprite &sprite){ return sprite.name == m_spriteName; });
|
[&](const Sprite &sprite){ return sprite.name == m_spriteName; });
|
||||||
@ -206,7 +200,7 @@ void ObjectPropertiesDialog::editSprite()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_mainWindow->openPropertiesWindowFor(*iter);
|
m_mainWindow.openPropertiesWindowFor(*iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectPropertiesDialog::showInformation()
|
void ObjectPropertiesDialog::showInformation()
|
||||||
@ -216,7 +210,7 @@ void ObjectPropertiesDialog::showInformation()
|
|||||||
|
|
||||||
void ObjectPropertiesDialog::addEvent()
|
void ObjectPropertiesDialog::addEvent()
|
||||||
{
|
{
|
||||||
AddEventDialog dialog{m_projectModel, this};
|
AddEventDialog dialog{m_projectModel, m_mainWindow, this};
|
||||||
if (dialog.exec() == QDialog::Accepted)
|
if (dialog.exec() == QDialog::Accepted)
|
||||||
if (const auto &eventType = dialog.eventType())
|
if (const auto &eventType = dialog.eventType())
|
||||||
if (!m_eventsModel->addEvent(*eventType))
|
if (!m_eventsModel->addEvent(*eventType))
|
||||||
@ -248,7 +242,7 @@ void ObjectPropertiesDialog::replaceEvent()
|
|||||||
|
|
||||||
std::variant<Object::EventType, QString> x = event->first;
|
std::variant<Object::EventType, QString> x = event->first;
|
||||||
|
|
||||||
AddEventDialog dialog{m_projectModel, this};
|
AddEventDialog dialog{m_projectModel, m_mainWindow, this};
|
||||||
if (dialog.exec() == QDialog::Accepted)
|
if (dialog.exec() == QDialog::Accepted)
|
||||||
if (const auto &eventType = dialog.eventType())
|
if (const auto &eventType = dialog.eventType())
|
||||||
if (!m_eventsModel->changeEvent(event->first, *eventType))
|
if (!m_eventsModel->changeEvent(event->first, *eventType))
|
||||||
@ -432,7 +426,7 @@ void ObjectPropertiesDialog::setParent(const Object &object)
|
|||||||
{
|
{
|
||||||
if (&m_object == &object)
|
if (&m_object == &object)
|
||||||
{
|
{
|
||||||
QMessageBox::warning(m_mainWindow, tr("This will create a loop in parents."), tr("This will create a loop in parents."));
|
QMessageBox::warning(this, tr("This will create a loop in parents."), tr("This will create a loop in parents."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ class ObjectPropertiesDialog : public QDialog
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ObjectPropertiesDialog(Object &object, ProjectTreeModel &projectModel, MainWindow *mainWindow);
|
explicit ObjectPropertiesDialog(Object &object, ProjectTreeModel &projectModel, MainWindow &mainWindow);
|
||||||
~ObjectPropertiesDialog();
|
~ObjectPropertiesDialog();
|
||||||
|
|
||||||
void accept() override;
|
void accept() override;
|
||||||
@ -62,7 +62,7 @@ private:
|
|||||||
|
|
||||||
Object &m_object;
|
Object &m_object;
|
||||||
ProjectTreeModel &m_projectModel;
|
ProjectTreeModel &m_projectModel;
|
||||||
MainWindow * const m_mainWindow;
|
MainWindow &m_mainWindow;
|
||||||
|
|
||||||
Object::events_container_t m_events;
|
Object::events_container_t m_events;
|
||||||
Object::collision_events_container_t m_collisionEvents;
|
Object::collision_events_container_t m_collisionEvents;
|
||||||
|
@ -12,9 +12,10 @@
|
|||||||
#include "projectcontainer.h"
|
#include "projectcontainer.h"
|
||||||
#include "models/projecttreemodel.h"
|
#include "models/projecttreemodel.h"
|
||||||
#include "models/pathpointsmodel.h"
|
#include "models/pathpointsmodel.h"
|
||||||
|
#include "mainwindow.h"
|
||||||
|
|
||||||
PathPropertiesDialog::PathPropertiesDialog(Path &path, ProjectTreeModel &projectModel, QWidget *parent) :
|
PathPropertiesDialog::PathPropertiesDialog(Path &path, ProjectTreeModel &projectModel, MainWindow &mainWindow) :
|
||||||
QDialog{parent},
|
QDialog{&mainWindow},
|
||||||
m_ui{std::make_unique<Ui::PathPropertiesDialog>()},
|
m_ui{std::make_unique<Ui::PathPropertiesDialog>()},
|
||||||
m_path{path},
|
m_path{path},
|
||||||
m_projectModel{projectModel},
|
m_projectModel{projectModel},
|
||||||
|
@ -13,13 +13,14 @@ class QMenu;
|
|||||||
namespace Ui { class PathPropertiesDialog; }
|
namespace Ui { class PathPropertiesDialog; }
|
||||||
class ProjectTreeModel;
|
class ProjectTreeModel;
|
||||||
class PathPointsModel;
|
class PathPointsModel;
|
||||||
|
class MainWindow;
|
||||||
|
|
||||||
class PathPropertiesDialog : public QDialog
|
class PathPropertiesDialog : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit PathPropertiesDialog(Path &path, ProjectTreeModel &projectModel, QWidget *parent = nullptr);
|
explicit PathPropertiesDialog(Path &path, ProjectTreeModel &projectModel, MainWindow &mainWindow);
|
||||||
~PathPropertiesDialog();
|
~PathPropertiesDialog();
|
||||||
|
|
||||||
void accept() override;
|
void accept() override;
|
||||||
|
@ -13,9 +13,10 @@
|
|||||||
#include "roomscene.h"
|
#include "roomscene.h"
|
||||||
#include "editorguiutils.h"
|
#include "editorguiutils.h"
|
||||||
#include "genericcodeeditordialog.h"
|
#include "genericcodeeditordialog.h"
|
||||||
|
#include "mainwindow.h"
|
||||||
|
|
||||||
RoomPropertiesDialog::RoomPropertiesDialog(Room &room, ProjectTreeModel &projectModel, QWidget *parent) :
|
RoomPropertiesDialog::RoomPropertiesDialog(Room &room, ProjectTreeModel &projectModel, MainWindow &mainWindow) :
|
||||||
QDialog{parent},
|
QDialog{&mainWindow},
|
||||||
m_ui{std::make_unique<Ui::RoomPropertiesDialog>()},
|
m_ui{std::make_unique<Ui::RoomPropertiesDialog>()},
|
||||||
m_room{room},
|
m_room{room},
|
||||||
m_projectModel{projectModel},
|
m_projectModel{projectModel},
|
||||||
|
@ -15,13 +15,14 @@ struct Sprite;
|
|||||||
struct Object;
|
struct Object;
|
||||||
class ProjectTreeModel;
|
class ProjectTreeModel;
|
||||||
class RoomScene;
|
class RoomScene;
|
||||||
|
class MainWindow;
|
||||||
|
|
||||||
class RoomPropertiesDialog : public QDialog
|
class RoomPropertiesDialog : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit RoomPropertiesDialog(Room &room, ProjectTreeModel &projectModel, QWidget *parent = nullptr);
|
explicit RoomPropertiesDialog(Room &room, ProjectTreeModel &projectModel, MainWindow &mainWindow);
|
||||||
~RoomPropertiesDialog();
|
~RoomPropertiesDialog();
|
||||||
|
|
||||||
void accept() override;
|
void accept() override;
|
||||||
|
@ -8,9 +8,10 @@
|
|||||||
|
|
||||||
#include "projectcontainer.h"
|
#include "projectcontainer.h"
|
||||||
#include "models/projecttreemodel.h"
|
#include "models/projecttreemodel.h"
|
||||||
|
#include "mainwindow.h"
|
||||||
|
|
||||||
ScriptPropertiesDialog::ScriptPropertiesDialog(Script &script, ProjectTreeModel &projectModel, QWidget *parent) :
|
ScriptPropertiesDialog::ScriptPropertiesDialog(Script &script, ProjectTreeModel &projectModel, MainWindow &mainWindow) :
|
||||||
CodeEditorDialog{tr("Script Properties: %0").arg(script.name), parent},
|
CodeEditorDialog{tr("Script Properties: %0").arg(script.name), &mainWindow},
|
||||||
m_script{script},
|
m_script{script},
|
||||||
m_projectModel{projectModel},
|
m_projectModel{projectModel},
|
||||||
m_lineEditName{new QLineEdit{this}}
|
m_lineEditName{new QLineEdit{this}}
|
||||||
|
@ -3,13 +3,14 @@
|
|||||||
class QLineEdit;
|
class QLineEdit;
|
||||||
struct Script;
|
struct Script;
|
||||||
class ProjectTreeModel;
|
class ProjectTreeModel;
|
||||||
|
class MainWindow;
|
||||||
|
|
||||||
class ScriptPropertiesDialog : public CodeEditorDialog
|
class ScriptPropertiesDialog : public CodeEditorDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ScriptPropertiesDialog(Script &script, ProjectTreeModel &projectModel, QWidget *parent = nullptr);
|
ScriptPropertiesDialog(Script &script, ProjectTreeModel &projectModel, MainWindow &mainWindow);
|
||||||
|
|
||||||
void accept() override;
|
void accept() override;
|
||||||
|
|
||||||
|
@ -9,9 +9,10 @@
|
|||||||
|
|
||||||
#include "projectcontainer.h"
|
#include "projectcontainer.h"
|
||||||
#include "models/projecttreemodel.h"
|
#include "models/projecttreemodel.h"
|
||||||
|
#include "mainwindow.h"
|
||||||
|
|
||||||
SoundPropertiesDialog::SoundPropertiesDialog(Sound &sound, ProjectTreeModel &projectModel, QWidget *parent) :
|
SoundPropertiesDialog::SoundPropertiesDialog(Sound &sound, ProjectTreeModel &projectModel, MainWindow &mainWindow) :
|
||||||
QDialog{parent},
|
QDialog{&mainWindow},
|
||||||
m_ui{std::make_unique<Ui::SoundPropertiesDialog>()},
|
m_ui{std::make_unique<Ui::SoundPropertiesDialog>()},
|
||||||
m_sound{sound},
|
m_sound{sound},
|
||||||
m_projectModel{projectModel},
|
m_projectModel{projectModel},
|
||||||
|
@ -9,13 +9,14 @@
|
|||||||
namespace Ui { class SoundPropertiesDialog; }
|
namespace Ui { class SoundPropertiesDialog; }
|
||||||
struct Sound;
|
struct Sound;
|
||||||
class ProjectTreeModel;
|
class ProjectTreeModel;
|
||||||
|
class MainWindow;
|
||||||
|
|
||||||
class SoundPropertiesDialog : public QDialog
|
class SoundPropertiesDialog : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit SoundPropertiesDialog(Sound &sound, ProjectTreeModel &projectModel, QWidget *parent = nullptr);
|
explicit SoundPropertiesDialog(Sound &sound, ProjectTreeModel &projectModel, MainWindow &mainWindow);
|
||||||
~SoundPropertiesDialog();
|
~SoundPropertiesDialog();
|
||||||
|
|
||||||
void accept() override;
|
void accept() override;
|
||||||
|
@ -10,9 +10,10 @@
|
|||||||
#include "models/projecttreemodel.h"
|
#include "models/projecttreemodel.h"
|
||||||
#include "editspritedialog.h"
|
#include "editspritedialog.h"
|
||||||
#include "maskpropertiesdialog.h"
|
#include "maskpropertiesdialog.h"
|
||||||
|
#include "mainwindow.h"
|
||||||
|
|
||||||
SpritePropertiesDialog::SpritePropertiesDialog(Sprite &sprite, ProjectTreeModel &projectModel, QWidget *parent) :
|
SpritePropertiesDialog::SpritePropertiesDialog(Sprite &sprite, ProjectTreeModel &projectModel, MainWindow &mainWindow) :
|
||||||
QDialog{parent},
|
QDialog{&mainWindow},
|
||||||
m_ui{std::make_unique<Ui::SpritePropertiesDialog>()},
|
m_ui{std::make_unique<Ui::SpritePropertiesDialog>()},
|
||||||
m_sprite{sprite},
|
m_sprite{sprite},
|
||||||
m_projectModel{projectModel},
|
m_projectModel{projectModel},
|
||||||
|
@ -8,13 +8,14 @@
|
|||||||
namespace Ui { class SpritePropertiesDialog; }
|
namespace Ui { class SpritePropertiesDialog; }
|
||||||
struct Sprite;
|
struct Sprite;
|
||||||
class ProjectTreeModel;
|
class ProjectTreeModel;
|
||||||
|
class MainWindow;
|
||||||
|
|
||||||
class SpritePropertiesDialog : public QDialog
|
class SpritePropertiesDialog : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit SpritePropertiesDialog(Sprite &sprite, ProjectTreeModel &projectModel, QWidget *parent = nullptr);
|
explicit SpritePropertiesDialog(Sprite &sprite, ProjectTreeModel &projectModel, MainWindow &mainWindow);
|
||||||
~SpritePropertiesDialog();
|
~SpritePropertiesDialog();
|
||||||
|
|
||||||
void accept() override;
|
void accept() override;
|
||||||
|
@ -11,9 +11,10 @@
|
|||||||
#include "models/projecttreemodel.h"
|
#include "models/projecttreemodel.h"
|
||||||
#include "models/timelinemomentsmodel.h"
|
#include "models/timelinemomentsmodel.h"
|
||||||
#include "dialogs/deletemomentsdialog.h"
|
#include "dialogs/deletemomentsdialog.h"
|
||||||
|
#include "mainwindow.h"
|
||||||
|
|
||||||
TimeLinePropertiesDialog::TimeLinePropertiesDialog(TimeLine &timeLine, ProjectTreeModel &projectModel, QWidget *parent) :
|
TimeLinePropertiesDialog::TimeLinePropertiesDialog(TimeLine &timeLine, ProjectTreeModel &projectModel, MainWindow &mainWindow) :
|
||||||
QDialog{parent},
|
QDialog{&mainWindow},
|
||||||
m_ui{std::make_unique<Ui::TimeLinePropertiesDialog>()},
|
m_ui{std::make_unique<Ui::TimeLinePropertiesDialog>()},
|
||||||
m_timeLine{timeLine},
|
m_timeLine{timeLine},
|
||||||
m_projectModel{projectModel},
|
m_projectModel{projectModel},
|
||||||
|
@ -9,13 +9,14 @@
|
|||||||
namespace Ui { class TimeLinePropertiesDialog; }
|
namespace Ui { class TimeLinePropertiesDialog; }
|
||||||
class ProjectTreeModel;
|
class ProjectTreeModel;
|
||||||
class TimelineMomentsModel;
|
class TimelineMomentsModel;
|
||||||
|
class MainWindow;
|
||||||
|
|
||||||
class TimeLinePropertiesDialog : public QDialog
|
class TimeLinePropertiesDialog : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit TimeLinePropertiesDialog(TimeLine &timeLine, ProjectTreeModel &projectModel, QWidget *parent = nullptr);
|
explicit TimeLinePropertiesDialog(TimeLine &timeLine, ProjectTreeModel &projectModel, MainWindow &mainWindow);
|
||||||
~TimeLinePropertiesDialog();
|
~TimeLinePropertiesDialog();
|
||||||
|
|
||||||
void accept() override;
|
void accept() override;
|
||||||
|
@ -13,6 +13,10 @@
|
|||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Triggers</string>
|
<string>Triggers</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="windowIcon">
|
||||||
|
<iconset resource="../resources_editor.qrc">
|
||||||
|
<normaloff>:/qtgameengine/icons/trigger.png</normaloff>:/qtgameengine/icons/trigger.png</iconset>
|
||||||
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,1">
|
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,1">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
BIN
src/editor/icons/included-files.png
Normal file
BIN
src/editor/icons/included-files.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
BIN
src/editor/icons/trigger.png
Normal file
BIN
src/editor/icons/trigger.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.5 KiB |
@ -232,7 +232,7 @@ void MainWindow::openPropertiesWindowFor(T &entry)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto dialog = new PropertiesDialogFor<T>{entry, *m_projectTreeModel, this};
|
auto dialog = new PropertiesDialogFor<T>{entry, *m_projectTreeModel, *this};
|
||||||
auto subwindow = m_ui->mdiArea->addSubWindow(dialog);
|
auto subwindow = m_ui->mdiArea->addSubWindow(dialog);
|
||||||
auto action = m_ui->menuWindow->addAction(dialog->windowTitle());
|
auto action = m_ui->menuWindow->addAction(dialog->windowTitle());
|
||||||
m_actionGroupWindows->addAction(action);
|
m_actionGroupWindows->addAction(action);
|
||||||
|
@ -65,7 +65,9 @@ private slots:
|
|||||||
void showGlobalGameSettings();
|
void showGlobalGameSettings();
|
||||||
void showExtensionPackages();
|
void showExtensionPackages();
|
||||||
void showDefineConstants();
|
void showDefineConstants();
|
||||||
|
public slots:
|
||||||
void showDefineTriggers();
|
void showDefineTriggers();
|
||||||
|
private slots:
|
||||||
void showIncludedFiles();
|
void showIncludedFiles();
|
||||||
void runGame();
|
void runGame();
|
||||||
void debugGame();
|
void debugGame();
|
||||||
|
@ -634,6 +634,10 @@
|
|||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionDefineTriggers">
|
<action name="actionDefineTriggers">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="resources_editor.qrc">
|
||||||
|
<normaloff>:/qtgameengine/icons/trigger.png</normaloff>:/qtgameengine/icons/trigger.png</iconset>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Define Triggers...</string>
|
<string>&Define Triggers...</string>
|
||||||
</property>
|
</property>
|
||||||
@ -642,6 +646,10 @@
|
|||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionIncludedFiles">
|
<action name="actionIncludedFiles">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="resources_editor.qrc">
|
||||||
|
<normaloff>:/qtgameengine/icons/included-files.png</normaloff>:/qtgameengine/icons/included-files.png</iconset>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Inc&luded Files...</string>
|
<string>Inc&luded Files...</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -49,6 +49,7 @@
|
|||||||
<file>icons/grid.png</file>
|
<file>icons/grid.png</file>
|
||||||
<file>icons/help.png</file>
|
<file>icons/help.png</file>
|
||||||
<file>icons/import-resources.png</file>
|
<file>icons/import-resources.png</file>
|
||||||
|
<file>icons/included-files.png</file>
|
||||||
<file>icons/info.png</file>
|
<file>icons/info.png</file>
|
||||||
<file>icons/isometric.png</file>
|
<file>icons/isometric.png</file>
|
||||||
<file>icons/lock.png</file>
|
<file>icons/lock.png</file>
|
||||||
@ -90,6 +91,7 @@
|
|||||||
<file>icons/tile.png</file>
|
<file>icons/tile.png</file>
|
||||||
<file>icons/timeline-file.png</file>
|
<file>icons/timeline-file.png</file>
|
||||||
<file>icons/timeline.png</file>
|
<file>icons/timeline.png</file>
|
||||||
|
<file>icons/trigger.png</file>
|
||||||
<file>icons/undo.png</file>
|
<file>icons/undo.png</file>
|
||||||
<file>icons/unlock.png</file>
|
<file>icons/unlock.png</file>
|
||||||
<file>icons/blue-arrow-down.png</file>
|
<file>icons/blue-arrow-down.png</file>
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
#include <QDrag>
|
#include <QDrag>
|
||||||
#include <QMimeData>
|
#include <QMimeData>
|
||||||
|
|
||||||
#include "projectcontainer.h"
|
|
||||||
#include "projectserialization.h"
|
#include "projectserialization.h"
|
||||||
#include "stdserialization.h"
|
#include "stdserialization.h"
|
||||||
|
|
||||||
@ -39,7 +38,7 @@ void ActionDragWidget::mouseMoveEvent(QMouseEvent *event)
|
|||||||
QMimeData *mimeData = new QMimeData;
|
QMimeData *mimeData = new QMimeData;
|
||||||
QByteArray encoded;
|
QByteArray encoded;
|
||||||
QDataStream stream(&encoded, QDataStream::WriteOnly);
|
QDataStream stream(&encoded, QDataStream::WriteOnly);
|
||||||
stream << Action{ExecuteCodeAction{ .script = "hatschi" }};
|
stream << m_action;
|
||||||
mimeData->setData("custom", encoded);
|
mimeData->setData("custom", encoded);
|
||||||
drag->setMimeData(mimeData);
|
drag->setMimeData(mimeData);
|
||||||
|
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
#include <QPoint>
|
#include <QPoint>
|
||||||
|
|
||||||
|
#include "projectcontainer.h"
|
||||||
|
|
||||||
class ActionDragWidget : public QToolButton
|
class ActionDragWidget : public QToolButton
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -10,10 +12,16 @@ class ActionDragWidget : public QToolButton
|
|||||||
public:
|
public:
|
||||||
explicit ActionDragWidget(QWidget *parent = nullptr);
|
explicit ActionDragWidget(QWidget *parent = nullptr);
|
||||||
|
|
||||||
|
const Action &action() const { return m_action; }
|
||||||
|
void setAction(Action &&action) { m_action = std::move(action); }
|
||||||
|
void setAction(const Action &action) { m_action = action; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void mousePressEvent(QMouseEvent *event) override;
|
void mousePressEvent(QMouseEvent *event) override;
|
||||||
void mouseMoveEvent(QMouseEvent *event) override;
|
void mouseMoveEvent(QMouseEvent *event) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPoint m_dragStartPosition;
|
QPoint m_dragStartPosition;
|
||||||
|
|
||||||
|
Action m_action;
|
||||||
};
|
};
|
||||||
|
@ -277,9 +277,14 @@ struct Room
|
|||||||
std::vector<Object> objects;
|
std::vector<Object> objects;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct IncludedFile {
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
struct ProjectContainer
|
struct ProjectContainer
|
||||||
{
|
{
|
||||||
GlobalGameSettings globalGameSettings;
|
GlobalGameSettings globalGameSettings;
|
||||||
|
|
||||||
std::list<Sprite> sprites;
|
std::list<Sprite> sprites;
|
||||||
std::list<Sound> sounds;
|
std::list<Sound> sounds;
|
||||||
std::list<Background> backgrounds;
|
std::list<Background> backgrounds;
|
||||||
@ -290,6 +295,8 @@ struct ProjectContainer
|
|||||||
std::list<Object> objects;
|
std::list<Object> objects;
|
||||||
std::list<Room> rooms;
|
std::list<Room> rooms;
|
||||||
|
|
||||||
|
std::list<IncludedFile> includedFiles;
|
||||||
|
|
||||||
template<typename T> std::list<T> &containerFor();
|
template<typename T> std::list<T> &containerFor();
|
||||||
template<typename T> const std::list<T> &containerFor() const;
|
template<typename T> const std::list<T> &containerFor() const;
|
||||||
};
|
};
|
||||||
|
@ -408,6 +408,20 @@ QDataStream &operator>>(QDataStream &ds, Room &room)
|
|||||||
return ds;
|
return ds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QDataStream &operator<<(QDataStream &ds, const IncludedFile &includedFile)
|
||||||
|
{
|
||||||
|
Q_UNUSED(includedFile);
|
||||||
|
//ds << includedFile.;
|
||||||
|
return ds;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDataStream &operator>>(QDataStream &ds, IncludedFile &includedFile)
|
||||||
|
{
|
||||||
|
Q_UNUSED(includedFile);
|
||||||
|
//ds >> includedFile.;
|
||||||
|
return ds;
|
||||||
|
}
|
||||||
|
|
||||||
QDataStream &operator<<(QDataStream &ds, const ProjectContainer &project)
|
QDataStream &operator<<(QDataStream &ds, const ProjectContainer &project)
|
||||||
{
|
{
|
||||||
ds << project.globalGameSettings
|
ds << project.globalGameSettings
|
||||||
@ -419,7 +433,8 @@ QDataStream &operator<<(QDataStream &ds, const ProjectContainer &project)
|
|||||||
<< project.fonts
|
<< project.fonts
|
||||||
<< project.timeLines
|
<< project.timeLines
|
||||||
<< project.objects
|
<< project.objects
|
||||||
<< project.rooms;
|
<< project.rooms
|
||||||
|
<< project.includedFiles;
|
||||||
return ds;
|
return ds;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -434,6 +449,7 @@ QDataStream &operator>>(QDataStream &ds, ProjectContainer &project)
|
|||||||
>> project.fonts
|
>> project.fonts
|
||||||
>> project.timeLines
|
>> project.timeLines
|
||||||
>> project.objects
|
>> project.objects
|
||||||
>> project.rooms;
|
>> project.rooms
|
||||||
|
>> project.includedFiles;
|
||||||
return ds;
|
return ds;
|
||||||
}
|
}
|
||||||
|
@ -44,5 +44,7 @@ QDataStream &operator<<(QDataStream &ds, const Room::Object &object);
|
|||||||
QDataStream &operator>>(QDataStream &ds, Room::Object &object);
|
QDataStream &operator>>(QDataStream &ds, Room::Object &object);
|
||||||
QDataStream &operator<<(QDataStream &ds, const Room &room);
|
QDataStream &operator<<(QDataStream &ds, const Room &room);
|
||||||
QDataStream &operator>>(QDataStream &ds, Room &room);
|
QDataStream &operator>>(QDataStream &ds, Room &room);
|
||||||
|
QDataStream &operator<<(QDataStream &ds, const IncludedFile &includedFile);
|
||||||
|
QDataStream &operator>>(QDataStream &ds, IncludedFile &includedFile);
|
||||||
QDataStream &operator<<(QDataStream &ds, const ProjectContainer &project);;
|
QDataStream &operator<<(QDataStream &ds, const ProjectContainer &project);;
|
||||||
QDataStream &operator>>(QDataStream &ds, ProjectContainer &project);;
|
QDataStream &operator>>(QDataStream &ds, ProjectContainer &project);;
|
||||||
|
Reference in New Issue
Block a user