Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scene Editor PR #150

Merged
merged 4 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
188 changes: 147 additions & 41 deletions RetroEDv2/tools/sceneeditor.cpp

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion RetroEDv2/tools/sceneeditor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class SceneEditor : public QWidget
void TitleChanged(QString title, QString tabFullPath);

public slots:
void updateType(SceneEntity *entity, byte type);
void updateType(SceneEntity *entity, byte type, bool keepVals = false);
protected:
bool event(QEvent *event);
bool eventFilter(QObject *object, QEvent *event);
Expand All @@ -178,9 +178,13 @@ public slots:
COPY_LAYER,
COPY_CHUNK,
COPY_ENTITY,
COPY_ENTITY_SELECT,
COPY_SCROLLINFO,
};
void *clipboard = nullptr;
QList<int> clipboardIDs;
QList<Vector2<float>> clipboardOffset;
Vector2<float> clipPosCenter;
byte clipboardType = COPY_NONE;
int clipboardInfo = 0;

Expand Down
103 changes: 55 additions & 48 deletions RetroEDv2/tools/sceneeditor.ui
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</size>
</property>
<property name="currentIndex">
<number>0</number>
<number>3</number>
</property>
<widget class="QWidget" name="layerPage">
<property name="geometry">
Expand Down Expand Up @@ -139,68 +139,38 @@
<string>Entity List</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0" colspan="6">
<item row="1" column="0" colspan="6">
<widget class="QListWidget" name="entityList"/>
</item>
<item row="2" column="1">
<spacer name="horizontalSpacer_6">
<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 row="2" column="0">
<widget class="QToolButton" name="addEnt">
<property name="toolTip">
<string>Adds an entity</string>
</property>
<property name="text">
<string>+</string>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/icons/ic_add_circle_48px.svg</normaloff>:/icons/ic_add_circle_48px.svg</iconset>
</property>
</widget>
</item>
<item row="2" column="5">
<widget class="QToolButton" name="rmEnt">
<property name="enabled">
<bool>false</bool>
</property>
<item row="3" column="3">
<widget class="QToolButton" name="downEnt">
<property name="toolTip">
<string>Removes an entity</string>
<string>Moves an entity down</string>
</property>
<property name="text">
<string>-</string>
<string>D</string>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/icons/ic_cancel_48px.svg</normaloff>:/icons/ic_cancel_48px.svg</iconset>
<normaloff>:/icons/ic_arrow_downward_48px.svg</normaloff>:/icons/ic_arrow_downward_48px.svg</iconset>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QToolButton" name="downEnt">
<item row="3" column="0">
<widget class="QToolButton" name="addEnt">
<property name="toolTip">
<string>Moves an entity down</string>
<string>Adds an entity</string>
</property>
<property name="text">
<string>D</string>
<string>+</string>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/icons/ic_arrow_downward_48px.svg</normaloff>:/icons/ic_arrow_downward_48px.svg</iconset>
<normaloff>:/icons/ic_add_circle_48px.svg</normaloff>:/icons/ic_add_circle_48px.svg</iconset>
</property>
</widget>
</item>
<item row="2" column="2">
<item row="3" column="2">
<widget class="QToolButton" name="upEnt">
<property name="toolTip">
<string>Moves an entity up</string>
Expand All @@ -214,7 +184,27 @@
</property>
</widget>
</item>
<item row="2" column="4">
<item row="2" column="0" colspan="6">
<widget class="QLineEdit" name="entityFilter">
<property name="placeholderText">
<string>Find entities...</string>
</property>
</widget>
</item>
<item row="3" column="1">
<spacer name="horizontalSpacer_6">
<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 row="3" column="4">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
Expand All @@ -227,10 +217,27 @@
</property>
</spacer>
</item>
<item row="1" column="0" colspan="6">
<widget class="QLineEdit" name="entityFilter">
<property name="placeholderText">
<string>Find entities...</string>
<item row="3" column="5">
<widget class="QToolButton" name="rmEnt">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Removes an entity</string>
</property>
<property name="text">
<string>-</string>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/icons/ic_cancel_48px.svg</normaloff>:/icons/ic_cancel_48px.svg</iconset>
</property>
</widget>
</item>
<item row="0" column="0" colspan="6">
<widget class="QLabel" name="totalEntCount">
<property name="text">
<string>Total Entity Count</string>
</property>
</widget>
</item>
Expand Down
Loading