Skip to content

Commit

Permalink
Preparation of Rotating Sprites (not finished yet)
Browse files Browse the repository at this point in the history
  • Loading branch information
jowin202 committed Mar 11, 2024
1 parent 374e09d commit 1caa57b
Show file tree
Hide file tree
Showing 9 changed files with 486 additions and 25 deletions.
5 changes: 4 additions & 1 deletion OpenSprite.pro
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ SOURCES += \
main.cpp \
mainwindow.cpp \
palette.cpp \
rotations/rotationdialog.cpp \
sprite.cpp \
spriteview.cpp

Expand All @@ -34,14 +35,16 @@ HEADERS += \
fileio.h \
mainwindow.h \
palette.h \
rotations/rotationdialog.h \
sprite.h \
spriteview.h

FORMS += \
animations/animationdialog.ui \
animations/animationform.ui \
exportdialog.ui \
mainwindow.ui
mainwindow.ui \
rotations/rotationdialog.ui


RC_ICONS = icons/opensprite96x96.ico
Expand Down
4 changes: 4 additions & 0 deletions exportdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
<property name="windowTitle">
<string>OpenSprite Export</string>
</property>
<property name="windowIcon">
<iconset>
<normaloff>:/icons/opensprite96x96.png</normaloff>:/icons/opensprite96x96.png</iconset>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="0" colspan="3">
<widget class="QGroupBox" name="groupBox_2">
Expand Down
13 changes: 12 additions & 1 deletion mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include "exportdialog.h"
#include "animations/animationdialog.h"
#include "rotations/rotationdialog.h"

MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
Expand Down Expand Up @@ -632,7 +633,7 @@ void MainWindow::on_actionAbout_triggered()
{
QMessageBox msgBox(this);
msgBox.setTextFormat(Qt::RichText);
msgBox.setText("Version: 1.3 (02 / 2024)<br>Author: Johannes Winkler<br>License: GNU GPL License<br><a href='https://github.com/jowin202/OpenSprite'>https://github.com/jowin202/OpenSprite</a>");
msgBox.setText("Version: 1.4 (04 / 2024)<br>Author: Johannes Winkler<br>License: GNU GPL License<br><a href='https://github.com/jowin202/OpenSprite'>https://github.com/jowin202/OpenSprite</a>");
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.exec();
}
Expand Down Expand Up @@ -757,3 +758,13 @@ void MainWindow::on_actionMC_1_MC_2_triggered()
this->ui->graphicsView->scene()->update();
}


void MainWindow::on_actionRotate_triggered()
{
RotationDialog *dialog = new RotationDialog(&opt);
dialog->show();
connect(dialog, &RotationDialog::finished, [=](){
this->ui->graphicsView->redraw();
});
}

2 changes: 2 additions & 0 deletions mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ private slots:

void on_actionMC_1_MC_2_triggered();

void on_actionRotate_triggered();

private:
Ui::MainWindow *ui;
AnimationDialog *animation_dialog = 0;
Expand Down
45 changes: 25 additions & 20 deletions mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<string>OpenSprite</string>
</property>
<property name="windowIcon">
<iconset resource="icons.qrc">
<iconset>
<normaloff>:/icons/opensprite96x96.png</normaloff>:/icons/opensprite96x96.png</iconset>
</property>
<widget class="QWidget" name="centralwidget">
Expand Down Expand Up @@ -756,6 +756,8 @@
<addaction name="actionReflect_Top_to_Bottom"/>
<addaction name="separator"/>
<addaction name="menuColor_Switch"/>
<addaction name="separator"/>
<addaction name="actionRotate"/>
</widget>
<widget class="QMenu" name="menuHelp">
<property name="title">
Expand Down Expand Up @@ -815,7 +817,7 @@
</action>
<action name="actionCut">
<property name="icon">
<iconset resource="icons.qrc">
<iconset>
<normaloff>:/icons/cut.svg</normaloff>:/icons/cut.svg</iconset>
</property>
<property name="text">
Expand All @@ -827,7 +829,7 @@
</action>
<action name="actionCopy">
<property name="icon">
<iconset resource="icons.qrc">
<iconset>
<normaloff>:/icons/copy.svg</normaloff>:/icons/copy.svg</iconset>
</property>
<property name="text">
Expand All @@ -839,7 +841,7 @@
</action>
<action name="actionPaste">
<property name="icon">
<iconset resource="icons.qrc">
<iconset>
<normaloff>:/icons/paste.svg</normaloff>:/icons/paste.svg</iconset>
</property>
<property name="text">
Expand All @@ -854,7 +856,7 @@
<bool>false</bool>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<iconset>
<normaloff>:/icons/paste.svg</normaloff>:/icons/paste.svg</iconset>
</property>
<property name="text">
Expand All @@ -871,7 +873,7 @@
</action>
<action name="actionSlide_Up">
<property name="icon">
<iconset resource="icons.qrc">
<iconset>
<normaloff>:/icons/move-up.svg</normaloff>:/icons/move-up.svg</iconset>
</property>
<property name="text">
Expand All @@ -883,7 +885,7 @@
</action>
<action name="actionSlide_Down">
<property name="icon">
<iconset resource="icons.qrc">
<iconset>
<normaloff>:/icons/move-down.svg</normaloff>:/icons/move-down.svg</iconset>
</property>
<property name="text">
Expand All @@ -895,7 +897,7 @@
</action>
<action name="actionSlide_Left">
<property name="icon">
<iconset resource="icons.qrc">
<iconset>
<normaloff>:/icons/move-left.svg</normaloff>:/icons/move-left.svg</iconset>
</property>
<property name="text">
Expand All @@ -907,7 +909,7 @@
</action>
<action name="actionSlide_Right">
<property name="icon">
<iconset resource="icons.qrc">
<iconset>
<normaloff>:/icons/move-right.svg</normaloff>:/icons/move-right.svg</iconset>
</property>
<property name="text">
Expand All @@ -919,7 +921,7 @@
</action>
<action name="actionFlip_Top_to_Bottom">
<property name="icon">
<iconset resource="icons.qrc">
<iconset>
<normaloff>:/icons/flip_top-bottom.svg</normaloff>:/icons/flip_top-bottom.svg</iconset>
</property>
<property name="text">
Expand All @@ -928,7 +930,7 @@
</action>
<action name="actionFlip_Left_to_Right">
<property name="icon">
<iconset resource="icons.qrc">
<iconset>
<normaloff>:/icons/flip_left-right.svg</normaloff>:/icons/flip_left-right.svg</iconset>
</property>
<property name="text">
Expand All @@ -937,7 +939,7 @@
</action>
<action name="actionSave_Project">
<property name="icon">
<iconset resource="icons.qrc">
<iconset>
<normaloff>:/icons/save.svg</normaloff>:/icons/save.svg</iconset>
</property>
<property name="text">
Expand All @@ -949,7 +951,7 @@
</action>
<action name="actionSave_Project_As">
<property name="icon">
<iconset resource="icons.qrc">
<iconset>
<normaloff>:/icons/save.svg</normaloff>:/icons/save.svg</iconset>
</property>
<property name="text">
Expand Down Expand Up @@ -979,7 +981,7 @@
</action>
<action name="actionExport_as">
<property name="icon">
<iconset resource="icons.qrc">
<iconset>
<normaloff>:/icons/save_exp.svg</normaloff>:/icons/save_exp.svg</iconset>
</property>
<property name="text">
Expand All @@ -991,7 +993,7 @@
</action>
<action name="actionExport">
<property name="icon">
<iconset resource="icons.qrc">
<iconset>
<normaloff>:/icons/save_exp.svg</normaloff>:/icons/save_exp.svg</iconset>
</property>
<property name="text">
Expand All @@ -1003,7 +1005,7 @@
</action>
<action name="actionReflect_Left_To_Right">
<property name="icon">
<iconset resource="icons.qrc">
<iconset>
<normaloff>:/icons/reflect_left_to_right.svg</normaloff>:/icons/reflect_left_to_right.svg</iconset>
</property>
<property name="text">
Expand All @@ -1012,7 +1014,7 @@
</action>
<action name="actionReflect_Top_to_Bottom">
<property name="icon">
<iconset resource="icons.qrc">
<iconset>
<normaloff>:/icons/reflect_top_to_bottom.svg</normaloff>:/icons/reflect_top_to_bottom.svg</iconset>
</property>
<property name="text">
Expand Down Expand Up @@ -1058,6 +1060,11 @@
<string>MC 1 &lt;==&gt; MC 2</string>
</property>
</action>
<action name="actionRotate">
<property name="text">
<string>Rotate</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
Expand All @@ -1071,8 +1078,6 @@
<header>palette.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="icons.qrc"/>
</resources>
<resources/>
<connections/>
</ui>
Loading

0 comments on commit 1caa57b

Please sign in to comment.