Implemented a few room property inputs
This commit is contained in:
@@ -22,6 +22,8 @@ INCLUDEPATH += \
|
|||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
src/closeeventfilter.h \
|
src/closeeventfilter.h \
|
||||||
|
src/editor/dialogs/genericcodeeditordialog.h \
|
||||||
|
src/editor/widgets/roomeditwidget.h \
|
||||||
src/futurecpp.h \
|
src/futurecpp.h \
|
||||||
src/projectcontainer.h \
|
src/projectcontainer.h \
|
||||||
src/editor/jshighlighter.h \
|
src/editor/jshighlighter.h \
|
||||||
@@ -50,7 +52,6 @@ HEADERS += \
|
|||||||
src/editor/dialogs/soundpropertiesdialog.h \
|
src/editor/dialogs/soundpropertiesdialog.h \
|
||||||
src/editor/dialogs/spritepropertiesdialog.h \
|
src/editor/dialogs/spritepropertiesdialog.h \
|
||||||
src/editor/dialogs/timelinepropertiesdialog.h \
|
src/editor/dialogs/timelinepropertiesdialog.h \
|
||||||
src/editor/dialogs/triggerconditiondialog.h \
|
|
||||||
src/editor/dialogs/triggersdialog.h \
|
src/editor/dialogs/triggersdialog.h \
|
||||||
src/editor/dialogs/userdefinedconstantsdialog.h \
|
src/editor/dialogs/userdefinedconstantsdialog.h \
|
||||||
src/editor/models/actionscontainermodel.h \
|
src/editor/models/actionscontainermodel.h \
|
||||||
@@ -70,6 +71,8 @@ HEADERS += \
|
|||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
src/closeeventfilter.cpp \
|
src/closeeventfilter.cpp \
|
||||||
|
src/editor/dialogs/genericcodeeditordialog.cpp \
|
||||||
|
src/editor/widgets/roomeditwidget.cpp \
|
||||||
src/main.cpp \
|
src/main.cpp \
|
||||||
src/projectcontainer.cpp \
|
src/projectcontainer.cpp \
|
||||||
src/editor/jshighlighter.cpp \
|
src/editor/jshighlighter.cpp \
|
||||||
@@ -98,7 +101,6 @@ SOURCES += \
|
|||||||
src/editor/dialogs/soundpropertiesdialog.cpp \
|
src/editor/dialogs/soundpropertiesdialog.cpp \
|
||||||
src/editor/dialogs/spritepropertiesdialog.cpp \
|
src/editor/dialogs/spritepropertiesdialog.cpp \
|
||||||
src/editor/dialogs/timelinepropertiesdialog.cpp \
|
src/editor/dialogs/timelinepropertiesdialog.cpp \
|
||||||
src/editor/dialogs/triggerconditiondialog.cpp \
|
|
||||||
src/editor/dialogs/triggersdialog.cpp \
|
src/editor/dialogs/triggersdialog.cpp \
|
||||||
src/editor/dialogs/userdefinedconstantsdialog.cpp \
|
src/editor/dialogs/userdefinedconstantsdialog.cpp \
|
||||||
src/editor/models/actionscontainermodel.cpp \
|
src/editor/models/actionscontainermodel.cpp \
|
||||||
|
BIN
icons/isometric.png
Normal file
BIN
icons/isometric.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
BIN
icons/lock.png
Normal file
BIN
icons/lock.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.2 KiB |
BIN
icons/sort-x.png
Normal file
BIN
icons/sort-x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
BIN
icons/sort-y.png
Normal file
BIN
icons/sort-y.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.4 KiB |
BIN
icons/unlock.png
Normal file
BIN
icons/unlock.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.5 KiB |
@@ -82,5 +82,10 @@
|
|||||||
<file>icons/action.png</file>
|
<file>icons/action.png</file>
|
||||||
<file>icons/code-action.png</file>
|
<file>icons/code-action.png</file>
|
||||||
<file>icons/event-draw.png</file>
|
<file>icons/event-draw.png</file>
|
||||||
|
<file>icons/lock.png</file>
|
||||||
|
<file>icons/unlock.png</file>
|
||||||
|
<file>icons/sort-x.png</file>
|
||||||
|
<file>icons/sort-y.png</file>
|
||||||
|
<file>icons/isometric.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
@@ -22,7 +22,7 @@
|
|||||||
<string>Dra&w</string>
|
<string>Dra&w</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/event-draw.png</normaloff>:/qtgameengine/icons/event-draw.png</iconset>
|
<normaloff>:/qtgameengine/icons/event-draw.png</normaloff>:/qtgameengine/icons/event-draw.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
<string>&Step</string>
|
<string>&Step</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/event-step.png</normaloff>:/qtgameengine/icons/event-step.png</iconset>
|
<normaloff>:/qtgameengine/icons/event-step.png</normaloff>:/qtgameengine/icons/event-step.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
<string>C&reate</string>
|
<string>C&reate</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/event-create.png</normaloff>:/qtgameengine/icons/event-create.png</iconset>
|
<normaloff>:/qtgameengine/icons/event-create.png</normaloff>:/qtgameengine/icons/event-create.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -90,7 +90,7 @@
|
|||||||
<string>&Destroy</string>
|
<string>&Destroy</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/event-destroy.png</normaloff>:/qtgameengine/icons/event-destroy.png</iconset>
|
<normaloff>:/qtgameengine/icons/event-destroy.png</normaloff>:/qtgameengine/icons/event-destroy.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -131,7 +131,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../resources.qrc"/>
|
<include location="../../../resources.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
<string>Dialog</string>
|
<string>Dialog</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowIcon">
|
<property name="windowIcon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/background-file.png</normaloff>:/qtgameengine/icons/background-file.png</iconset>
|
<normaloff>:/qtgameengine/icons/background-file.png</normaloff>:/qtgameengine/icons/background-file.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,1">
|
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,1">
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
<string>&Load Background</string>
|
<string>&Load Background</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/open.png</normaloff>:/qtgameengine/icons/open.png</iconset>
|
<normaloff>:/qtgameengine/icons/open.png</normaloff>:/qtgameengine/icons/open.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -83,7 +83,7 @@
|
|||||||
<string>&Save Background</string>
|
<string>&Save Background</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/save.png</normaloff>:/qtgameengine/icons/save.png</iconset>
|
<normaloff>:/qtgameengine/icons/save.png</normaloff>:/qtgameengine/icons/save.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -97,7 +97,7 @@
|
|||||||
<string>&Edit Background</string>
|
<string>&Edit Background</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/edit.png</normaloff>:/qtgameengine/icons/edit.png</iconset>
|
<normaloff>:/qtgameengine/icons/edit.png</normaloff>:/qtgameengine/icons/edit.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -178,7 +178,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../resources.qrc"/>
|
<include location="../../../resources.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
<string>Code Editor</string>
|
<string>Code Editor</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowIcon">
|
<property name="windowIcon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/script-file.png</normaloff>:/qtgameengine/icons/script-file.png</iconset>
|
<normaloff>:/qtgameengine/icons/script-file.png</normaloff>:/qtgameengine/icons/script-file.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,1">
|
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,1">
|
||||||
@@ -225,7 +225,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
<action name="actionOk">
|
<action name="actionOk">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/ok.png</normaloff>:/qtgameengine/icons/ok.png</iconset>
|
<normaloff>:/qtgameengine/icons/ok.png</normaloff>:/qtgameengine/icons/ok.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -237,7 +237,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionLoad">
|
<action name="actionLoad">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/open.png</normaloff>:/qtgameengine/icons/open.png</iconset>
|
<normaloff>:/qtgameengine/icons/open.png</normaloff>:/qtgameengine/icons/open.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -249,7 +249,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionSave">
|
<action name="actionSave">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/save.png</normaloff>:/qtgameengine/icons/save.png</iconset>
|
<normaloff>:/qtgameengine/icons/save.png</normaloff>:/qtgameengine/icons/save.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -261,7 +261,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionPrint">
|
<action name="actionPrint">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/print.png</normaloff>:/qtgameengine/icons/print.png</iconset>
|
<normaloff>:/qtgameengine/icons/print.png</normaloff>:/qtgameengine/icons/print.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -276,7 +276,7 @@
|
|||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/undo.png</normaloff>:/qtgameengine/icons/undo.png</iconset>
|
<normaloff>:/qtgameengine/icons/undo.png</normaloff>:/qtgameengine/icons/undo.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -291,7 +291,7 @@
|
|||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/redo.png</normaloff>:/qtgameengine/icons/redo.png</iconset>
|
<normaloff>:/qtgameengine/icons/redo.png</normaloff>:/qtgameengine/icons/redo.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -306,7 +306,7 @@
|
|||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/cut.png</normaloff>:/qtgameengine/icons/cut.png</iconset>
|
<normaloff>:/qtgameengine/icons/cut.png</normaloff>:/qtgameengine/icons/cut.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -321,7 +321,7 @@
|
|||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/copy.png</normaloff>:/qtgameengine/icons/copy.png</iconset>
|
<normaloff>:/qtgameengine/icons/copy.png</normaloff>:/qtgameengine/icons/copy.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -333,7 +333,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionPaste">
|
<action name="actionPaste">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/paste.png</normaloff>:/qtgameengine/icons/paste.png</iconset>
|
<normaloff>:/qtgameengine/icons/paste.png</normaloff>:/qtgameengine/icons/paste.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -351,7 +351,7 @@
|
|||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/find.png</normaloff>:/qtgameengine/icons/find.png</iconset>
|
<normaloff>:/qtgameengine/icons/find.png</normaloff>:/qtgameengine/icons/find.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -369,7 +369,7 @@
|
|||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/check.png</normaloff>:/qtgameengine/icons/check.png</iconset>
|
<normaloff>:/qtgameengine/icons/check.png</normaloff>:/qtgameengine/icons/check.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -388,7 +388,7 @@
|
|||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../resources.qrc"/>
|
<include location="../../../resources.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
|
@@ -57,7 +57,7 @@
|
|||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>16384</number>
|
<number>2147483647</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="value">
|
<property name="value">
|
||||||
<number>32</number>
|
<number>32</number>
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QSpinBox" name="spinBoxHeight">
|
<widget class="QSpinBox" name="spinBoxHeight">
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>16384</number>
|
<number>2147483647</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="value">
|
<property name="value">
|
||||||
<number>32</number>
|
<number>32</number>
|
||||||
|
@@ -168,7 +168,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
<action name="actionNew">
|
<action name="actionNew">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/new.png</normaloff>:/qtgameengine/icons/new.png</iconset>
|
<normaloff>:/qtgameengine/icons/new.png</normaloff>:/qtgameengine/icons/new.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -177,7 +177,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionCreateFromFile">
|
<action name="actionCreateFromFile">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/open.png</normaloff>:/qtgameengine/icons/open.png</iconset>
|
<normaloff>:/qtgameengine/icons/open.png</normaloff>:/qtgameengine/icons/open.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -186,7 +186,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionAddFromFile">
|
<action name="actionAddFromFile">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/create-group.png</normaloff>:/qtgameengine/icons/create-group.png</iconset>
|
<normaloff>:/qtgameengine/icons/create-group.png</normaloff>:/qtgameengine/icons/create-group.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -198,7 +198,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionSaveAsPngFile">
|
<action name="actionSaveAsPngFile">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/save.png</normaloff>:/qtgameengine/icons/save.png</iconset>
|
<normaloff>:/qtgameengine/icons/save.png</normaloff>:/qtgameengine/icons/save.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -223,7 +223,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionCloseSavingChanges">
|
<action name="actionCloseSavingChanges">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/ok.png</normaloff>:/qtgameengine/icons/ok.png</iconset>
|
<normaloff>:/qtgameengine/icons/ok.png</normaloff>:/qtgameengine/icons/ok.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -232,7 +232,7 @@
|
|||||||
</action>
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../resources.qrc"/>
|
<include location="../../../resources.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
<string>Font Properties</string>
|
<string>Font Properties</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowIcon">
|
<property name="windowIcon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/font-file.png</normaloff>:/qtgameengine/icons/font-file.png</iconset>
|
<normaloff>:/qtgameengine/icons/font-file.png</normaloff>:/qtgameengine/icons/font-file.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
@@ -220,7 +220,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../resources.qrc"/>
|
<include location="../../../resources.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#include "triggerconditiondialog.h"
|
#include "genericcodeeditordialog.h"
|
||||||
|
|
||||||
TriggerConditionDialog::TriggerConditionDialog(QWidget *parent) :
|
GenericCodeEditorDialog::GenericCodeEditorDialog(const QString &title, QWidget *parent) :
|
||||||
CodeEditorDialog{tr("Trigger condition"), parent}
|
CodeEditorDialog{title, parent}
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_LINUX
|
#ifdef Q_OS_LINUX
|
||||||
setWindowFlags((windowFlags() & ~Qt::Dialog) | Qt::Window);
|
setWindowFlags((windowFlags() & ~Qt::Dialog) | Qt::Window);
|
11
src/editor/dialogs/genericcodeeditordialog.h
Normal file
11
src/editor/dialogs/genericcodeeditordialog.h
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "codeeditordialog.h"
|
||||||
|
|
||||||
|
class GenericCodeEditorDialog : public CodeEditorDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit GenericCodeEditorDialog(const QString &title, QWidget *parent = nullptr);
|
||||||
|
};
|
@@ -176,7 +176,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
<action name="actionNew">
|
<action name="actionNew">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/new.png</normaloff>:/qtgameengine/icons/new.png</iconset>
|
<normaloff>:/qtgameengine/icons/new.png</normaloff>:/qtgameengine/icons/new.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -188,7 +188,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionSaveAsPngFile">
|
<action name="actionSaveAsPngFile">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/save.png</normaloff>:/qtgameengine/icons/save.png</iconset>
|
<normaloff>:/qtgameengine/icons/save.png</normaloff>:/qtgameengine/icons/save.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -200,7 +200,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionPreviousImage">
|
<action name="actionPreviousImage">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/arrow-left.png</normaloff>:/qtgameengine/icons/arrow-left.png</iconset>
|
<normaloff>:/qtgameengine/icons/arrow-left.png</normaloff>:/qtgameengine/icons/arrow-left.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -212,7 +212,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionNextImage">
|
<action name="actionNextImage">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/arrow-right.png</normaloff>:/qtgameengine/icons/arrow-right.png</iconset>
|
<normaloff>:/qtgameengine/icons/arrow-right.png</normaloff>:/qtgameengine/icons/arrow-right.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -224,7 +224,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionCloseSavingChanges">
|
<action name="actionCloseSavingChanges">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/ok.png</normaloff>:/qtgameengine/icons/ok.png</iconset>
|
<normaloff>:/qtgameengine/icons/ok.png</normaloff>:/qtgameengine/icons/ok.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -236,7 +236,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionLoad">
|
<action name="actionLoad">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/open.png</normaloff>:/qtgameengine/icons/open.png</iconset>
|
<normaloff>:/qtgameengine/icons/open.png</normaloff>:/qtgameengine/icons/open.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -245,7 +245,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionUndo">
|
<action name="actionUndo">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/undo.png</normaloff>:/qtgameengine/icons/undo.png</iconset>
|
<normaloff>:/qtgameengine/icons/undo.png</normaloff>:/qtgameengine/icons/undo.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -254,7 +254,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionRedo">
|
<action name="actionRedo">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/redo.png</normaloff>:/qtgameengine/icons/redo.png</iconset>
|
<normaloff>:/qtgameengine/icons/redo.png</normaloff>:/qtgameengine/icons/redo.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -305,7 +305,7 @@
|
|||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../resources.qrc"/>
|
<include location="../../../resources.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
|
@@ -42,7 +42,7 @@
|
|||||||
<string>&Add</string>
|
<string>&Add</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/add.png</normaloff>:/qtgameengine/icons/add.png</iconset>
|
<normaloff>:/qtgameengine/icons/add.png</normaloff>:/qtgameengine/icons/add.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -56,7 +56,7 @@
|
|||||||
<string>&Change</string>
|
<string>&Change</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/replace.png</normaloff>:/qtgameengine/icons/replace.png</iconset>
|
<normaloff>:/qtgameengine/icons/replace.png</normaloff>:/qtgameengine/icons/replace.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -70,7 +70,7 @@
|
|||||||
<string>&Delete</string>
|
<string>&Delete</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/delete.png</normaloff>:/qtgameengine/icons/delete.png</iconset>
|
<normaloff>:/qtgameengine/icons/delete.png</normaloff>:/qtgameengine/icons/delete.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -84,7 +84,7 @@
|
|||||||
<string>&Clear</string>
|
<string>&Clear</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/new.png</normaloff>:/qtgameengine/icons/new.png</iconset>
|
<normaloff>:/qtgameengine/icons/new.png</normaloff>:/qtgameengine/icons/new.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -107,7 +107,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../resources.qrc"/>
|
<include location="../../../resources.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
<string>Information about all Objects</string>
|
<string>Information about all Objects</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowIcon">
|
<property name="windowIcon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/object-file.png</normaloff>:/qtgameengine/icons/object-file.png</iconset>
|
<normaloff>:/qtgameengine/icons/object-file.png</normaloff>:/qtgameengine/icons/object-file.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,1">
|
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,1">
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
<action name="actionOk">
|
<action name="actionOk">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/ok.png</normaloff>:/qtgameengine/icons/ok.png</iconset>
|
<normaloff>:/qtgameengine/icons/ok.png</normaloff>:/qtgameengine/icons/ok.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -70,7 +70,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionSave">
|
<action name="actionSave">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/save.png</normaloff>:/qtgameengine/icons/save.png</iconset>
|
<normaloff>:/qtgameengine/icons/save.png</normaloff>:/qtgameengine/icons/save.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -82,7 +82,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionPrint">
|
<action name="actionPrint">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/print.png</normaloff>:/qtgameengine/icons/print.png</iconset>
|
<normaloff>:/qtgameengine/icons/print.png</normaloff>:/qtgameengine/icons/print.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -94,7 +94,7 @@
|
|||||||
</action>
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../resources.qrc"/>
|
<include location="../../../resources.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
|
@@ -18,7 +18,7 @@ ObjectPropertiesDialog::ObjectPropertiesDialog(Object &object, ProjectTreeModel
|
|||||||
m_projectModel{projectModel},
|
m_projectModel{projectModel},
|
||||||
m_events{m_object.events},
|
m_events{m_object.events},
|
||||||
m_eventsModel{std::make_unique<ObjectEventsModel>(m_events)},
|
m_eventsModel{std::make_unique<ObjectEventsModel>(m_events)},
|
||||||
m_spritesMenu{new QMenu{m_ui->toolButtonSprite}},
|
m_menuSprites{new QMenu{this}},
|
||||||
m_spriteName{object.spriteName}
|
m_spriteName{object.spriteName}
|
||||||
{
|
{
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
@@ -33,7 +33,8 @@ ObjectPropertiesDialog::ObjectPropertiesDialog(Object &object, ProjectTreeModel
|
|||||||
m_ui->lineEditName->setText(m_object.name);
|
m_ui->lineEditName->setText(m_object.name);
|
||||||
m_ui->lineEditSprite->setText(m_spriteName.isEmpty() ? tr("<no sprite>") : m_spriteName);
|
m_ui->lineEditSprite->setText(m_spriteName.isEmpty() ? tr("<no sprite>") : m_spriteName);
|
||||||
updateSpritePreview();
|
updateSpritePreview();
|
||||||
m_ui->toolButtonSprite->setMenu(m_spritesMenu);
|
m_menuSprites->setParent(m_ui->toolButtonSprite);
|
||||||
|
m_ui->toolButtonSprite->setMenu(m_menuSprites);
|
||||||
m_ui->checkBoxVisible->setChecked(m_object.visible);
|
m_ui->checkBoxVisible->setChecked(m_object.visible);
|
||||||
m_ui->checkBoxSolid->setChecked(m_object.solid);
|
m_ui->checkBoxSolid->setChecked(m_object.solid);
|
||||||
m_ui->spinBoxDepth->setValue(m_object.depth);
|
m_ui->spinBoxDepth->setValue(m_object.depth);
|
||||||
@@ -83,7 +84,7 @@ ObjectPropertiesDialog::ObjectPropertiesDialog(Object &object, ProjectTreeModel
|
|||||||
connect(m_ui->checkBoxPersistent, &QCheckBox::toggled,
|
connect(m_ui->checkBoxPersistent, &QCheckBox::toggled,
|
||||||
this, &ObjectPropertiesDialog::changed);
|
this, &ObjectPropertiesDialog::changed);
|
||||||
|
|
||||||
connect(m_spritesMenu, &QMenu::aboutToShow,
|
connect(m_menuSprites, &QMenu::aboutToShow,
|
||||||
this, &ObjectPropertiesDialog::spritesMenuAboutToShow);
|
this, &ObjectPropertiesDialog::spritesMenuAboutToShow);
|
||||||
|
|
||||||
connect(m_ui->listViewEvents->selectionModel(), &QItemSelectionModel::currentChanged,
|
connect(m_ui->listViewEvents->selectionModel(), &QItemSelectionModel::currentChanged,
|
||||||
@@ -289,10 +290,10 @@ void ObjectPropertiesDialog::spritePixmapsChanged(const Sprite &sprite)
|
|||||||
|
|
||||||
void ObjectPropertiesDialog::spritesMenuAboutToShow()
|
void ObjectPropertiesDialog::spritesMenuAboutToShow()
|
||||||
{
|
{
|
||||||
m_spritesMenu->clear();
|
m_menuSprites->clear();
|
||||||
m_spritesMenu->addAction(tr("<no sprite>"), this, &ObjectPropertiesDialog::clearSprite);
|
m_menuSprites->addAction(tr("<no sprite>"), this, &ObjectPropertiesDialog::clearSprite);
|
||||||
for (const auto &sprite : m_projectModel.project()->sprites)
|
for (const auto &sprite : m_projectModel.project()->sprites)
|
||||||
m_spritesMenu->addAction(sprite.pixmaps.empty() ? QPixmap{} : sprite.pixmaps.front(),
|
m_menuSprites->addAction(sprite.pixmaps.empty() ? QPixmap{} : sprite.pixmaps.front(),
|
||||||
sprite.name,
|
sprite.name,
|
||||||
this,
|
this,
|
||||||
[&sprite,this](){ setSprite(sprite); });
|
[&sprite,this](){ setSprite(sprite); });
|
||||||
|
@@ -60,7 +60,7 @@ private:
|
|||||||
|
|
||||||
const std::unique_ptr<ObjectEventsModel> m_eventsModel;
|
const std::unique_ptr<ObjectEventsModel> m_eventsModel;
|
||||||
|
|
||||||
QMenu * const m_spritesMenu;
|
QMenu * const m_menuSprites;
|
||||||
|
|
||||||
QString m_spriteName;
|
QString m_spriteName;
|
||||||
|
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
<string>Object Properties</string>
|
<string>Object Properties</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowIcon">
|
<property name="windowIcon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/object-file.png</normaloff>:/qtgameengine/icons/object-file.png</iconset>
|
<normaloff>:/qtgameengine/icons/object-file.png</normaloff>:/qtgameengine/icons/object-file.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_4" stretch="0,0,1">
|
<layout class="QHBoxLayout" name="horizontalLayout_4" stretch="0,0,1">
|
||||||
@@ -305,7 +305,7 @@
|
|||||||
<string>Show Information</string>
|
<string>Show Information</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/info.png</normaloff>:/qtgameengine/icons/info.png</iconset>
|
<normaloff>:/qtgameengine/icons/info.png</normaloff>:/qtgameengine/icons/info.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -416,7 +416,7 @@
|
|||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../resources.qrc"/>
|
<include location="../../../resources.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
|
@@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
#include <QSpinBox>
|
#include <QSpinBox>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
|
#include <QMenu>
|
||||||
|
#include <QToolButton>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QSignalBlocker>
|
#include <QSignalBlocker>
|
||||||
@@ -16,39 +18,60 @@ PathPropertiesDialog::PathPropertiesDialog(Path &path, ProjectTreeModel &project
|
|||||||
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},
|
||||||
m_points{path.points},
|
m_points{m_path.points},
|
||||||
m_pointsModel{std::make_unique<PathPointsModel>(m_points, this)},
|
m_pointsModel{std::make_unique<PathPointsModel>(m_points, this)},
|
||||||
m_spinBoxSnapX{new QSpinBox{this}},
|
m_spinBoxSnapX{new QSpinBox{this}},
|
||||||
m_spinBoxSnapY{new QSpinBox{this}},
|
m_spinBoxSnapY{new QSpinBox{this}},
|
||||||
|
m_menuRooms{new QMenu{this}},
|
||||||
m_labelX{new QLabel{tr("x: %0").arg(0)}},
|
m_labelX{new QLabel{tr("x: %0").arg(0)}},
|
||||||
m_labelY{new QLabel{tr("y: %0").arg(0)}},
|
m_labelY{new QLabel{tr("y: %0").arg(0)}},
|
||||||
m_labelArea{new QLabel{tr("Area: (%0,%1)->(%2,%3)").arg(0).arg(0).arg(0).arg(0)}}
|
m_labelArea{new QLabel{tr("Area: (%0,%1)->(%2,%3)").arg(0).arg(0).arg(0).arg(0)}}
|
||||||
{
|
{
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
|
|
||||||
m_ui->widget->setPoints(&m_points);
|
m_ui->pathPointsWidget->setPoints(&m_points);
|
||||||
|
m_ui->pathPointsWidget->setSnapX(m_path.snapX);
|
||||||
|
m_ui->pathPointsWidget->setSnapY(m_path.snapY);
|
||||||
|
m_ui->pathPointsWidget->setGridEnabled(m_path.gridEnabled);
|
||||||
|
|
||||||
updateTitle();
|
updateTitle();
|
||||||
|
|
||||||
{
|
{
|
||||||
auto label = new QLabel{tr("Snap X:"), this};
|
int index{18};
|
||||||
label->setBuddy(m_spinBoxSnapX);
|
|
||||||
m_ui->toolBar->insertWidget(m_ui->toolBar->actions().at(18), label);
|
|
||||||
}
|
|
||||||
m_spinBoxSnapX->setValue(m_ui->widget->gridX());
|
|
||||||
m_spinBoxSnapX->setMaximumWidth(50);
|
|
||||||
m_ui->toolBar->insertWidget(m_ui->toolBar->actions().at(19), m_spinBoxSnapX);
|
|
||||||
|
|
||||||
{
|
{
|
||||||
auto label = new QLabel{tr("Snap Y:"), this};
|
auto label = new QLabel{tr("Snap &X:"), this};
|
||||||
label->setBuddy(m_spinBoxSnapY);
|
label->setBuddy(m_spinBoxSnapX);
|
||||||
m_ui->toolBar->insertWidget(m_ui->toolBar->actions().at(20), label);
|
m_ui->toolBar->insertWidget(m_ui->toolBar->actions().at(index++), label);
|
||||||
}
|
}
|
||||||
m_spinBoxSnapY->setValue(m_ui->widget->gridY());
|
m_spinBoxSnapX->setValue(m_ui->pathPointsWidget->snapX());
|
||||||
m_spinBoxSnapY->setMaximumWidth(50);
|
m_spinBoxSnapX->setMaximumWidth(50);
|
||||||
m_ui->toolBar->insertWidget(m_ui->toolBar->actions().at(21), m_spinBoxSnapY);
|
m_ui->toolBar->insertWidget(m_ui->toolBar->actions().at(index++), m_spinBoxSnapX);
|
||||||
|
|
||||||
m_ui->actionGrid->setChecked(m_ui->widget->showGrid());
|
{
|
||||||
|
auto label = new QLabel{tr("Snap &Y:"), this};
|
||||||
|
label->setBuddy(m_spinBoxSnapY);
|
||||||
|
m_ui->toolBar->insertWidget(m_ui->toolBar->actions().at(index++), label);
|
||||||
|
}
|
||||||
|
m_spinBoxSnapY->setValue(m_ui->pathPointsWidget->snapY());
|
||||||
|
m_spinBoxSnapY->setMaximumWidth(50);
|
||||||
|
m_ui->toolBar->insertWidget(m_ui->toolBar->actions().at(index++), m_spinBoxSnapY);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_ui->actionGridEnabled->setChecked(m_ui->pathPointsWidget->gridEnabled());
|
||||||
|
|
||||||
|
{
|
||||||
|
auto toolButton = new QToolButton{this};
|
||||||
|
toolButton->setText(tr("Show"));
|
||||||
|
toolButton->setWhatsThis(tr("Indicate the room to show as background"));
|
||||||
|
toolButton->setIcon(QIcon{":/qtgameengine/icons/room.png"});
|
||||||
|
toolButton->setPopupMode(QToolButton::InstantPopup);
|
||||||
|
toolButton->setMenu(m_menuRooms);
|
||||||
|
m_ui->toolBar->addWidget(toolButton);
|
||||||
|
}
|
||||||
|
|
||||||
|
connect(m_menuRooms, &QMenu::aboutToShow,
|
||||||
|
this, &PathPropertiesDialog::roomsMenuAboutToShow);
|
||||||
|
|
||||||
m_ui->treeView->setModel(m_pointsModel.get());
|
m_ui->treeView->setModel(m_pointsModel.get());
|
||||||
|
|
||||||
@@ -57,7 +80,7 @@ PathPropertiesDialog::PathPropertiesDialog(Path &path, ProjectTreeModel &project
|
|||||||
m_ui->checkBoxClosed->setChecked(m_path.closed);
|
m_ui->checkBoxClosed->setChecked(m_path.closed);
|
||||||
m_ui->spinBoxPrecision->setValue(m_path.precision);
|
m_ui->spinBoxPrecision->setValue(m_path.precision);
|
||||||
|
|
||||||
m_ui->widget->setClosed(m_path.closed);
|
m_ui->pathPointsWidget->setClosed(m_path.closed);
|
||||||
|
|
||||||
m_labelX->setFrameStyle(QFrame::Sunken);
|
m_labelX->setFrameStyle(QFrame::Sunken);
|
||||||
m_ui->statusbar->addWidget(m_labelX, 1);
|
m_ui->statusbar->addWidget(m_labelX, 1);
|
||||||
@@ -76,9 +99,9 @@ PathPropertiesDialog::PathPropertiesDialog(Path &path, ProjectTreeModel &project
|
|||||||
|
|
||||||
m_ui->treeView->setColumnWidth(1, 75);
|
m_ui->treeView->setColumnWidth(1, 75);
|
||||||
|
|
||||||
connect(m_ui->widget, &PathPointsWidget::pointInserted,
|
connect(m_ui->pathPointsWidget, &PathPointsWidget::pointInserted,
|
||||||
m_pointsModel.get(), &PathPointsModel::pointInserted);
|
m_pointsModel.get(), &PathPointsModel::pointInserted);
|
||||||
connect(m_ui->widget, &PathPointsWidget::pointMoved,
|
connect(m_ui->pathPointsWidget, &PathPointsWidget::pointMoved,
|
||||||
m_pointsModel.get(), &PathPointsModel::pointMoved);
|
m_pointsModel.get(), &PathPointsModel::pointMoved);
|
||||||
|
|
||||||
connect(&m_projectModel, &ProjectTreeModel::pathNameChanged,
|
connect(&m_projectModel, &ProjectTreeModel::pathNameChanged,
|
||||||
@@ -87,27 +110,61 @@ PathPropertiesDialog::PathPropertiesDialog(Path &path, ProjectTreeModel &project
|
|||||||
connect(m_ui->treeView->selectionModel(), &QItemSelectionModel::currentChanged,
|
connect(m_ui->treeView->selectionModel(), &QItemSelectionModel::currentChanged,
|
||||||
this, &PathPropertiesDialog::selectionChanged);
|
this, &PathPropertiesDialog::selectionChanged);
|
||||||
|
|
||||||
connect(m_ui->widget, &PathPointsWidget::gridXChanged,
|
connect(m_ui->actionUndo, &QAction::triggered,
|
||||||
|
this, &PathPropertiesDialog::undo);
|
||||||
|
connect(m_ui->actionClear, &QAction::triggered,
|
||||||
|
this, &PathPropertiesDialog::clearPath);
|
||||||
|
connect(m_ui->actionReverse, &QAction::triggered,
|
||||||
|
this, &PathPropertiesDialog::reversePath);
|
||||||
|
connect(m_ui->actionShift, &QAction::triggered,
|
||||||
|
this, &PathPropertiesDialog::shiftPath);
|
||||||
|
connect(m_ui->actionMirrorHorizontally, &QAction::triggered,
|
||||||
|
this, &PathPropertiesDialog::mirrorPathHorizontally);
|
||||||
|
connect(m_ui->actionMirrorVertically, &QAction::triggered,
|
||||||
|
this, &PathPropertiesDialog::mirrorPathVertically);
|
||||||
|
connect(m_ui->actionRotate, &QAction::triggered,
|
||||||
|
this, &PathPropertiesDialog::rotatePath);
|
||||||
|
connect(m_ui->actionScale, &QAction::triggered,
|
||||||
|
this, &PathPropertiesDialog::scalePath);
|
||||||
|
connect(m_ui->actionShiftLeft, &QAction::triggered,
|
||||||
|
this, &PathPropertiesDialog::shiftViewLeft);
|
||||||
|
connect(m_ui->actionShiftRight, &QAction::triggered,
|
||||||
|
this, &PathPropertiesDialog::shiftViewRight);
|
||||||
|
connect(m_ui->actionShiftUp, &QAction::triggered,
|
||||||
|
this, &PathPropertiesDialog::shiftViewUp);
|
||||||
|
connect(m_ui->actionShiftDown, &QAction::triggered,
|
||||||
|
this, &PathPropertiesDialog::shiftViewDown);
|
||||||
|
connect(m_ui->actionCenterView, &QAction::triggered,
|
||||||
|
this, &PathPropertiesDialog::centerView);
|
||||||
|
|
||||||
|
connect(m_ui->pathPointsWidget, &PathPointsWidget::snapXChanged,
|
||||||
m_spinBoxSnapX, &QSpinBox::setValue);
|
m_spinBoxSnapX, &QSpinBox::setValue);
|
||||||
connect(m_ui->widget, &PathPointsWidget::gridYChanged,
|
connect(m_ui->pathPointsWidget, &PathPointsWidget::snapYChanged,
|
||||||
m_spinBoxSnapY, &QSpinBox::setValue);
|
m_spinBoxSnapY, &QSpinBox::setValue);
|
||||||
connect(m_ui->widget, &PathPointsWidget::showGridChanged,
|
connect(m_ui->pathPointsWidget, &PathPointsWidget::gridEnabledChanged,
|
||||||
m_ui->actionGrid, &QAction::setChecked);
|
m_ui->actionGridEnabled, &QAction::setChecked);
|
||||||
connect(m_ui->widget, &PathPointsWidget::closedChanged,
|
connect(m_ui->pathPointsWidget, &PathPointsWidget::closedChanged,
|
||||||
m_ui->checkBoxClosed, &QCheckBox::setChecked);
|
m_ui->checkBoxClosed, &QCheckBox::setChecked);
|
||||||
connect(m_ui->widget, &PathPointsWidget::cursorMoved,
|
connect(m_ui->pathPointsWidget, &PathPointsWidget::cursorMoved,
|
||||||
this, &PathPropertiesDialog::cursorMoved);
|
this, &PathPropertiesDialog::cursorMoved);
|
||||||
connect(m_ui->widget, &PathPointsWidget::selectedIndexChanged,
|
connect(m_ui->pathPointsWidget, &PathPointsWidget::selectedIndexChanged,
|
||||||
this, &PathPropertiesDialog::selectedPointChanged);
|
this, &PathPropertiesDialog::selectedPointChanged);
|
||||||
|
|
||||||
connect(m_spinBoxSnapX, &QSpinBox::valueChanged,
|
connect(m_spinBoxSnapX, &QSpinBox::valueChanged,
|
||||||
m_ui->widget, &PathPointsWidget::setGridX);
|
m_ui->pathPointsWidget, &PathPointsWidget::setSnapX);
|
||||||
connect(m_spinBoxSnapY, &QSpinBox::valueChanged,
|
connect(m_spinBoxSnapY, &QSpinBox::valueChanged,
|
||||||
m_ui->widget, &PathPointsWidget::setGridY);
|
m_ui->pathPointsWidget, &PathPointsWidget::setSnapY);
|
||||||
connect(m_ui->actionGrid, &QAction::toggled,
|
connect(m_ui->actionGridEnabled, &QAction::toggled,
|
||||||
m_ui->widget, &PathPointsWidget::setShowGrid);
|
m_ui->pathPointsWidget, &PathPointsWidget::setGridEnabled);
|
||||||
connect(m_ui->checkBoxClosed, &QCheckBox::toggled,
|
connect(m_ui->checkBoxClosed, &QCheckBox::toggled,
|
||||||
m_ui->widget, &PathPointsWidget::setClosed);
|
m_ui->pathPointsWidget, &PathPointsWidget::setClosed);
|
||||||
|
|
||||||
|
connect(m_spinBoxSnapX, &QSpinBox::valueChanged,
|
||||||
|
this, &PathPropertiesDialog::changed);
|
||||||
|
connect(m_spinBoxSnapY, &QSpinBox::valueChanged,
|
||||||
|
this, &PathPropertiesDialog::changed);
|
||||||
|
connect(m_ui->actionGridEnabled, &QAction::toggled,
|
||||||
|
this, &PathPropertiesDialog::changed);
|
||||||
|
|
||||||
connect(m_ui->spinBoxX, &QSpinBox::valueChanged,
|
connect(m_ui->spinBoxX, &QSpinBox::valueChanged,
|
||||||
this, &PathPropertiesDialog::pointFieldsChanged);
|
this, &PathPropertiesDialog::pointFieldsChanged);
|
||||||
@@ -129,17 +186,17 @@ PathPropertiesDialog::PathPropertiesDialog(Path &path, ProjectTreeModel &project
|
|||||||
connect(m_pointsModel.get(), &QAbstractTableModel::rowsInserted,
|
connect(m_pointsModel.get(), &QAbstractTableModel::rowsInserted,
|
||||||
this, &PathPropertiesDialog::changed);
|
this, &PathPropertiesDialog::changed);
|
||||||
connect(m_pointsModel.get(), &QAbstractTableModel::rowsInserted,
|
connect(m_pointsModel.get(), &QAbstractTableModel::rowsInserted,
|
||||||
m_ui->widget, qOverload<>(&PathPointsWidget::update));
|
m_ui->pathPointsWidget, qOverload<>(&PathPointsWidget::update));
|
||||||
connect(m_pointsModel.get(), &QAbstractTableModel::rowsRemoved,
|
connect(m_pointsModel.get(), &QAbstractTableModel::rowsRemoved,
|
||||||
this, &PathPropertiesDialog::changed);
|
this, &PathPropertiesDialog::changed);
|
||||||
connect(m_pointsModel.get(), &QAbstractTableModel::rowsRemoved,
|
connect(m_pointsModel.get(), &QAbstractTableModel::rowsRemoved,
|
||||||
m_ui->widget, qOverload<>(&PathPointsWidget::update));
|
m_ui->pathPointsWidget, qOverload<>(&PathPointsWidget::update));
|
||||||
connect(m_pointsModel.get(), &QAbstractTableModel::dataChanged,
|
connect(m_pointsModel.get(), &QAbstractTableModel::dataChanged,
|
||||||
this, &PathPropertiesDialog::dataChanged);
|
this, &PathPropertiesDialog::dataChanged);
|
||||||
connect(m_pointsModel.get(), &QAbstractTableModel::dataChanged,
|
connect(m_pointsModel.get(), &QAbstractTableModel::dataChanged,
|
||||||
this, &PathPropertiesDialog::changed);
|
this, &PathPropertiesDialog::changed);
|
||||||
connect(m_pointsModel.get(), &QAbstractTableModel::dataChanged,
|
connect(m_pointsModel.get(), &QAbstractTableModel::dataChanged,
|
||||||
m_ui->widget, qOverload<>(&PathPointsWidget::update));
|
m_ui->pathPointsWidget, qOverload<>(&PathPointsWidget::update));
|
||||||
connect(m_ui->radioButtonStraight, &QRadioButton::toggled,
|
connect(m_ui->radioButtonStraight, &QRadioButton::toggled,
|
||||||
this, &PathPropertiesDialog::changed);
|
this, &PathPropertiesDialog::changed);
|
||||||
connect(m_ui->radioButtonSmooth, &QRadioButton::toggled,
|
connect(m_ui->radioButtonSmooth, &QRadioButton::toggled,
|
||||||
@@ -183,8 +240,9 @@ void PathPropertiesDialog::accept()
|
|||||||
|
|
||||||
m_path.closed = m_ui->checkBoxClosed->isChecked();
|
m_path.closed = m_ui->checkBoxClosed->isChecked();
|
||||||
m_path.precision = m_ui->spinBoxPrecision->value();
|
m_path.precision = m_ui->spinBoxPrecision->value();
|
||||||
|
m_path.snapX = m_spinBoxSnapX->value();
|
||||||
// TODO update points
|
m_path.snapY = m_spinBoxSnapY->value();
|
||||||
|
m_path.gridEnabled = m_ui->actionGridEnabled->isChecked();
|
||||||
|
|
||||||
QDialog::accept();
|
QDialog::accept();
|
||||||
}
|
}
|
||||||
@@ -223,11 +281,11 @@ void PathPropertiesDialog::selectionChanged(const QModelIndex &index)
|
|||||||
{
|
{
|
||||||
if (!index.isValid())
|
if (!index.isValid())
|
||||||
{
|
{
|
||||||
m_ui->widget->setSelectedIndex(std::nullopt);
|
m_ui->pathPointsWidget->setSelectedIndex(std::nullopt);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_ui->widget->setSelectedIndex(index.row());
|
m_ui->pathPointsWidget->setSelectedIndex(index.row());
|
||||||
|
|
||||||
updatePointFields();
|
updatePointFields();
|
||||||
}
|
}
|
||||||
@@ -284,6 +342,71 @@ void PathPropertiesDialog::deletePoint()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PathPropertiesDialog::undo()
|
||||||
|
{
|
||||||
|
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void PathPropertiesDialog::clearPath()
|
||||||
|
{
|
||||||
|
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void PathPropertiesDialog::reversePath()
|
||||||
|
{
|
||||||
|
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void PathPropertiesDialog::shiftPath()
|
||||||
|
{
|
||||||
|
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void PathPropertiesDialog::mirrorPathHorizontally()
|
||||||
|
{
|
||||||
|
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void PathPropertiesDialog::mirrorPathVertically()
|
||||||
|
{
|
||||||
|
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void PathPropertiesDialog::rotatePath()
|
||||||
|
{
|
||||||
|
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void PathPropertiesDialog::scalePath()
|
||||||
|
{
|
||||||
|
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void PathPropertiesDialog::shiftViewLeft()
|
||||||
|
{
|
||||||
|
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void PathPropertiesDialog::shiftViewRight()
|
||||||
|
{
|
||||||
|
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void PathPropertiesDialog::shiftViewUp()
|
||||||
|
{
|
||||||
|
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void PathPropertiesDialog::shiftViewDown()
|
||||||
|
{
|
||||||
|
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void PathPropertiesDialog::centerView()
|
||||||
|
{
|
||||||
|
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
||||||
|
}
|
||||||
|
|
||||||
void PathPropertiesDialog::pointFieldsChanged()
|
void PathPropertiesDialog::pointFieldsChanged()
|
||||||
{
|
{
|
||||||
const auto index = m_ui->treeView->currentIndex();
|
const auto index = m_ui->treeView->currentIndex();
|
||||||
@@ -321,6 +444,18 @@ void PathPropertiesDialog::pathNameChanged(const Path &path)
|
|||||||
updateTitle();
|
updateTitle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PathPropertiesDialog::roomsMenuAboutToShow()
|
||||||
|
{
|
||||||
|
m_menuRooms->clear();
|
||||||
|
qDebug() << "called" << tr("No Room");
|
||||||
|
m_menuRooms->addAction(tr("No Room"));
|
||||||
|
for (const auto &room : m_projectModel.project()->rooms)
|
||||||
|
{
|
||||||
|
qDebug() << "called" << room.name;
|
||||||
|
m_menuRooms->addAction(room.name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void PathPropertiesDialog::updateTitle()
|
void PathPropertiesDialog::updateTitle()
|
||||||
{
|
{
|
||||||
setWindowTitle(tr("Path Properties: %0%1")
|
setWindowTitle(tr("Path Properties: %0%1")
|
||||||
|
@@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
class QSpinBox;
|
class QSpinBox;
|
||||||
class QLabel;
|
class QLabel;
|
||||||
|
class QMenu;
|
||||||
namespace Ui { class PathPropertiesDialog; }
|
namespace Ui { class PathPropertiesDialog; }
|
||||||
class ProjectTreeModel;
|
class ProjectTreeModel;
|
||||||
class PathPointsModel;
|
class PathPointsModel;
|
||||||
@@ -34,11 +35,27 @@ private slots:
|
|||||||
void insertPoint();
|
void insertPoint();
|
||||||
void deletePoint();
|
void deletePoint();
|
||||||
|
|
||||||
|
void undo();
|
||||||
|
void clearPath();
|
||||||
|
void reversePath();
|
||||||
|
void shiftPath();
|
||||||
|
void mirrorPathHorizontally();
|
||||||
|
void mirrorPathVertically();
|
||||||
|
void rotatePath();
|
||||||
|
void scalePath();
|
||||||
|
void shiftViewLeft();
|
||||||
|
void shiftViewRight();
|
||||||
|
void shiftViewUp();
|
||||||
|
void shiftViewDown();
|
||||||
|
void centerView();
|
||||||
|
|
||||||
void pointFieldsChanged();
|
void pointFieldsChanged();
|
||||||
void changed();
|
void changed();
|
||||||
|
|
||||||
void pathNameChanged(const Path &path);
|
void pathNameChanged(const Path &path);
|
||||||
|
|
||||||
|
void roomsMenuAboutToShow();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateTitle();
|
void updateTitle();
|
||||||
void updatePointFields();
|
void updatePointFields();
|
||||||
@@ -59,6 +76,8 @@ private:
|
|||||||
QSpinBox * const m_spinBoxSnapX;
|
QSpinBox * const m_spinBoxSnapX;
|
||||||
QSpinBox * const m_spinBoxSnapY;
|
QSpinBox * const m_spinBoxSnapY;
|
||||||
|
|
||||||
|
QMenu * const m_menuRooms;
|
||||||
|
|
||||||
QLabel * const m_labelX;
|
QLabel * const m_labelX;
|
||||||
QLabel * const m_labelY;
|
QLabel * const m_labelY;
|
||||||
QLabel * const m_labelArea;
|
QLabel * const m_labelArea;
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
<string>Path Properties</string>
|
<string>Path Properties</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowIcon">
|
<property name="windowIcon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/path-file.png</normaloff>:/qtgameengine/icons/path-file.png</iconset>
|
<normaloff>:/qtgameengine/icons/path-file.png</normaloff>:/qtgameengine/icons/path-file.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2" stretch="0,1">
|
<layout class="QVBoxLayout" name="verticalLayout_2" stretch="0,1">
|
||||||
@@ -79,19 +79,18 @@
|
|||||||
<addaction name="actionReverse"/>
|
<addaction name="actionReverse"/>
|
||||||
<addaction name="actionShift"/>
|
<addaction name="actionShift"/>
|
||||||
<addaction name="actionMirrorHorizontally"/>
|
<addaction name="actionMirrorHorizontally"/>
|
||||||
<addaction name="actionFlipVertically"/>
|
<addaction name="actionMirrorVertically"/>
|
||||||
<addaction name="actionRotate"/>
|
<addaction name="actionRotate"/>
|
||||||
<addaction name="actionScale"/>
|
<addaction name="actionScale"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
<addaction name="actionShiftLeft"/>
|
<addaction name="actionShiftLeft"/>
|
||||||
<addaction name="actionShiftRight"/>
|
<addaction name="actionShiftRight"/>
|
||||||
<addaction name="actionShiftTop"/>
|
<addaction name="actionShiftUp"/>
|
||||||
<addaction name="actionShift_bottom"/>
|
<addaction name="actionShiftDown"/>
|
||||||
<addaction name="actionCenterView"/>
|
<addaction name="actionCenterView"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
<addaction name="actionGrid"/>
|
<addaction name="actionGridEnabled"/>
|
||||||
<addaction name="actionRoom"/>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
@@ -158,6 +157,9 @@
|
|||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="headerHidden">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
@@ -196,7 +198,7 @@
|
|||||||
<string>X-coordinate of the point</string>
|
<string>X-coordinate of the point</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>16384</number>
|
<number>2147483647</number>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -216,7 +218,7 @@
|
|||||||
<string>Y-coordinate of the point</string>
|
<string>Y-coordinate of the point</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>16384</number>
|
<number>2147483647</number>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -236,7 +238,7 @@
|
|||||||
<string>Relative speed at this point (100 = default)</string>
|
<string>Relative speed at this point (100 = default)</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>16384</number>
|
<number>2147483647</number>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -391,7 +393,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_7" stretch="1,0">
|
<layout class="QVBoxLayout" name="verticalLayout_7" stretch="1,0">
|
||||||
<item>
|
<item>
|
||||||
<widget class="PathPointsWidget" name="widget" native="true">
|
<widget class="PathPointsWidget" name="pathPointsWidget" native="true">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>300</width>
|
<width>300</width>
|
||||||
@@ -410,7 +412,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
<action name="actionOk">
|
<action name="actionOk">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/ok.png</normaloff>:/qtgameengine/icons/ok.png</iconset>
|
<normaloff>:/qtgameengine/icons/ok.png</normaloff>:/qtgameengine/icons/ok.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -422,7 +424,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionUndo">
|
<action name="actionUndo">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/undo.png</normaloff>:/qtgameengine/icons/undo.png</iconset>
|
<normaloff>:/qtgameengine/icons/undo.png</normaloff>:/qtgameengine/icons/undo.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -434,7 +436,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionClear">
|
<action name="actionClear">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/new.png</normaloff>:/qtgameengine/icons/new.png</iconset>
|
<normaloff>:/qtgameengine/icons/new.png</normaloff>:/qtgameengine/icons/new.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -446,7 +448,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionReverse">
|
<action name="actionReverse">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/rotate.png</normaloff>:/qtgameengine/icons/rotate.png</iconset>
|
<normaloff>:/qtgameengine/icons/rotate.png</normaloff>:/qtgameengine/icons/rotate.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -458,7 +460,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionShift">
|
<action name="actionShift">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/move.png</normaloff>:/qtgameengine/icons/move.png</iconset>
|
<normaloff>:/qtgameengine/icons/move.png</normaloff>:/qtgameengine/icons/move.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -470,7 +472,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionMirrorHorizontally">
|
<action name="actionMirrorHorizontally">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/flip-horizontal.png</normaloff>:/qtgameengine/icons/flip-horizontal.png</iconset>
|
<normaloff>:/qtgameengine/icons/flip-horizontal.png</normaloff>:/qtgameengine/icons/flip-horizontal.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -480,9 +482,9 @@
|
|||||||
<string>Mirror the path horizontally</string>
|
<string>Mirror the path horizontally</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionFlipVertically">
|
<action name="actionMirrorVertically">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/flip-vertical.png</normaloff>:/qtgameengine/icons/flip-vertical.png</iconset>
|
<normaloff>:/qtgameengine/icons/flip-vertical.png</normaloff>:/qtgameengine/icons/flip-vertical.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -494,7 +496,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionRotate">
|
<action name="actionRotate">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/rotate.png</normaloff>:/qtgameengine/icons/rotate.png</iconset>
|
<normaloff>:/qtgameengine/icons/rotate.png</normaloff>:/qtgameengine/icons/rotate.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -506,7 +508,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionScale">
|
<action name="actionScale">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/scale.png</normaloff>:/qtgameengine/icons/scale.png</iconset>
|
<normaloff>:/qtgameengine/icons/scale.png</normaloff>:/qtgameengine/icons/scale.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -518,7 +520,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionShiftLeft">
|
<action name="actionShiftLeft">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/arrow-left.png</normaloff>:/qtgameengine/icons/arrow-left.png</iconset>
|
<normaloff>:/qtgameengine/icons/arrow-left.png</normaloff>:/qtgameengine/icons/arrow-left.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -530,7 +532,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionShiftRight">
|
<action name="actionShiftRight">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/arrow-right.png</normaloff>:/qtgameengine/icons/arrow-right.png</iconset>
|
<normaloff>:/qtgameengine/icons/arrow-right.png</normaloff>:/qtgameengine/icons/arrow-right.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -540,9 +542,9 @@
|
|||||||
<string>Shift the view to the right</string>
|
<string>Shift the view to the right</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionShiftTop">
|
<action name="actionShiftUp">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/arrow-up.png</normaloff>:/qtgameengine/icons/arrow-up.png</iconset>
|
<normaloff>:/qtgameengine/icons/arrow-up.png</normaloff>:/qtgameengine/icons/arrow-up.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -552,9 +554,9 @@
|
|||||||
<string>Shift the view to the top</string>
|
<string>Shift the view to the top</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionShift_bottom">
|
<action name="actionShiftDown">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/arrow-down.png</normaloff>:/qtgameengine/icons/arrow-down.png</iconset>
|
<normaloff>:/qtgameengine/icons/arrow-down.png</normaloff>:/qtgameengine/icons/arrow-down.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -566,7 +568,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionCenterView">
|
<action name="actionCenterView">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/center.png</normaloff>:/qtgameengine/icons/center.png</iconset>
|
<normaloff>:/qtgameengine/icons/center.png</normaloff>:/qtgameengine/icons/center.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -576,7 +578,7 @@
|
|||||||
<string>Center view around the path</string>
|
<string>Center view around the path</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionGrid">
|
<action name="actionGridEnabled">
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@@ -584,7 +586,7 @@
|
|||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/grid.png</normaloff>:/qtgameengine/icons/grid.png</iconset>
|
<normaloff>:/qtgameengine/icons/grid.png</normaloff>:/qtgameengine/icons/grid.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -594,18 +596,6 @@
|
|||||||
<string>Toggle the showing of the grid</string>
|
<string>Toggle the showing of the grid</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionRoom">
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="../resources.qrc">
|
|
||||||
<normaloff>:/qtgameengine/icons/room.png</normaloff>:/qtgameengine/icons/room.png</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Room</string>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Indicate the room to show as background</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
@@ -616,7 +606,7 @@
|
|||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../resources.qrc"/>
|
<include location="../../../resources.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
|
@@ -1,14 +1,306 @@
|
|||||||
#include "roompropertiesdialog.h"
|
#include "roompropertiesdialog.h"
|
||||||
#include "ui_roompropertiesdialog.h"
|
#include "ui_roompropertiesdialog.h"
|
||||||
|
|
||||||
|
#include <QSpinBox>
|
||||||
|
#include <QLabel>
|
||||||
|
#include <QToolButton>
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
|
#include "projectcontainer.h"
|
||||||
|
#include "models/projecttreemodel.h"
|
||||||
|
#include "genericcodeeditordialog.h"
|
||||||
|
|
||||||
RoomPropertiesDialog::RoomPropertiesDialog(Room &room, ProjectTreeModel &projectModel, QWidget *parent) :
|
RoomPropertiesDialog::RoomPropertiesDialog(Room &room, ProjectTreeModel &projectModel, QWidget *parent) :
|
||||||
QDialog{parent},
|
QDialog{parent},
|
||||||
m_ui{std::make_unique<Ui::RoomPropertiesDialog>()}
|
m_ui{std::make_unique<Ui::RoomPropertiesDialog>()},
|
||||||
|
m_room{room},
|
||||||
|
m_projectModel{projectModel},
|
||||||
|
m_creationCode{m_room.creationCode},
|
||||||
|
m_spinBoxSnapX{new QSpinBox{this}},
|
||||||
|
m_spinBoxSnapY{new QSpinBox{this}},
|
||||||
|
m_labelX{new QLabel{tr("x: %0").arg(0)}},
|
||||||
|
m_labelY{new QLabel{tr("y: %0").arg(0)}}
|
||||||
{
|
{
|
||||||
Q_UNUSED(room)
|
|
||||||
Q_UNUSED(projectModel)
|
|
||||||
|
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
|
|
||||||
|
updateTitle();
|
||||||
|
|
||||||
|
m_ui->roomEditWidget->setFixedWidth(m_room.width);
|
||||||
|
m_ui->roomEditWidget->setFixedHeight(m_room.height);
|
||||||
|
m_ui->roomEditWidget->setSnapX(m_room.snapX);
|
||||||
|
m_ui->roomEditWidget->setSnapY(m_room.snapY);
|
||||||
|
m_ui->roomEditWidget->setGridEnabled(m_room.gridEnabled);
|
||||||
|
m_ui->roomEditWidget->setIsometricGrid(m_room.isometricGrid);
|
||||||
|
|
||||||
|
{
|
||||||
|
int index{11};
|
||||||
|
|
||||||
|
{
|
||||||
|
auto label = new QLabel{tr("Snap &X:"), this};
|
||||||
|
label->setBuddy(m_spinBoxSnapX);
|
||||||
|
m_ui->toolBar->insertWidget(m_ui->toolBar->actions().at(index++), label);
|
||||||
|
}
|
||||||
|
m_spinBoxSnapX->setValue(m_ui->roomEditWidget->snapX());
|
||||||
|
m_spinBoxSnapX->setMaximumWidth(50);
|
||||||
|
m_ui->toolBar->insertWidget(m_ui->toolBar->actions().at(index++), m_spinBoxSnapX);
|
||||||
|
|
||||||
|
{
|
||||||
|
auto label = new QLabel{tr("Snap &Y:"), this};
|
||||||
|
label->setBuddy(m_spinBoxSnapY);
|
||||||
|
m_ui->toolBar->insertWidget(m_ui->toolBar->actions().at(index++), label);
|
||||||
|
}
|
||||||
|
m_spinBoxSnapY->setValue(m_ui->roomEditWidget->snapY());
|
||||||
|
m_spinBoxSnapY->setMaximumWidth(50);
|
||||||
|
m_ui->toolBar->insertWidget(m_ui->toolBar->actions().at(index++), m_spinBoxSnapY);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_ui->actionGridEnabled->setChecked(m_ui->roomEditWidget->gridEnabled());
|
||||||
|
m_ui->actionIsometricGrid->setChecked(m_ui->roomEditWidget->isometricGrid());
|
||||||
|
|
||||||
|
{
|
||||||
|
auto toolButton = new QToolButton{this};
|
||||||
|
toolButton->setText(tr("Show"));
|
||||||
|
toolButton->setIcon(QIcon{":/qtgameengine/icons/find.png"});
|
||||||
|
toolButton->setPopupMode(QToolButton::InstantPopup);
|
||||||
|
toolButton->addAction(m_ui->actionShowObjects);
|
||||||
|
toolButton->addAction(m_ui->actionShowTiles);
|
||||||
|
toolButton->addAction(m_ui->actionShowBackgrounds);
|
||||||
|
toolButton->addAction(m_ui->actionShowForegrounds);
|
||||||
|
toolButton->addAction(m_ui->actionShowViews);
|
||||||
|
m_ui->toolBar->addWidget(toolButton);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_ui->scrollArea->setBackgroundRole(QPalette::Dark);
|
||||||
|
|
||||||
|
m_labelX->setFrameStyle(QFrame::Sunken);
|
||||||
|
m_ui->statusbar->addWidget(m_labelX, 1);
|
||||||
|
m_labelY->setFrameStyle(QFrame::Sunken);
|
||||||
|
m_ui->statusbar->addWidget(m_labelY, 1);
|
||||||
|
|
||||||
|
{
|
||||||
|
auto frame = new QFrame{this};
|
||||||
|
frame->setFrameStyle(QFrame::Sunken);
|
||||||
|
m_ui->statusbar->addPermanentWidget(frame, 4);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_ui->lineEditName->setText(m_room.name);
|
||||||
|
m_ui->lineEditCaption->setText(m_room.caption);
|
||||||
|
m_ui->spinBoxWidth->setValue(m_ui->roomEditWidget->width());
|
||||||
|
m_ui->spinBoxHeight->setValue(m_ui->roomEditWidget->height());
|
||||||
|
m_ui->spinBoxSpeed->setValue(m_room.speed);
|
||||||
|
m_ui->checkBoxPersistent->setChecked(m_room.persistent);
|
||||||
|
|
||||||
|
connect(&m_projectModel, &ProjectTreeModel::roomNameChanged,
|
||||||
|
this, &RoomPropertiesDialog::roomNameChanged);
|
||||||
|
|
||||||
|
connect(m_ui->actionUndo, &QAction::triggered,
|
||||||
|
this, &RoomPropertiesDialog::undo);
|
||||||
|
connect(m_ui->actionClear, &QAction::triggered,
|
||||||
|
this, &RoomPropertiesDialog::undo);
|
||||||
|
connect(m_ui->actionShift, &QAction::triggered,
|
||||||
|
this, &RoomPropertiesDialog::undo);
|
||||||
|
connect(m_ui->actionSortX, &QAction::triggered,
|
||||||
|
this, &RoomPropertiesDialog::undo);
|
||||||
|
connect(m_ui->actionSortY, &QAction::triggered,
|
||||||
|
this, &RoomPropertiesDialog::undo);
|
||||||
|
connect(m_ui->actionLock, &QAction::triggered,
|
||||||
|
this, &RoomPropertiesDialog::undo);
|
||||||
|
connect(m_ui->actionUnlock, &QAction::triggered,
|
||||||
|
this, &RoomPropertiesDialog::undo);
|
||||||
|
|
||||||
|
connect(m_spinBoxSnapX, &QSpinBox::valueChanged,
|
||||||
|
m_ui->roomEditWidget, &RoomEditWidget::setSnapX);
|
||||||
|
connect(m_spinBoxSnapY, &QSpinBox::valueChanged,
|
||||||
|
m_ui->roomEditWidget, &RoomEditWidget::setSnapY);
|
||||||
|
connect(m_ui->actionGridEnabled, &QAction::toggled,
|
||||||
|
m_ui->roomEditWidget, &RoomEditWidget::setGridEnabled);
|
||||||
|
connect(m_ui->actionIsometricGrid, &QAction::toggled,
|
||||||
|
m_ui->roomEditWidget, &RoomEditWidget::setIsometricGrid);
|
||||||
|
|
||||||
|
connect(m_ui->spinBoxWidth, &QSpinBox::valueChanged,
|
||||||
|
m_ui->roomEditWidget, &RoomEditWidget::setFixedWidth);
|
||||||
|
connect(m_ui->spinBoxHeight, &QSpinBox::valueChanged,
|
||||||
|
m_ui->roomEditWidget, &RoomEditWidget::setFixedHeight);
|
||||||
|
|
||||||
|
connect(m_spinBoxSnapX, &QSpinBox::valueChanged,
|
||||||
|
this, &RoomPropertiesDialog::changed);
|
||||||
|
connect(m_spinBoxSnapY, &QSpinBox::valueChanged,
|
||||||
|
this, &RoomPropertiesDialog::changed);
|
||||||
|
connect(m_ui->actionGridEnabled, &QAction::toggled,
|
||||||
|
this, &RoomPropertiesDialog::changed);
|
||||||
|
connect(m_ui->actionIsometricGrid, &QAction::toggled,
|
||||||
|
this, &RoomPropertiesDialog::changed);
|
||||||
|
|
||||||
|
connect(m_ui->lineEditName, &QLineEdit::textChanged,
|
||||||
|
this, &RoomPropertiesDialog::changed);
|
||||||
|
connect(m_ui->lineEditCaption, &QLineEdit::textChanged,
|
||||||
|
this, &RoomPropertiesDialog::changed);
|
||||||
|
connect(m_ui->spinBoxWidth, &QSpinBox::valueChanged,
|
||||||
|
this, &RoomPropertiesDialog::changed);
|
||||||
|
connect(m_ui->spinBoxHeight, &QSpinBox::valueChanged,
|
||||||
|
this, &RoomPropertiesDialog::changed);
|
||||||
|
connect(m_ui->spinBoxSpeed, &QSpinBox::valueChanged,
|
||||||
|
this, &RoomPropertiesDialog::changed);
|
||||||
|
connect(m_ui->checkBoxPersistent, &QCheckBox::toggled,
|
||||||
|
this, &RoomPropertiesDialog::changed);
|
||||||
|
|
||||||
|
connect(m_ui->pushButtonCreationCode, &QAbstractButton::clicked,
|
||||||
|
this, &RoomPropertiesDialog::editCreationCode);
|
||||||
|
|
||||||
|
connect(m_ui->roomEditWidget, &RoomEditWidget::snapXChanged,
|
||||||
|
m_spinBoxSnapX, &QSpinBox::setValue);
|
||||||
|
connect(m_ui->roomEditWidget, &RoomEditWidget::snapYChanged,
|
||||||
|
m_spinBoxSnapY, &QSpinBox::setValue);
|
||||||
|
connect(m_ui->roomEditWidget, &RoomEditWidget::gridEnabledChanged,
|
||||||
|
m_ui->actionGridEnabled, &QAction::setChecked);
|
||||||
|
connect(m_ui->roomEditWidget, &RoomEditWidget::isometricGridChanged,
|
||||||
|
m_ui->actionIsometricGrid, &QAction::setChecked);
|
||||||
|
connect(m_ui->roomEditWidget, &RoomEditWidget::cursorMoved,
|
||||||
|
this, &RoomPropertiesDialog::cursorMoved);
|
||||||
}
|
}
|
||||||
|
|
||||||
RoomPropertiesDialog::~RoomPropertiesDialog() = default;
|
RoomPropertiesDialog::~RoomPropertiesDialog() = default;
|
||||||
|
|
||||||
|
void RoomPropertiesDialog::accept()
|
||||||
|
{
|
||||||
|
if (!m_unsavedChanges)
|
||||||
|
{
|
||||||
|
QDialog::reject();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_room.name != m_ui->lineEditName->text())
|
||||||
|
{
|
||||||
|
if (!m_projectModel.rename<Room>(m_room, m_ui->lineEditName->text()))
|
||||||
|
{
|
||||||
|
QMessageBox::critical(this, tr("Renaming Room failed!"), tr("Renaming Room failed!"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
m_room.caption = m_ui->lineEditCaption->text();
|
||||||
|
m_room.width = m_ui->spinBoxWidth->value();
|
||||||
|
m_room.height = m_ui->spinBoxHeight->value();
|
||||||
|
m_room.speed = m_ui->spinBoxSpeed->value();
|
||||||
|
m_room.persistent = m_ui->checkBoxPersistent->isChecked();
|
||||||
|
m_room.creationCode = m_creationCode;
|
||||||
|
m_room.snapX = m_spinBoxSnapX->value();
|
||||||
|
m_room.snapY = m_spinBoxSnapY->value();
|
||||||
|
m_room.gridEnabled = m_ui->actionGridEnabled->isChecked();
|
||||||
|
m_room.isometricGrid = m_ui->actionIsometricGrid->isChecked();
|
||||||
|
|
||||||
|
QDialog::accept();
|
||||||
|
}
|
||||||
|
|
||||||
|
void RoomPropertiesDialog::reject()
|
||||||
|
{
|
||||||
|
if (!m_unsavedChanges)
|
||||||
|
{
|
||||||
|
QDialog::reject();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const auto result = QMessageBox::warning(
|
||||||
|
this,
|
||||||
|
tr("The Room has been modified."),
|
||||||
|
tr("Do you want to save your changes?"),
|
||||||
|
QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel,
|
||||||
|
QMessageBox::Save
|
||||||
|
);
|
||||||
|
switch (result)
|
||||||
|
{
|
||||||
|
case QMessageBox::Save:
|
||||||
|
accept();
|
||||||
|
return;
|
||||||
|
case QMessageBox::Discard:
|
||||||
|
QDialog::reject();
|
||||||
|
return;
|
||||||
|
case QMessageBox::Cancel:
|
||||||
|
return;
|
||||||
|
default:
|
||||||
|
qWarning() << "unexpected dialog result" << result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void RoomPropertiesDialog::undo()
|
||||||
|
{
|
||||||
|
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void RoomPropertiesDialog::clearInstances()
|
||||||
|
{
|
||||||
|
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void RoomPropertiesDialog::shiftInstances()
|
||||||
|
{
|
||||||
|
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void RoomPropertiesDialog::sortInstancesX()
|
||||||
|
{
|
||||||
|
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void RoomPropertiesDialog::sortInstancesY()
|
||||||
|
{
|
||||||
|
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void RoomPropertiesDialog::lockInstances()
|
||||||
|
{
|
||||||
|
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void RoomPropertiesDialog::unlockInstances()
|
||||||
|
{
|
||||||
|
QMessageBox::warning(this, tr("Not yet implemented"), tr("Not yet implemented"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void RoomPropertiesDialog::editCreationCode()
|
||||||
|
{
|
||||||
|
GenericCodeEditorDialog dialog{tr("Room Creation Code"), this};
|
||||||
|
dialog.setScript(m_creationCode);
|
||||||
|
if (dialog.exec() == QDialog::Accepted)
|
||||||
|
{
|
||||||
|
m_creationCode = dialog.script();
|
||||||
|
changed();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void RoomPropertiesDialog::changed()
|
||||||
|
{
|
||||||
|
if (!m_unsavedChanges)
|
||||||
|
{
|
||||||
|
m_unsavedChanges = true;
|
||||||
|
updateTitle();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void RoomPropertiesDialog::roomNameChanged(const Room &room)
|
||||||
|
{
|
||||||
|
if (&room != &m_room)
|
||||||
|
return;
|
||||||
|
|
||||||
|
{
|
||||||
|
QSignalBlocker blocker{m_ui->lineEditName};
|
||||||
|
m_ui->lineEditName->setText(room.name);
|
||||||
|
}
|
||||||
|
|
||||||
|
updateTitle();
|
||||||
|
}
|
||||||
|
|
||||||
|
void RoomPropertiesDialog::cursorMoved(const QPoint &point)
|
||||||
|
{
|
||||||
|
m_labelX->setText(tr("X: %0").arg(point.x()));
|
||||||
|
m_labelY->setText(tr("Y: %0").arg(point.y()));
|
||||||
|
}
|
||||||
|
|
||||||
|
void RoomPropertiesDialog::updateTitle()
|
||||||
|
{
|
||||||
|
setWindowTitle(tr("Room Properties: %0%1")
|
||||||
|
.arg(m_room.name)
|
||||||
|
.arg(m_unsavedChanges ? tr("*") : QString{})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
@@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
class QSpinBox;
|
||||||
|
class QLabel;
|
||||||
namespace Ui { class RoomPropertiesDialog; }
|
namespace Ui { class RoomPropertiesDialog; }
|
||||||
struct Room;
|
struct Room;
|
||||||
class ProjectTreeModel;
|
class ProjectTreeModel;
|
||||||
@@ -16,6 +18,40 @@ public:
|
|||||||
explicit RoomPropertiesDialog(Room &room, ProjectTreeModel &projectModel, QWidget *parent = nullptr);
|
explicit RoomPropertiesDialog(Room &room, ProjectTreeModel &projectModel, QWidget *parent = nullptr);
|
||||||
~RoomPropertiesDialog();
|
~RoomPropertiesDialog();
|
||||||
|
|
||||||
|
void accept() override;
|
||||||
|
void reject() override;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void undo();
|
||||||
|
void clearInstances();
|
||||||
|
void shiftInstances();
|
||||||
|
void sortInstancesX();
|
||||||
|
void sortInstancesY();
|
||||||
|
void lockInstances();
|
||||||
|
void unlockInstances();
|
||||||
|
void editCreationCode();
|
||||||
|
|
||||||
|
void changed();
|
||||||
|
|
||||||
|
void roomNameChanged(const Room &room);
|
||||||
|
|
||||||
|
void cursorMoved(const QPoint &point);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void updateTitle();
|
||||||
|
|
||||||
const std::unique_ptr<Ui::RoomPropertiesDialog> m_ui;
|
const std::unique_ptr<Ui::RoomPropertiesDialog> m_ui;
|
||||||
|
|
||||||
|
Room &m_room;
|
||||||
|
ProjectTreeModel &m_projectModel;
|
||||||
|
|
||||||
|
QString m_creationCode;
|
||||||
|
|
||||||
|
bool m_unsavedChanges{};
|
||||||
|
|
||||||
|
QSpinBox * const m_spinBoxSnapX;
|
||||||
|
QSpinBox * const m_spinBoxSnapY;
|
||||||
|
|
||||||
|
QLabel * const m_labelX;
|
||||||
|
QLabel * const m_labelY;
|
||||||
};
|
};
|
||||||
|
@@ -6,20 +6,532 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>400</width>
|
<width>921</width>
|
||||||
<height>300</height>
|
<height>576</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Room Properties</string>
|
<string>Room Properties</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowIcon">
|
<property name="windowIcon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/room-file.png</normaloff>:/qtgameengine/icons/room-file.png</iconset>
|
<normaloff>:/qtgameengine/icons/room-file.png</normaloff>:/qtgameengine/icons/room-file.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_2" stretch="0,1">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QFrame" name="frame">
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::Panel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolBar" name="toolBar">
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>toolBar</string>
|
||||||
|
</property>
|
||||||
|
<property name="movable">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>16</width>
|
||||||
|
<height>16</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<addaction name="actionOk"/>
|
||||||
|
<addaction name="separator"/>
|
||||||
|
<addaction name="actionUndo"/>
|
||||||
|
<addaction name="separator"/>
|
||||||
|
<addaction name="actionClear"/>
|
||||||
|
<addaction name="actionShift"/>
|
||||||
|
<addaction name="actionSortX"/>
|
||||||
|
<addaction name="actionSortY"/>
|
||||||
|
<addaction name="actionLock"/>
|
||||||
|
<addaction name="actionUnlock"/>
|
||||||
|
<addaction name="separator"/>
|
||||||
|
<addaction name="separator"/>
|
||||||
|
<addaction name="actionGridEnabled"/>
|
||||||
|
<addaction name="actionIsometricGrid"/>
|
||||||
|
<addaction name="separator"/>
|
||||||
</widget>
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,1">
|
||||||
|
<item>
|
||||||
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
|
<property name="tabPosition">
|
||||||
|
<enum>QTabWidget::West</enum>
|
||||||
|
</property>
|
||||||
|
<property name="currentIndex">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="tabObjects">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>&Objects</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>10</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>10</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>10</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>10</number>
|
||||||
|
</property>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="tabSettings">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>&Settings</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QVBoxLayout">
|
||||||
|
<item>
|
||||||
|
<layout class="QFormLayout" name="formLayout">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="labelName">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Name:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>lineEditName</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QLineEdit" name="lineEditName"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="labelCaption">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Caption for the room:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>lineEditCaption</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="lineEditCaption"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QFormLayout" name="formLayout2">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="labelWidth">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Width:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>spinBoxWidth</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QSpinBox" name="spinBoxWidth">
|
||||||
|
<property name="maximum">
|
||||||
|
<number>2147483647</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>640</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="labelHeight">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Height:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>spinBoxHeight</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QSpinBox" name="spinBoxHeight">
|
||||||
|
<property name="maximum">
|
||||||
|
<number>2147483647</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>480</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="labelSpeed">
|
||||||
|
<property name="text">
|
||||||
|
<string>S&peed:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>spinBoxSpeed</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QSpinBox" name="spinBoxSpeed">
|
||||||
|
<property name="maximum">
|
||||||
|
<number>2147483647</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>30</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="checkBoxPersistent">
|
||||||
|
<property name="text">
|
||||||
|
<string>P&ersistent</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pushButtonCreationCode">
|
||||||
|
<property name="text">
|
||||||
|
<string>CreationCode</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../resources.qrc">
|
||||||
|
<normaloff>:/qtgameengine/icons/script.png</normaloff>:/qtgameengine/icons/script.png</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="tabTiles">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>&Tiles</string>
|
||||||
|
</attribute>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="tabBackgrounds">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>&Backgrounds</string>
|
||||||
|
</attribute>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="tabViews">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>&Views</string>
|
||||||
|
</attribute>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_7" stretch="1,0">
|
||||||
|
<item>
|
||||||
|
<widget class="QScrollArea" name="scrollArea">
|
||||||
|
<widget class="RoomEditWidget" name="roomEditWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QStatusBar" name="statusbar"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
<action name="actionOk">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../resources.qrc">
|
||||||
|
<normaloff>:/qtgameengine/icons/ok.png</normaloff>:/qtgameengine/icons/ok.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>OK</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Close the form, saving the changes</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionUndo">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../resources.qrc">
|
||||||
|
<normaloff>:/qtgameengine/icons/undo.png</normaloff>:/qtgameengine/icons/undo.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Undo</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Undo the last changes in the room</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionClear">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../resources.qrc">
|
||||||
|
<normaloff>:/qtgameengine/icons/new.png</normaloff>:/qtgameengine/icons/new.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Clear</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Clear all instances from the room</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionShift">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../resources.qrc">
|
||||||
|
<normaloff>:/qtgameengine/icons/arrow-right.png</normaloff>:/qtgameengine/icons/arrow-right.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Shift</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Shift all instances by a given amount</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionSortX">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../resources.qrc">
|
||||||
|
<normaloff>:/qtgameengine/icons/sort-x.png</normaloff>:/qtgameengine/icons/sort-x.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Sort X</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Sort all instances by x-coordinate</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionSortY">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../resources.qrc">
|
||||||
|
<normaloff>:/qtgameengine/icons/sort-y.png</normaloff>:/qtgameengine/icons/sort-y.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Sort Y</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Sort all instances by y-coordinate</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionLock">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../resources.qrc">
|
||||||
|
<normaloff>:/qtgameengine/icons/lock.png</normaloff>:/qtgameengine/icons/lock.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Lock</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Lock all instances</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionUnlock">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../resources.qrc">
|
||||||
|
<normaloff>:/qtgameengine/icons/unlock.png</normaloff>:/qtgameengine/icons/unlock.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Unlock</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Unlock all instances</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionGridEnabled">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../resources.qrc">
|
||||||
|
<normaloff>:/qtgameengine/icons/grid.png</normaloff>:/qtgameengine/icons/grid.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Grid</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Toggle the showing of the grid</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionIsometricGrid">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../resources.qrc">
|
||||||
|
<normaloff>:/qtgameengine/icons/isometric.png</normaloff>:/qtgameengine/icons/isometric.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Isometric</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Turn the grid into an isometric grid</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionShowObjects">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Show Objects</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionShowTiles">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Show Tiles</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionShowBackgrounds">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Show Backgrounds</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionShowForegrounds">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Show Foregrounds</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionShowViews">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Show Views</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
</widget>
|
||||||
|
<customwidgets>
|
||||||
|
<customwidget>
|
||||||
|
<class>RoomEditWidget</class>
|
||||||
|
<extends>QWidget</extends>
|
||||||
|
<header>widgets/roomeditwidget.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../resources.qrc"/>
|
<include location="../../../resources.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections/>
|
<connections>
|
||||||
|
<connection>
|
||||||
|
<sender>actionOk</sender>
|
||||||
|
<signal>triggered()</signal>
|
||||||
|
<receiver>RoomPropertiesDialog</receiver>
|
||||||
|
<slot>accept()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>-1</x>
|
||||||
|
<y>-1</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>363</x>
|
||||||
|
<y>224</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
</connections>
|
||||||
</ui>
|
</ui>
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
<string>Sound Properties</string>
|
<string>Sound Properties</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowIcon">
|
<property name="windowIcon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/sound-file.png</normaloff>:/qtgameengine/icons/sound-file.png</iconset>
|
<normaloff>:/qtgameengine/icons/sound-file.png</normaloff>:/qtgameengine/icons/sound-file.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
<string>&Load Sound</string>
|
<string>&Load Sound</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/open.png</normaloff>:/qtgameengine/icons/open.png</iconset>
|
<normaloff>:/qtgameengine/icons/open.png</normaloff>:/qtgameengine/icons/open.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
<string notr="true"/>
|
<string notr="true"/>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/run.png</normaloff>:/qtgameengine/icons/run.png</iconset>
|
<normaloff>:/qtgameengine/icons/run.png</normaloff>:/qtgameengine/icons/run.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -78,7 +78,7 @@
|
|||||||
<string notr="true"/>
|
<string notr="true"/>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/exit.png</normaloff>:/qtgameengine/icons/exit.png</iconset>
|
<normaloff>:/qtgameengine/icons/exit.png</normaloff>:/qtgameengine/icons/exit.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -94,7 +94,7 @@
|
|||||||
<string>Sa&ve Sound</string>
|
<string>Sa&ve Sound</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/save.png</normaloff>:/qtgameengine/icons/save.png</iconset>
|
<normaloff>:/qtgameengine/icons/save.png</normaloff>:/qtgameengine/icons/save.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -292,7 +292,7 @@
|
|||||||
<string>&Edit Sound</string>
|
<string>&Edit Sound</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/sound.png</normaloff>:/qtgameengine/icons/sound.png</iconset>
|
<normaloff>:/qtgameengine/icons/sound.png</normaloff>:/qtgameengine/icons/sound.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -325,7 +325,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../resources.qrc"/>
|
<include location="../../../resources.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
<string>Sprite Properties</string>
|
<string>Sprite Properties</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowIcon">
|
<property name="windowIcon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/sprite-file.png</normaloff>:/qtgameengine/icons/sprite-file.png</iconset>
|
<normaloff>:/qtgameengine/icons/sprite-file.png</normaloff>:/qtgameengine/icons/sprite-file.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,1">
|
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,1">
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
<string>&Load Sprite</string>
|
<string>&Load Sprite</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/open.png</normaloff>:/qtgameengine/icons/open.png</iconset>
|
<normaloff>:/qtgameengine/icons/open.png</normaloff>:/qtgameengine/icons/open.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -81,7 +81,7 @@
|
|||||||
<string>&Save Sprite</string>
|
<string>&Save Sprite</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/save.png</normaloff>:/qtgameengine/icons/save.png</iconset>
|
<normaloff>:/qtgameengine/icons/save.png</normaloff>:/qtgameengine/icons/save.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -95,7 +95,7 @@
|
|||||||
<string>&Edit Sprite</string>
|
<string>&Edit Sprite</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/edit.png</normaloff>:/qtgameengine/icons/edit.png</iconset>
|
<normaloff>:/qtgameengine/icons/edit.png</normaloff>:/qtgameengine/icons/edit.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -339,7 +339,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../resources.qrc"/>
|
<include location="../../../resources.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
<string>Time Line Properties</string>
|
<string>Time Line Properties</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowIcon">
|
<property name="windowIcon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/timeline-file.png</normaloff>:/qtgameengine/icons/timeline-file.png</iconset>
|
<normaloff>:/qtgameengine/icons/timeline-file.png</normaloff>:/qtgameengine/icons/timeline-file.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,1">
|
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,1">
|
||||||
@@ -61,7 +61,7 @@
|
|||||||
<string>&Add</string>
|
<string>&Add</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/add.png</normaloff>:/qtgameengine/icons/add.png</iconset>
|
<normaloff>:/qtgameengine/icons/add.png</normaloff>:/qtgameengine/icons/add.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -75,7 +75,7 @@
|
|||||||
<string>&Change</string>
|
<string>&Change</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/replace.png</normaloff>:/qtgameengine/icons/replace.png</iconset>
|
<normaloff>:/qtgameengine/icons/replace.png</normaloff>:/qtgameengine/icons/replace.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -89,7 +89,7 @@
|
|||||||
<string>&Delete</string>
|
<string>&Delete</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/delete.png</normaloff>:/qtgameengine/icons/delete.png</iconset>
|
<normaloff>:/qtgameengine/icons/delete.png</normaloff>:/qtgameengine/icons/delete.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -103,7 +103,7 @@
|
|||||||
<string>&Shift</string>
|
<string>&Shift</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/arrow-right.png</normaloff>:/qtgameengine/icons/arrow-right.png</iconset>
|
<normaloff>:/qtgameengine/icons/arrow-right.png</normaloff>:/qtgameengine/icons/arrow-right.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -117,7 +117,7 @@
|
|||||||
<string>C&lear</string>
|
<string>C&lear</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/new.png</normaloff>:/qtgameengine/icons/new.png</iconset>
|
<normaloff>:/qtgameengine/icons/new.png</normaloff>:/qtgameengine/icons/new.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -131,7 +131,7 @@
|
|||||||
<string>D&uplicate</string>
|
<string>D&uplicate</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/copy.png</normaloff>:/qtgameengine/icons/copy.png</iconset>
|
<normaloff>:/qtgameengine/icons/copy.png</normaloff>:/qtgameengine/icons/copy.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -158,7 +158,7 @@
|
|||||||
<string>S&pread</string>
|
<string>S&pread</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/scale.png</normaloff>:/qtgameengine/icons/scale.png</iconset>
|
<normaloff>:/qtgameengine/icons/scale.png</normaloff>:/qtgameengine/icons/scale.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -172,7 +172,7 @@
|
|||||||
<string>&Merge</string>
|
<string>&Merge</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/merge.png</normaloff>:/qtgameengine/icons/merge.png</iconset>
|
<normaloff>:/qtgameengine/icons/merge.png</normaloff>:/qtgameengine/icons/merge.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -201,7 +201,7 @@
|
|||||||
<string>Show &Information</string>
|
<string>Show &Information</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/info.png</normaloff>:/qtgameengine/icons/info.png</iconset>
|
<normaloff>:/qtgameengine/icons/info.png</normaloff>:/qtgameengine/icons/info.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -278,7 +278,7 @@
|
|||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../resources.qrc"/>
|
<include location="../../../resources.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
|
@@ -1,11 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "codeeditordialog.h"
|
|
||||||
|
|
||||||
class TriggerConditionDialog : public CodeEditorDialog
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
explicit TriggerConditionDialog(QWidget *parent = nullptr);
|
|
||||||
};
|
|
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
#include "projectcontainer.h"
|
#include "projectcontainer.h"
|
||||||
#include "models/triggersmodel.h"
|
#include "models/triggersmodel.h"
|
||||||
#include "triggerconditiondialog.h"
|
#include "genericcodeeditordialog.h"
|
||||||
|
|
||||||
TriggersDialog::TriggersDialog(ProjectContainer &project, QWidget *parent) :
|
TriggersDialog::TriggersDialog(ProjectContainer &project, QWidget *parent) :
|
||||||
QDialog{parent},
|
QDialog{parent},
|
||||||
@@ -66,7 +66,7 @@ TriggersDialog::~TriggersDialog() = default;
|
|||||||
|
|
||||||
void TriggersDialog::openCodeEditor()
|
void TriggersDialog::openCodeEditor()
|
||||||
{
|
{
|
||||||
TriggerConditionDialog dialog{this};
|
GenericCodeEditorDialog dialog{tr("Trigger condition"), this};
|
||||||
dialog.setScript(m_ui->plainTextEdit->toPlainText());
|
dialog.setScript(m_ui->plainTextEdit->toPlainText());
|
||||||
if (dialog.exec() == QDialog::Accepted)
|
if (dialog.exec() == QDialog::Accepted)
|
||||||
{
|
{
|
||||||
|
@@ -40,7 +40,7 @@
|
|||||||
<string>&Load</string>
|
<string>&Load</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/open.png</normaloff>:/qtgameengine/icons/open.png</iconset>
|
<normaloff>:/qtgameengine/icons/open.png</normaloff>:/qtgameengine/icons/open.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
<string>&Delete</string>
|
<string>&Delete</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/delete.png</normaloff>:/qtgameengine/icons/delete.png</iconset>
|
<normaloff>:/qtgameengine/icons/delete.png</normaloff>:/qtgameengine/icons/delete.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
<string>&Add</string>
|
<string>&Add</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/add.png</normaloff>:/qtgameengine/icons/add.png</iconset>
|
<normaloff>:/qtgameengine/icons/add.png</normaloff>:/qtgameengine/icons/add.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -82,7 +82,7 @@
|
|||||||
<string>&Clear</string>
|
<string>&Clear</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/new.png</normaloff>:/qtgameengine/icons/new.png</iconset>
|
<normaloff>:/qtgameengine/icons/new.png</normaloff>:/qtgameengine/icons/new.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -96,7 +96,7 @@
|
|||||||
<string>&Save</string>
|
<string>&Save</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/save.png</normaloff>:/qtgameengine/icons/save.png</iconset>
|
<normaloff>:/qtgameengine/icons/save.png</normaloff>:/qtgameengine/icons/save.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -246,7 +246,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../resources.qrc"/>
|
<include location="../../../resources.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
<string>User-Defined Constants</string>
|
<string>User-Defined Constants</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowIcon">
|
<property name="windowIcon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/constants.png</normaloff>:/qtgameengine/icons/constants.png</iconset>
|
<normaloff>:/qtgameengine/icons/constants.png</normaloff>:/qtgameengine/icons/constants.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2" stretch="1,0">
|
<layout class="QVBoxLayout" name="verticalLayout_2" stretch="1,0">
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
<string>&Insert</string>
|
<string>&Insert</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/add.png</normaloff>:/qtgameengine/icons/add.png</iconset>
|
<normaloff>:/qtgameengine/icons/add.png</normaloff>:/qtgameengine/icons/add.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
<string>&Sort</string>
|
<string>&Sort</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/sort.png</normaloff>:/qtgameengine/icons/sort.png</iconset>
|
<normaloff>:/qtgameengine/icons/sort.png</normaloff>:/qtgameengine/icons/sort.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
<string>&Delete</string>
|
<string>&Delete</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/delete.png</normaloff>:/qtgameengine/icons/delete.png</iconset>
|
<normaloff>:/qtgameengine/icons/delete.png</normaloff>:/qtgameengine/icons/delete.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -81,7 +81,7 @@
|
|||||||
<string>&Load</string>
|
<string>&Load</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/open.png</normaloff>:/qtgameengine/icons/open.png</iconset>
|
<normaloff>:/qtgameengine/icons/open.png</normaloff>:/qtgameengine/icons/open.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -95,7 +95,7 @@
|
|||||||
<string>&Up</string>
|
<string>&Up</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/arrow-up.png</normaloff>:/qtgameengine/icons/arrow-up.png</iconset>
|
<normaloff>:/qtgameengine/icons/arrow-up.png</normaloff>:/qtgameengine/icons/arrow-up.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -109,7 +109,7 @@
|
|||||||
<string>&Add</string>
|
<string>&Add</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/add.png</normaloff>:/qtgameengine/icons/add.png</iconset>
|
<normaloff>:/qtgameengine/icons/add.png</normaloff>:/qtgameengine/icons/add.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -123,7 +123,7 @@
|
|||||||
<string>&Clear</string>
|
<string>&Clear</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/new.png</normaloff>:/qtgameengine/icons/new.png</iconset>
|
<normaloff>:/qtgameengine/icons/new.png</normaloff>:/qtgameengine/icons/new.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -137,7 +137,7 @@
|
|||||||
<string>Do&wn</string>
|
<string>Do&wn</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/arrow-down.png</normaloff>:/qtgameengine/icons/arrow-down.png</iconset>
|
<normaloff>:/qtgameengine/icons/arrow-down.png</normaloff>:/qtgameengine/icons/arrow-down.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -151,7 +151,7 @@
|
|||||||
<string>Sa&ve</string>
|
<string>Sa&ve</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../resources.qrc">
|
<iconset resource="../../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/save.png</normaloff>:/qtgameengine/icons/save.png</iconset>
|
<normaloff>:/qtgameengine/icons/save.png</normaloff>:/qtgameengine/icons/save.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -174,7 +174,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../resources.qrc"/>
|
<include location="../../../resources.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
|
@@ -55,12 +55,10 @@ MainWindow::MainWindow(const QString &filePath, QWidget *parent) :
|
|||||||
{
|
{
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
|
|
||||||
{
|
m_ui->splitter->setSizes({
|
||||||
QList<int> sizes;
|
m_ui->splitter->width() / 2,
|
||||||
sizes.append(0.5 * m_ui->splitter->width());
|
m_ui->splitter->width() / 2
|
||||||
sizes.append(0.5 * m_ui->splitter->width());
|
});
|
||||||
m_ui->splitter->setSizes(sizes);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_ui->actionNew->setShortcut(QKeySequence::New);
|
m_ui->actionNew->setShortcut(QKeySequence::New);
|
||||||
m_ui->actionOpen->setShortcut(QKeySequence::Open);
|
m_ui->actionOpen->setShortcut(QKeySequence::Open);
|
||||||
|
@@ -264,7 +264,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
<action name="actionNew">
|
<action name="actionNew">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset resource="../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/new.png</normaloff>:/qtgameengine/icons/new.png</iconset>
|
<normaloff>:/qtgameengine/icons/new.png</normaloff>:/qtgameengine/icons/new.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -273,7 +273,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionOpen">
|
<action name="actionOpen">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset resource="../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/open.png</normaloff>:/qtgameengine/icons/open.png</iconset>
|
<normaloff>:/qtgameengine/icons/open.png</normaloff>:/qtgameengine/icons/open.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -282,7 +282,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionSave">
|
<action name="actionSave">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset resource="../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/save.png</normaloff>:/qtgameengine/icons/save.png</iconset>
|
<normaloff>:/qtgameengine/icons/save.png</normaloff>:/qtgameengine/icons/save.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -291,7 +291,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionSaveAs">
|
<action name="actionSaveAs">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset resource="../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/save-as.png</normaloff>:/qtgameengine/icons/save-as.png</iconset>
|
<normaloff>:/qtgameengine/icons/save-as.png</normaloff>:/qtgameengine/icons/save-as.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -300,7 +300,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionCreateExecutable">
|
<action name="actionCreateExecutable">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset resource="../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/create-executable.png</normaloff>:/qtgameengine/icons/create-executable.png</iconset>
|
<normaloff>:/qtgameengine/icons/create-executable.png</normaloff>:/qtgameengine/icons/create-executable.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -309,7 +309,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionPublishGame">
|
<action name="actionPublishGame">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset resource="../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/publish-game.png</normaloff>:/qtgameengine/icons/publish-game.png</iconset>
|
<normaloff>:/qtgameengine/icons/publish-game.png</normaloff>:/qtgameengine/icons/publish-game.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -318,7 +318,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionImportResources">
|
<action name="actionImportResources">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset resource="../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/import-resources.png</normaloff>:/qtgameengine/icons/import-resources.png</iconset>
|
<normaloff>:/qtgameengine/icons/import-resources.png</normaloff>:/qtgameengine/icons/import-resources.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -327,7 +327,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionExportResources">
|
<action name="actionExportResources">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset resource="../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/export-resources.png</normaloff>:/qtgameengine/icons/export-resources.png</iconset>
|
<normaloff>:/qtgameengine/icons/export-resources.png</normaloff>:/qtgameengine/icons/export-resources.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -347,7 +347,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionPreferences">
|
<action name="actionPreferences">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset resource="../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/preferences.png</normaloff>:/qtgameengine/icons/preferences.png</iconset>
|
<normaloff>:/qtgameengine/icons/preferences.png</normaloff>:/qtgameengine/icons/preferences.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -359,7 +359,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionExit">
|
<action name="actionExit">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset resource="../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/exit.png</normaloff>:/qtgameengine/icons/exit.png</iconset>
|
<normaloff>:/qtgameengine/icons/exit.png</normaloff>:/qtgameengine/icons/exit.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -379,7 +379,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionCreate">
|
<action name="actionCreate">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset resource="../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/create.png</normaloff>:/qtgameengine/icons/create.png</iconset>
|
<normaloff>:/qtgameengine/icons/create.png</normaloff>:/qtgameengine/icons/create.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -388,7 +388,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionDuplicate">
|
<action name="actionDuplicate">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset resource="../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/duplicate.png</normaloff>:/qtgameengine/icons/duplicate.png</iconset>
|
<normaloff>:/qtgameengine/icons/duplicate.png</normaloff>:/qtgameengine/icons/duplicate.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -400,7 +400,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionCreateGroup">
|
<action name="actionCreateGroup">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset resource="../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/create-group.png</normaloff>:/qtgameengine/icons/create-group.png</iconset>
|
<normaloff>:/qtgameengine/icons/create-group.png</normaloff>:/qtgameengine/icons/create-group.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -414,7 +414,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionDelete">
|
<action name="actionDelete">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset resource="../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/delete.png</normaloff>:/qtgameengine/icons/delete.png</iconset>
|
<normaloff>:/qtgameengine/icons/delete.png</normaloff>:/qtgameengine/icons/delete.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -423,7 +423,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionRename">
|
<action name="actionRename">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset resource="../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/rename.png</normaloff>:/qtgameengine/icons/rename.png</iconset>
|
<normaloff>:/qtgameengine/icons/rename.png</normaloff>:/qtgameengine/icons/rename.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -432,7 +432,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionProperties">
|
<action name="actionProperties">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset resource="../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/properties.png</normaloff>:/qtgameengine/icons/properties.png</iconset>
|
<normaloff>:/qtgameengine/icons/properties.png</normaloff>:/qtgameengine/icons/properties.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -444,7 +444,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionFindResource">
|
<action name="actionFindResource">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset resource="../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/find.png</normaloff>:/qtgameengine/icons/find.png</iconset>
|
<normaloff>:/qtgameengine/icons/find.png</normaloff>:/qtgameengine/icons/find.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -463,7 +463,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionShowObjectInformation">
|
<action name="actionShowObjectInformation">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset resource="../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/object-file.png</normaloff>:/qtgameengine/icons/object-file.png</iconset>
|
<normaloff>:/qtgameengine/icons/object-file.png</normaloff>:/qtgameengine/icons/object-file.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -472,7 +472,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionCreateSprite">
|
<action name="actionCreateSprite">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset resource="../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/sprite.png</normaloff>:/qtgameengine/icons/sprite.png</iconset>
|
<normaloff>:/qtgameengine/icons/sprite.png</normaloff>:/qtgameengine/icons/sprite.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -484,7 +484,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionCreateSound">
|
<action name="actionCreateSound">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset resource="../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/sound.png</normaloff>:/qtgameengine/icons/sound.png</iconset>
|
<normaloff>:/qtgameengine/icons/sound.png</normaloff>:/qtgameengine/icons/sound.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -496,7 +496,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionCreateBackground">
|
<action name="actionCreateBackground">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset resource="../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/background.png</normaloff>:/qtgameengine/icons/background.png</iconset>
|
<normaloff>:/qtgameengine/icons/background.png</normaloff>:/qtgameengine/icons/background.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -508,7 +508,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionCreatePath">
|
<action name="actionCreatePath">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset resource="../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/path.png</normaloff>:/qtgameengine/icons/path.png</iconset>
|
<normaloff>:/qtgameengine/icons/path.png</normaloff>:/qtgameengine/icons/path.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -520,7 +520,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionCreateScript">
|
<action name="actionCreateScript">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset resource="../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/script.png</normaloff>:/qtgameengine/icons/script.png</iconset>
|
<normaloff>:/qtgameengine/icons/script.png</normaloff>:/qtgameengine/icons/script.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -532,7 +532,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionCreateFont">
|
<action name="actionCreateFont">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset resource="../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/font.png</normaloff>:/qtgameengine/icons/font.png</iconset>
|
<normaloff>:/qtgameengine/icons/font.png</normaloff>:/qtgameengine/icons/font.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -544,7 +544,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionCreateTimeLine">
|
<action name="actionCreateTimeLine">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset resource="../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/timeline.png</normaloff>:/qtgameengine/icons/timeline.png</iconset>
|
<normaloff>:/qtgameengine/icons/timeline.png</normaloff>:/qtgameengine/icons/timeline.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -556,7 +556,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionCreateObject">
|
<action name="actionCreateObject">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset resource="../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/object.png</normaloff>:/qtgameengine/icons/object.png</iconset>
|
<normaloff>:/qtgameengine/icons/object.png</normaloff>:/qtgameengine/icons/object.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -568,7 +568,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionCreateRoom">
|
<action name="actionCreateRoom">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset resource="../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/room.png</normaloff>:/qtgameengine/icons/room.png</iconset>
|
<normaloff>:/qtgameengine/icons/room.png</normaloff>:/qtgameengine/icons/room.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -580,7 +580,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionGameInformation">
|
<action name="actionGameInformation">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset resource="../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/game-information.png</normaloff>:/qtgameengine/icons/game-information.png</iconset>
|
<normaloff>:/qtgameengine/icons/game-information.png</normaloff>:/qtgameengine/icons/game-information.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -592,7 +592,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionGlobalGameSettings">
|
<action name="actionGlobalGameSettings">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset resource="../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/global-game-settings.png</normaloff>:/qtgameengine/icons/global-game-settings.png</iconset>
|
<normaloff>:/qtgameengine/icons/global-game-settings.png</normaloff>:/qtgameengine/icons/global-game-settings.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -604,7 +604,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionExtensionPackages">
|
<action name="actionExtensionPackages">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset resource="../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/extension-packages.png</normaloff>:/qtgameengine/icons/extension-packages.png</iconset>
|
<normaloff>:/qtgameengine/icons/extension-packages.png</normaloff>:/qtgameengine/icons/extension-packages.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -616,7 +616,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionDefineConstants">
|
<action name="actionDefineConstants">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset resource="../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/constants.png</normaloff>:/qtgameengine/icons/constants.png</iconset>
|
<normaloff>:/qtgameengine/icons/constants.png</normaloff>:/qtgameengine/icons/constants.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -644,7 +644,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionRunNormally">
|
<action name="actionRunNormally">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset resource="../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/run.png</normaloff>:/qtgameengine/icons/run.png</iconset>
|
<normaloff>:/qtgameengine/icons/run.png</normaloff>:/qtgameengine/icons/run.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -656,7 +656,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionRunInDebugMode">
|
<action name="actionRunInDebugMode">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset resource="../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/debug.png</normaloff>:/qtgameengine/icons/debug.png</iconset>
|
<normaloff>:/qtgameengine/icons/debug.png</normaloff>:/qtgameengine/icons/debug.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -673,7 +673,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionContents">
|
<action name="actionContents">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset resource="../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/help.png</normaloff>:/qtgameengine/icons/help.png</iconset>
|
<normaloff>:/qtgameengine/icons/help.png</normaloff>:/qtgameengine/icons/help.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -783,7 +783,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionTile">
|
<action name="actionTile">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset resource="../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/tile.png</normaloff>:/qtgameengine/icons/tile.png</iconset>
|
<normaloff>:/qtgameengine/icons/tile.png</normaloff>:/qtgameengine/icons/tile.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -792,7 +792,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionCascade">
|
<action name="actionCascade">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="resources.qrc">
|
<iconset resource="../../resources.qrc">
|
||||||
<normaloff>:/qtgameengine/icons/cascade.png</normaloff>:/qtgameengine/icons/cascade.png</iconset>
|
<normaloff>:/qtgameengine/icons/cascade.png</normaloff>:/qtgameengine/icons/cascade.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -827,7 +827,7 @@
|
|||||||
</action>
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="resources.qrc"/>
|
<include location="../../resources.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
#include <QPaintEvent>
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@@ -24,27 +25,27 @@ void PathPointsWidget::setPoints(std::vector<Path::Point> *points)
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PathPointsWidget::setShowGrid(bool showGrid)
|
void PathPointsWidget::setSnapX(int snapX)
|
||||||
{
|
{
|
||||||
if (m_showGrid == showGrid)
|
if (m_snapX == snapX)
|
||||||
return;
|
return;
|
||||||
emit showGridChanged(m_showGrid = showGrid);
|
emit snapXChanged(m_snapX = snapX);
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PathPointsWidget::setGridX(int gridX)
|
void PathPointsWidget::setSnapY(int snapY)
|
||||||
{
|
{
|
||||||
if (m_gridX == gridX)
|
if (m_snapY == snapY)
|
||||||
return;
|
return;
|
||||||
emit gridXChanged(m_gridX = gridX);
|
emit snapYChanged(m_snapY = snapY);
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PathPointsWidget::setGridY(int gridY)
|
void PathPointsWidget::setGridEnabled(bool gridEnabled)
|
||||||
{
|
{
|
||||||
if (m_gridY == gridY)
|
if (m_gridEnabled == gridEnabled)
|
||||||
return;
|
return;
|
||||||
emit gridYChanged(m_gridY = gridY);
|
emit gridEnabledChanged(m_gridEnabled = gridEnabled);
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,28 +65,36 @@ void PathPointsWidget::setSelectedIndex(const std::optional<std::size_t> &select
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PathPointsWidget::setGridRole(QPalette::ColorRole gridRole)
|
||||||
|
{
|
||||||
|
if (gridRole == m_gridRole)
|
||||||
|
return;
|
||||||
|
m_gridRole = gridRole;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
void PathPointsWidget::paintEvent(QPaintEvent *event)
|
void PathPointsWidget::paintEvent(QPaintEvent *event)
|
||||||
{
|
{
|
||||||
Q_UNUSED(event)
|
Q_UNUSED(event)
|
||||||
|
|
||||||
if (m_showGrid)
|
if (m_gridEnabled)
|
||||||
{
|
{
|
||||||
if (!m_gridBrush || m_gridBrush->gridX != m_gridX || m_gridBrush->gridY != m_gridY)
|
if (!m_gridBrush || m_gridBrush->snapX != m_snapX || m_gridBrush->snapY != m_snapY)
|
||||||
{
|
{
|
||||||
QPixmap pixmap{m_gridX, m_gridY};
|
QPixmap pixmap{m_snapX, m_snapY};
|
||||||
|
|
||||||
{
|
{
|
||||||
QPainter painter{&pixmap};
|
QPainter painter{&pixmap};
|
||||||
painter.setPen(palette().color(m_gridRole));
|
painter.setPen(palette().color(m_gridRole));
|
||||||
painter.drawLine(0, 0, m_gridX, 0);
|
painter.drawLine(0, 0, m_snapX, 0);
|
||||||
painter.drawLine(0, 0, 0, m_gridY);
|
painter.drawLine(0, 0, 0, m_snapY);
|
||||||
|
|
||||||
painter.fillRect(1, 1, m_gridX - 1, m_gridY - 1, palette().color(backgroundRole()));
|
painter.fillRect(1, 1, m_snapX - 1, m_snapY - 1, palette().color(backgroundRole()));
|
||||||
}
|
}
|
||||||
|
|
||||||
m_gridBrush = GridBrush {
|
m_gridBrush = GridBrush {
|
||||||
.gridX = m_gridX,
|
.snapX = m_snapX,
|
||||||
.gridY = m_gridY,
|
.snapY = m_snapY,
|
||||||
.brush = QBrush{std:: move(pixmap)}
|
.brush = QBrush{std:: move(pixmap)}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -216,10 +225,8 @@ void PathPointsWidget::mouseMoveEvent(QMouseEvent *event)
|
|||||||
|
|
||||||
QPoint PathPointsWidget::snapPoint(const QPoint &point) const
|
QPoint PathPointsWidget::snapPoint(const QPoint &point) const
|
||||||
{
|
{
|
||||||
if (!m_showGrid)
|
|
||||||
return point;
|
|
||||||
return QPoint{
|
return QPoint{
|
||||||
(point.x() + (m_gridX / 2)) / m_gridX * m_gridX,
|
m_snapX > 1 ? ((point.x() + (m_snapX / 2)) / m_snapX * m_snapX) : point.x(),
|
||||||
(point.y() + (m_gridY / 2)) / m_gridY * m_gridY,
|
m_snapY > 1 ? ((point.y() + (m_snapY / 2)) / m_snapY * m_snapY) : point.y(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -11,9 +11,9 @@
|
|||||||
class PathPointsWidget : public QWidget
|
class PathPointsWidget : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(bool showGrid READ showGrid WRITE setShowGrid NOTIFY showGridChanged)
|
Q_PROPERTY(int snapX READ snapX WRITE setSnapX NOTIFY snapXChanged)
|
||||||
Q_PROPERTY(int gridX READ gridX WRITE setGridX NOTIFY gridXChanged)
|
Q_PROPERTY(int snapY READ snapY WRITE setSnapY NOTIFY snapYChanged)
|
||||||
Q_PROPERTY(int gridY READ gridY WRITE setGridY NOTIFY gridYChanged)
|
Q_PROPERTY(bool gridEnabled READ gridEnabled WRITE setGridEnabled NOTIFY gridEnabledChanged)
|
||||||
Q_PROPERTY(bool closed READ closed WRITE setClosed NOTIFY closedChanged)
|
Q_PROPERTY(bool closed READ closed WRITE setClosed NOTIFY closedChanged)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -22,14 +22,14 @@ public:
|
|||||||
|
|
||||||
void setPoints(std::vector<Path::Point> *points);
|
void setPoints(std::vector<Path::Point> *points);
|
||||||
|
|
||||||
bool showGrid() const { return m_showGrid; }
|
int snapX() const { return m_snapX; }
|
||||||
void setShowGrid(bool showGrid);
|
void setSnapX(int snapX);
|
||||||
|
|
||||||
int gridX() const { return m_gridX; }
|
int snapY() const { return m_snapY; }
|
||||||
void setGridX(int gridX);
|
void setSnapY(int snapY);
|
||||||
|
|
||||||
int gridY() const { return m_gridY; }
|
bool gridEnabled() const { return m_gridEnabled; }
|
||||||
void setGridY(int gridY);
|
void setGridEnabled(bool gridEnabled);
|
||||||
|
|
||||||
bool closed() const { return m_closed; }
|
bool closed() const { return m_closed; }
|
||||||
void setClosed(bool closed);
|
void setClosed(bool closed);
|
||||||
@@ -38,12 +38,12 @@ public:
|
|||||||
void setSelectedIndex(const std::optional<std::size_t> &selectedIndex);
|
void setSelectedIndex(const std::optional<std::size_t> &selectedIndex);
|
||||||
|
|
||||||
QPalette::ColorRole gridRole() const { return m_gridRole; }
|
QPalette::ColorRole gridRole() const { return m_gridRole; }
|
||||||
void setGridRole(QPalette::ColorRole gridRole) { if (gridRole == m_gridRole) return; m_gridRole = gridRole; update(); }
|
void setGridRole(QPalette::ColorRole gridRole);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void showGridChanged(bool showGrid);
|
void snapXChanged(int snapX);
|
||||||
void gridXChanged(int gridX);
|
void snapYChanged(int snapY);
|
||||||
void gridYChanged(int gridY);
|
void gridEnabledChanged(bool gridEnabled);
|
||||||
void closedChanged(bool closed);
|
void closedChanged(bool closed);
|
||||||
void selectedIndexChanged(const std::optional<std::size_t> &selectedIndex);
|
void selectedIndexChanged(const std::optional<std::size_t> &selectedIndex);
|
||||||
|
|
||||||
@@ -63,9 +63,9 @@ private:
|
|||||||
|
|
||||||
std::vector<Path::Point> *m_points{};
|
std::vector<Path::Point> *m_points{};
|
||||||
|
|
||||||
bool m_showGrid{true};
|
int m_snapX{16};
|
||||||
int m_gridX{16};
|
int m_snapY{16};
|
||||||
int m_gridY{16};
|
bool m_gridEnabled{true};
|
||||||
|
|
||||||
bool m_closed{true};
|
bool m_closed{true};
|
||||||
|
|
||||||
@@ -73,8 +73,8 @@ private:
|
|||||||
std::optional<std::size_t> m_dragIndex;
|
std::optional<std::size_t> m_dragIndex;
|
||||||
|
|
||||||
struct GridBrush {
|
struct GridBrush {
|
||||||
int gridX;
|
int snapX;
|
||||||
int gridY;
|
int snapY;
|
||||||
QBrush brush;
|
QBrush brush;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
112
src/editor/widgets/roomeditwidget.cpp
Normal file
112
src/editor/widgets/roomeditwidget.cpp
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
#include "roomeditwidget.h"
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QPainter>
|
||||||
|
#include <QPaintEvent>
|
||||||
|
#include <QMouseEvent>
|
||||||
|
|
||||||
|
RoomEditWidget::RoomEditWidget(QWidget *parent) :
|
||||||
|
QWidget{parent}
|
||||||
|
{
|
||||||
|
setBackgroundRole(QPalette::Light);
|
||||||
|
setMouseTracking(true);
|
||||||
|
setFixedSize(640, 480);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RoomEditWidget::setSnapX(int snapX)
|
||||||
|
{
|
||||||
|
if (m_snapX == snapX)
|
||||||
|
return;
|
||||||
|
emit snapXChanged(m_snapX = snapX);
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
void RoomEditWidget::setSnapY(int snapY)
|
||||||
|
{
|
||||||
|
if (m_snapY == snapY)
|
||||||
|
return;
|
||||||
|
emit snapYChanged(m_snapY = snapY);
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
void RoomEditWidget::setGridEnabled(bool gridEnabled)
|
||||||
|
{
|
||||||
|
if (m_gridEnabled == gridEnabled)
|
||||||
|
return;
|
||||||
|
emit gridEnabledChanged(m_gridEnabled = gridEnabled);
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
void RoomEditWidget::setIsometricGrid(bool isometricGrid)
|
||||||
|
{
|
||||||
|
if (m_isometricGrid == isometricGrid)
|
||||||
|
return;
|
||||||
|
emit isometricGridChanged(m_isometricGrid = isometricGrid);
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
void RoomEditWidget::setGridRole(QPalette::ColorRole gridRole)
|
||||||
|
{
|
||||||
|
if (gridRole == m_gridRole)
|
||||||
|
return;
|
||||||
|
m_gridRole = gridRole;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
void RoomEditWidget::paintEvent(QPaintEvent *event)
|
||||||
|
{
|
||||||
|
Q_UNUSED(event)
|
||||||
|
|
||||||
|
if (m_gridEnabled)
|
||||||
|
{
|
||||||
|
if (!m_gridBrush || m_gridBrush->snapX != m_snapX || m_gridBrush->snapY != m_snapY)
|
||||||
|
{
|
||||||
|
QPixmap pixmap{m_snapX, m_snapY};
|
||||||
|
|
||||||
|
{
|
||||||
|
QPainter painter{&pixmap};
|
||||||
|
painter.setPen(palette().color(m_gridRole));
|
||||||
|
painter.drawLine(0, 0, m_snapX, 0);
|
||||||
|
painter.drawLine(0, 0, 0, m_snapY);
|
||||||
|
|
||||||
|
painter.fillRect(1, 1, m_snapX - 1, m_snapY - 1, palette().color(backgroundRole()));
|
||||||
|
}
|
||||||
|
|
||||||
|
m_gridBrush = GridBrush {
|
||||||
|
.snapX = m_snapX,
|
||||||
|
.snapY = m_snapY,
|
||||||
|
.brush = QBrush{std:: move(pixmap)}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
m_gridBrush = std::nullopt;
|
||||||
|
|
||||||
|
QPainter painter{this};
|
||||||
|
painter.fillRect(rect(), m_gridBrush ? m_gridBrush->brush : palette().color(backgroundRole()));
|
||||||
|
}
|
||||||
|
|
||||||
|
void RoomEditWidget::mousePressEvent(QMouseEvent *event)
|
||||||
|
{
|
||||||
|
QWidget::mousePressEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RoomEditWidget::mouseReleaseEvent(QMouseEvent *event)
|
||||||
|
{
|
||||||
|
QWidget::mouseReleaseEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RoomEditWidget::mouseMoveEvent(QMouseEvent *event)
|
||||||
|
{
|
||||||
|
QWidget::mouseMoveEvent(event);
|
||||||
|
|
||||||
|
emit cursorMoved(snapPoint(event->pos()));
|
||||||
|
}
|
||||||
|
|
||||||
|
QPoint RoomEditWidget::snapPoint(const QPoint &point) const
|
||||||
|
{
|
||||||
|
return QPoint{
|
||||||
|
m_snapX > 1 ? ((point.x() + (m_snapX / 2)) / m_snapX * m_snapX) : point.x(),
|
||||||
|
m_snapY > 1 ? ((point.y() + (m_snapY / 2)) / m_snapY * m_snapY) : point.y(),
|
||||||
|
};
|
||||||
|
}
|
65
src/editor/widgets/roomeditwidget.h
Normal file
65
src/editor/widgets/roomeditwidget.h
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
#include <QPalette>
|
||||||
|
|
||||||
|
#include <optional>
|
||||||
|
|
||||||
|
class RoomEditWidget : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
Q_PROPERTY(int snapX READ snapX WRITE setSnapX NOTIFY snapXChanged)
|
||||||
|
Q_PROPERTY(int snapY READ snapY WRITE setSnapY NOTIFY snapYChanged)
|
||||||
|
Q_PROPERTY(bool gridEnabled READ gridEnabled WRITE setGridEnabled NOTIFY gridEnabledChanged)
|
||||||
|
Q_PROPERTY(bool isometricGrid READ isometricGrid WRITE setIsometricGrid NOTIFY isometricGridChanged)
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit RoomEditWidget(QWidget *parent = nullptr);
|
||||||
|
|
||||||
|
int snapX() const { return m_snapX; }
|
||||||
|
void setSnapX(int snapX);
|
||||||
|
|
||||||
|
int snapY() const { return m_snapY; }
|
||||||
|
void setSnapY(int snapY);
|
||||||
|
|
||||||
|
bool gridEnabled() const { return m_gridEnabled; }
|
||||||
|
void setGridEnabled(bool gridEnabled);
|
||||||
|
|
||||||
|
bool isometricGrid() const { return m_isometricGrid; }
|
||||||
|
void setIsometricGrid(bool isometricGrid);
|
||||||
|
|
||||||
|
QPalette::ColorRole gridRole() const { return m_gridRole; }
|
||||||
|
void setGridRole(QPalette::ColorRole gridRole);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void snapXChanged(int snapX);
|
||||||
|
void snapYChanged(int snapY);
|
||||||
|
void gridEnabledChanged(bool gridEnabled);
|
||||||
|
void isometricGridChanged(bool isometricGrid);
|
||||||
|
|
||||||
|
void cursorMoved(const QPoint &point);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void paintEvent(QPaintEvent *event) override;
|
||||||
|
void mousePressEvent(QMouseEvent *event) override;
|
||||||
|
void mouseReleaseEvent(QMouseEvent *event) override;
|
||||||
|
void mouseMoveEvent(QMouseEvent *event) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
QPoint snapPoint(const QPoint &point) const;
|
||||||
|
|
||||||
|
int m_snapX{16};
|
||||||
|
int m_snapY{16};
|
||||||
|
bool m_gridEnabled{true};
|
||||||
|
bool m_isometricGrid{false};
|
||||||
|
|
||||||
|
struct GridBrush {
|
||||||
|
int snapX;
|
||||||
|
int snapY;
|
||||||
|
QBrush brush;
|
||||||
|
};
|
||||||
|
|
||||||
|
std::optional<GridBrush> m_gridBrush;
|
||||||
|
|
||||||
|
QPalette::ColorRole m_gridRole{QPalette::Dark};
|
||||||
|
};
|
@@ -222,7 +222,10 @@ QDataStream &operator<<(QDataStream &ds, const Path &path)
|
|||||||
<< path.points
|
<< path.points
|
||||||
<< path.type
|
<< path.type
|
||||||
<< path.closed
|
<< path.closed
|
||||||
<< path.precision;
|
<< path.precision
|
||||||
|
<< path.snapX
|
||||||
|
<< path.snapY
|
||||||
|
<< path.gridEnabled;
|
||||||
return ds;
|
return ds;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -232,7 +235,10 @@ QDataStream &operator>>(QDataStream &ds, Path &path)
|
|||||||
>> path.points
|
>> path.points
|
||||||
>> path.type
|
>> path.type
|
||||||
>> path.closed
|
>> path.closed
|
||||||
>> path.precision;
|
>> path.precision
|
||||||
|
>> path.snapX
|
||||||
|
>> path.snapY
|
||||||
|
>> path.gridEnabled;
|
||||||
return ds;
|
return ds;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -318,13 +324,33 @@ QDataStream &operator>>(QDataStream &ds, Object &object)
|
|||||||
|
|
||||||
QDataStream &operator<<(QDataStream &ds, const Room &room)
|
QDataStream &operator<<(QDataStream &ds, const Room &room)
|
||||||
{
|
{
|
||||||
ds << room.name;
|
ds << room.name
|
||||||
|
<< room.caption
|
||||||
|
<< room.width
|
||||||
|
<< room.height
|
||||||
|
<< room.speed
|
||||||
|
<< room.persistent
|
||||||
|
<< room.creationCode
|
||||||
|
<< room.snapX
|
||||||
|
<< room.snapY
|
||||||
|
<< room.gridEnabled
|
||||||
|
<< room.isometricGrid;
|
||||||
return ds;
|
return ds;
|
||||||
}
|
}
|
||||||
|
|
||||||
QDataStream &operator>>(QDataStream &ds, Room &room)
|
QDataStream &operator>>(QDataStream &ds, Room &room)
|
||||||
{
|
{
|
||||||
ds >> room.name;
|
ds >> room.name
|
||||||
|
>> room.caption
|
||||||
|
>> room.width
|
||||||
|
>> room.height
|
||||||
|
>> room.speed
|
||||||
|
>> room.persistent
|
||||||
|
>> room.creationCode
|
||||||
|
>> room.snapX
|
||||||
|
>> room.snapY
|
||||||
|
>> room.gridEnabled
|
||||||
|
>> room.isometricGrid;
|
||||||
return ds;
|
return ds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -63,6 +63,9 @@ struct Path
|
|||||||
Type type{Type::Straight};
|
Type type{Type::Straight};
|
||||||
bool closed{true};
|
bool closed{true};
|
||||||
int precision{4};
|
int precision{4};
|
||||||
|
int snapX{16};
|
||||||
|
int snapY{16};
|
||||||
|
bool gridEnabled{true};
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Script
|
struct Script
|
||||||
@@ -127,6 +130,16 @@ struct Object
|
|||||||
struct Room
|
struct Room
|
||||||
{
|
{
|
||||||
QString name;
|
QString name;
|
||||||
|
QString caption;
|
||||||
|
int width{640};
|
||||||
|
int height{480};
|
||||||
|
int speed{30};
|
||||||
|
bool persistent{};
|
||||||
|
QString creationCode;
|
||||||
|
int snapX{16};
|
||||||
|
int snapY{16};
|
||||||
|
bool gridEnabled{true};
|
||||||
|
bool isometricGrid{};
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ProjectContainer
|
struct ProjectContainer
|
||||||
|
Reference in New Issue
Block a user