Skip to content

Commit

Permalink
add controller and fix some issues
Browse files Browse the repository at this point in the history
  • Loading branch information
noisecode3 committed Dec 28, 2023
1 parent e8e4d83 commit 3acd6cd
Show file tree
Hide file tree
Showing 10 changed files with 399 additions and 412 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ set(SOURCES
src/main.cpp
src/network.h
src/worker.h
src/controller.cpp
src/controller.h
src/TombRaiderLinuxLauncher.cpp
src/TombRaiderLinuxLauncher.ui
src/resources.qrc
Expand Down
1 change: 1 addition & 0 deletions src/TombRaiderLinuxLauncher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ void TombRaiderLinuxLauncher::checkCommonFiles()
if (result == QMessageBox::Yes) {
qDebug() << "User clicked Yes.";
WorkerThread packOriginalGame(3, true, settings.value("gamePath").toString() + folder.TR3, settings.value("levelPath").toString() + "/Original.TR3");
packOriginalGame.run();


} else {
Expand Down
1 change: 1 addition & 0 deletions src/TombRaiderLinuxLauncher.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <QMainWindow>
#include <QSettings>
//#include "controller.h"

QT_BEGIN_NAMESPACE
namespace Ui { class TombRaiderLinuxLauncher; }
Expand Down
20 changes: 20 additions & 0 deletions src/controller.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include "controller.h"
Controller::Controller(QObject *parent) : QObject(parent)
{
workerThread = new WorkerThread(3, true, "folderPath", "directoryPath");
connect(workerThread, &WorkerThread::finished, this, &Controller::onWorkerThreadFinished);
}
void Controller::startWorkerThread()
{
workerThread->start();
}

void Controller::stopWorkerThread()
{
workerThread->quit();
}

void Controller::onWorkerThreadFinished()
{
// Handle worker thread finished event
}
19 changes: 19 additions & 0 deletions src/controller.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#ifndef CONTROLLER_H
#define CONTROLLER_H
#include <QObject>
#include "worker.h"
class Controller : public QObject
{
Q_OBJECT
public:
explicit Controller(QObject *parent = nullptr);
void startWorkerThread();
void stopWorkerThread();

private slots:
void onWorkerThreadFinished();

private:
WorkerThread *workerThread;
};
#endif
4 changes: 0 additions & 4 deletions src/files.h

This file was deleted.

1 change: 0 additions & 1 deletion src/leveldata.h

This file was deleted.

677 changes: 355 additions & 322 deletions src/worker.h

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion utils/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
output.h
data.json
file_info.json
84 changes: 0 additions & 84 deletions utils/file_info.json

This file was deleted.

0 comments on commit 3acd6cd

Please sign in to comment.