diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index b530437..d0ceb25 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -3,3 +3,4 @@ find_package(Qt5Widgets CONFIG REQUIRED) add_subdirectory(common) add_subdirectory(leveleditor) add_subdirectory(materialeditor) +add_subdirectory(sdklauncher) diff --git a/tools/materialeditor/CMakeLists.txt b/tools/materialeditor/CMakeLists.txt index 0e753fc..add0378 100644 --- a/tools/materialeditor/CMakeLists.txt +++ b/tools/materialeditor/CMakeLists.txt @@ -8,5 +8,5 @@ add_executable(MaterialEditor src/mainwindow.cpp ${EDITOR_SRC}) target_include_directories(MaterialEditor PRIVATE include) -target_link_libraries(MaterialEditor Qt5::Widgets Engine ToolWindowManager EditorCommon) +target_link_libraries(MaterialEditor Qt5::Widgets Engine EditorCommon) diff --git a/tools/sdklauncher/CMakeLists.txt b/tools/sdklauncher/CMakeLists.txt new file mode 100644 index 0000000..80a314b --- /dev/null +++ b/tools/sdklauncher/CMakeLists.txt @@ -0,0 +1,13 @@ +set(INCLUDE_FILES + include/mainwindow.h) + +qt5_wrap_cpp(EDITOR_SRC ${INCLUDE_FILES}) + +add_executable(SDKLauncher + src/main.cpp + src/mainwindow.cpp + ${EDITOR_SRC}) +target_include_directories(SDKLauncher PRIVATE include) +target_link_libraries(SDKLauncher Qt5::Widgets Engine EditorCommon) + + diff --git a/tools/sdklauncher/include/mainwindow.h b/tools/sdklauncher/include/mainwindow.h new file mode 100644 index 0000000..2b60898 --- /dev/null +++ b/tools/sdklauncher/include/mainwindow.h @@ -0,0 +1,9 @@ +#pragma once + +#include + +class MainWindow : public QMainWindow { +public: + MainWindow(); +}; + diff --git a/tools/sdklauncher/src/main.cpp b/tools/sdklauncher/src/main.cpp new file mode 100644 index 0000000..de9345c --- /dev/null +++ b/tools/sdklauncher/src/main.cpp @@ -0,0 +1,15 @@ +#include + +#include "editorstyle.h" +#include "mainwindow.h" + +int main(int argc, char* argv[]) { + QApplication app(argc, argv); + app.setStyle(new EditorStyle()); + + MainWindow window; + window.show(); + + return app.exec(); +} + diff --git a/tools/sdklauncher/src/mainwindow.cpp b/tools/sdklauncher/src/mainwindow.cpp new file mode 100644 index 0000000..d1d1698 --- /dev/null +++ b/tools/sdklauncher/src/mainwindow.cpp @@ -0,0 +1,26 @@ +#include "mainwindow.h" + +#include +#include + +MainWindow::MainWindow() { + setWindowTitle("SDK Launcher"); + + QListWidget* appList = new QListWidget(); + appList->addItem("Level Editor"); + appList->addItem("Material Editor"); + + connect(appList, &QListWidget::itemClicked, [](QListWidgetItem* item) { + QString exec; + if(item->text() == "Level Editor") + exec = "tools/leveleditor/LevelEditor"; + else if(item->text() == "Material Editor") + exec = "tools/materialeditor/MaterialEditor"; + + QProcess* process = new QProcess(); + process->start(exec); + }); + + setCentralWidget(appList); +} +