Skip to content
Closed
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
15 changes: 15 additions & 0 deletions src/tiled/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@
#include <QUndoView>
#include <QVariantAnimation>

#include <QProcess>

#ifdef Q_OS_WIN
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#include <QWindow>
Expand Down Expand Up @@ -525,6 +527,7 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags)
ActionManager::registerMenu(mNewLayerMenu, "NewLayer");
ActionManager::registerMenu(mGroupLayerMenu, "GroupLayer");

connect(mUi->actionRunClient, &QAction::triggered, this, &MainWindow::onRunClient);
connect(mUi->actionNewMap, &QAction::triggered, this, &MainWindow::newMap);
connect(mUi->actionNewTileset, &QAction::triggered, this, [this] { newTileset(); });
connect(mUi->actionOpen, &QAction::triggered, this, &MainWindow::openFileDialog);
Expand Down Expand Up @@ -2211,6 +2214,18 @@ void MainWindow::updateActions()
mShowPropertyTypesEditor->setEnabled(hasProject);
}

void MainWindow::onRunClient()
{
QMessageBox::information(this, tr("Debug"), tr("onRunClient() slot triggered;"));

const QString programPath = QString::fromUtf8(
"C:\\Users\\samth\\Downloads\\Game-Engines-25-26-Ionix-2\\bin"
"\\Debug-x86_64-windows\\Client\\Client.exe"
);
bool started = QProcess::startDetached(programPath);
if (!started)
QMessageBox::warning(this, tr("Error"), tr("Failed to launch Client.exe"));
}
void MainWindow::updateZoomable()
{
Zoomable *zoomable = nullptr;
Expand Down
3 changes: 3 additions & 0 deletions src/tiled/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ class TILED_EDITOR_EXPORT MainWindow : public QMainWindow

void resizeEvent(QResizeEvent *) override;

private slots:
void onRunClient();

private:
void newMap();
void openFileDialog();
Expand Down
78 changes: 55 additions & 23 deletions src/tiled/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<x>0</x>
<y>0</y>
<width>553</width>
<height>21</height>
<height>25</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
Expand All @@ -50,7 +50,7 @@
<string>&amp;Recent Files</string>
</property>
<property name="icon">
<iconset resource="tiled.qrc">
<iconset resource="../../build/Desktop_Qt_6_10_0_MSVC2022_64bit-Debug/Debug_Desktop__c61b1b0652b21d46/libtilededitor.877b2b3a/tilededitor.qrc">
<normaloff>:/images/16/document-open-recent.png</normaloff>:/images/16/document-open-recent.png</iconset>
</property>
<property name="toolTipsVisible">
Expand Down Expand Up @@ -224,6 +224,12 @@
<addaction name="separator"/>
<addaction name="actionWorldProperties"/>
</widget>
<widget class="QMenu" name="menuBuild">
<property name="title">
<string>Build</string>
</property>
<addaction name="actionRunClient"/>
</widget>
<addaction name="menuFile"/>
<addaction name="menuEdit"/>
<addaction name="menuView"/>
Expand All @@ -232,6 +238,7 @@
<addaction name="menuTileset"/>
<addaction name="menuProject"/>
<addaction name="menuHelp"/>
<addaction name="menuBuild"/>
</widget>
<action name="actionOpen">
<property name="text">
Expand All @@ -245,7 +252,7 @@
</action>
<action name="actionQuit">
<property name="icon">
<iconset resource="tiled.qrc">
<iconset resource="../../build/Desktop_Qt_6_10_0_MSVC2022_64bit-Debug/Debug_Desktop__c61b1b0652b21d46/libtilededitor.877b2b3a/tilededitor.qrc">
<normaloff>:/images/16/application-exit.png</normaloff>:/images/16/application-exit.png</iconset>
</property>
<property name="text">
Expand All @@ -260,7 +267,7 @@
<bool>false</bool>
</property>
<property name="icon">
<iconset resource="tiled.qrc">
<iconset resource="../../build/Desktop_Qt_6_10_0_MSVC2022_64bit-Debug/Debug_Desktop__c61b1b0652b21d46/libtilededitor.877b2b3a/tilededitor.qrc">
<normaloff>:/images/16/edit-copy.png</normaloff>:/images/16/edit-copy.png</iconset>
</property>
<property name="text">
Expand All @@ -272,7 +279,7 @@
<bool>false</bool>
</property>
<property name="icon">
<iconset resource="tiled.qrc">
<iconset resource="../../build/Desktop_Qt_6_10_0_MSVC2022_64bit-Debug/Debug_Desktop__c61b1b0652b21d46/libtilededitor.877b2b3a/tilededitor.qrc">
<normaloff>:/images/16/edit-paste.png</normaloff>:/images/16/edit-paste.png</iconset>
</property>
<property name="text">
Expand All @@ -281,7 +288,7 @@
</action>
<action name="actionAbout">
<property name="icon">
<iconset resource="tiled.qrc">
<iconset resource="../../build/Desktop_Qt_6_10_0_MSVC2022_64bit-Debug/Debug_Desktop__c61b1b0652b21d46/libtilededitor.877b2b3a/tilededitor.qrc">
<normaloff>:/images/16/help-about.png</normaloff>:/images/16/help-about.png</iconset>
</property>
<property name="text">
Expand All @@ -301,7 +308,7 @@
</action>
<action name="actionResizeMap">
<property name="icon">
<iconset resource="tiled.qrc">
<iconset resource="../../build/Desktop_Qt_6_10_0_MSVC2022_64bit-Debug/Debug_Desktop__c61b1b0652b21d46/libtilededitor.877b2b3a/tilededitor.qrc">
<normaloff>:/images/16/document-page-setup.png</normaloff>:/images/16/document-page-setup.png</iconset>
</property>
<property name="text">
Expand All @@ -310,7 +317,7 @@
</action>
<action name="actionMapProperties">
<property name="icon">
<iconset resource="tiled.qrc">
<iconset resource="../../build/Desktop_Qt_6_10_0_MSVC2022_64bit-Debug/Debug_Desktop__c61b1b0652b21d46/libtilededitor.877b2b3a/tilededitor.qrc">
<normaloff>:/images/16/document-properties.png</normaloff>:/images/16/document-properties.png</iconset>
</property>
<property name="text">
Expand Down Expand Up @@ -338,7 +345,7 @@
</action>
<action name="actionSaveAs">
<property name="icon">
<iconset resource="tiled.qrc">
<iconset resource="../../build/Desktop_Qt_6_10_0_MSVC2022_64bit-Debug/Debug_Desktop__c61b1b0652b21d46/libtilededitor.877b2b3a/tilededitor.qrc">
<normaloff>:/images/16/document-save-as.png</normaloff>:/images/16/document-save-as.png</iconset>
</property>
<property name="text">
Expand All @@ -355,7 +362,7 @@
</action>
<action name="actionClose">
<property name="icon">
<iconset resource="tiled.qrc">
<iconset resource="../../build/Desktop_Qt_6_10_0_MSVC2022_64bit-Debug/Debug_Desktop__c61b1b0652b21d46/libtilededitor.877b2b3a/tilededitor.qrc">
<normaloff>:/images/16/window-close.png</normaloff>:/images/16/window-close.png</iconset>
</property>
<property name="text">
Expand All @@ -364,7 +371,7 @@
</action>
<action name="actionZoomIn">
<property name="icon">
<iconset resource="tiled.qrc">
<iconset resource="../../build/Desktop_Qt_6_10_0_MSVC2022_64bit-Debug/Debug_Desktop__c61b1b0652b21d46/libtilededitor.877b2b3a/tilededitor.qrc">
<normaloff>:/images/16/zoom-in.png</normaloff>:/images/16/zoom-in.png</iconset>
</property>
<property name="text">
Expand All @@ -373,7 +380,7 @@
</action>
<action name="actionZoomOut">
<property name="icon">
<iconset resource="tiled.qrc">
<iconset resource="../../build/Desktop_Qt_6_10_0_MSVC2022_64bit-Debug/Debug_Desktop__c61b1b0652b21d46/libtilededitor.877b2b3a/tilededitor.qrc">
<normaloff>:/images/16/zoom-out.png</normaloff>:/images/16/zoom-out.png</iconset>
</property>
<property name="text">
Expand All @@ -385,7 +392,7 @@
<bool>false</bool>
</property>
<property name="icon">
<iconset resource="tiled.qrc">
<iconset resource="../../build/Desktop_Qt_6_10_0_MSVC2022_64bit-Debug/Debug_Desktop__c61b1b0652b21d46/libtilededitor.877b2b3a/tilededitor.qrc">
<normaloff>:/images/16/zoom-original.png</normaloff>:/images/16/zoom-original.png</iconset>
</property>
<property name="text">
Expand All @@ -405,7 +412,7 @@
<bool>false</bool>
</property>
<property name="icon">
<iconset resource="tiled.qrc">
<iconset resource="../../build/Desktop_Qt_6_10_0_MSVC2022_64bit-Debug/Debug_Desktop__c61b1b0652b21d46/libtilededitor.877b2b3a/tilededitor.qrc">
<normaloff>:/images/16/edit-cut.png</normaloff>:/images/16/edit-cut.png</iconset>
</property>
<property name="text">
Expand All @@ -427,7 +434,7 @@
</action>
<action name="actionClearRecentFiles">
<property name="icon">
<iconset resource="tiled.qrc">
<iconset resource="../../build/Desktop_Qt_6_10_0_MSVC2022_64bit-Debug/Debug_Desktop__c61b1b0652b21d46/libtilededitor.877b2b3a/tilededitor.qrc">
<normaloff>:/images/16/edit-clear.png</normaloff>:/images/16/edit-clear.png</iconset>
</property>
<property name="text">
Expand Down Expand Up @@ -468,7 +475,7 @@
<bool>false</bool>
</property>
<property name="icon">
<iconset resource="tiled.qrc">
<iconset resource="../../build/Desktop_Qt_6_10_0_MSVC2022_64bit-Debug/Debug_Desktop__c61b1b0652b21d46/libtilededitor.877b2b3a/tilededitor.qrc">
<normaloff>:/images/16/edit-delete.png</normaloff>:/images/16/edit-delete.png</iconset>
</property>
<property name="text">
Expand Down Expand Up @@ -616,7 +623,7 @@
</action>
<action name="actionTilesetProperties">
<property name="icon">
<iconset resource="tiled.qrc">
<iconset resource="../../build/Desktop_Qt_6_10_0_MSVC2022_64bit-Debug/Debug_Desktop__c61b1b0652b21d46/libtilededitor.877b2b3a/tilededitor.qrc">
<normaloff>:/images/16/document-properties.png</normaloff>:/images/16/document-properties.png</iconset>
</property>
<property name="text">
Expand Down Expand Up @@ -691,7 +698,7 @@
</action>
<action name="actionFitInView">
<property name="icon">
<iconset resource="tiled.qrc">
<iconset resource="../../build/Desktop_Qt_6_10_0_MSVC2022_64bit-Debug/Debug_Desktop__c61b1b0652b21d46/libtilededitor.877b2b3a/tilededitor.qrc">
<normaloff>:/images/16/zoom-fit-best.png</normaloff>:/images/16/zoom-fit-best.png</iconset>
</property>
<property name="text">
Expand All @@ -713,7 +720,7 @@
</action>
<action name="actionClearRecentProjects">
<property name="icon">
<iconset resource="tiled.qrc">
<iconset resource="../../build/Desktop_Qt_6_10_0_MSVC2022_64bit-Debug/Debug_Desktop__c61b1b0652b21d46/libtilededitor.877b2b3a/tilededitor.qrc">
<normaloff>:/images/16/edit-clear.png</normaloff>:/images/16/edit-clear.png</iconset>
</property>
<property name="text">
Expand Down Expand Up @@ -748,7 +755,7 @@
</action>
<action name="actionProjectProperties">
<property name="icon">
<iconset resource="tiled.qrc">
<iconset resource="../../build/Desktop_Qt_6_10_0_MSVC2022_64bit-Debug/Debug_Desktop__c61b1b0652b21d46/libtilededitor.877b2b3a/tilededitor.qrc">
<normaloff>:/images/16/document-properties.png</normaloff>:/images/16/document-properties.png</iconset>
</property>
<property name="text">
Expand Down Expand Up @@ -810,7 +817,7 @@
</action>
<action name="actionWorldProperties">
<property name="icon">
<iconset resource="tiled.qrc">
<iconset resource="../../build/Desktop_Qt_6_10_0_MSVC2022_64bit-Debug/Debug_Desktop__c61b1b0652b21d46/libtilededitor.877b2b3a/tilededitor.qrc">
<normaloff>:/images/16/document-properties.png</normaloff>:/images/16/document-properties.png</iconset>
</property>
<property name="text">
Expand All @@ -823,10 +830,35 @@
<enum>QAction::MenuRole::NoRole</enum>
</property>
</action>
<action name="actionRunClient">
<property name="text">
<string>Run client</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources>
<include location="tiled.qrc"/>
<include location="../../build/Desktop_Qt_6_10_0_MSVC2022_64bit-Debug/Debug_Desktop__c61b1b0652b21d46/libtilededitor.877b2b3a/tilededitor.qrc"/>
</resources>
<connections/>
<connections>
<connection>
<sender>menuBar</sender>
<signal>triggered(QAction*)</signal>
<receiver>MainWindow</receiver>
<slot>onRunClient()</slot>
<hints>
<hint type="sourcelabel">
<x>420</x>
<y>11</y>
</hint>
<hint type="destinationlabel">
<x>421</x>
<y>36</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>onRunClient()</slot>
</slots>
</ui>
Loading