Skip to content

Commit

Permalink
setup
Browse files Browse the repository at this point in the history
  • Loading branch information
noisecode3 committed Dec 18, 2023
1 parent bee346f commit 870b9fc
Show file tree
Hide file tree
Showing 21 changed files with 419 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build-Debug
Binary file modified TombRaiderLinuxLauncher.pdf
Binary file not shown.
3 changes: 2 additions & 1 deletion TombRaiderPWModder/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Thumbs.db
*.rc
/.qmake.cache
/.qmake.stash
/.qtc_clangd
moc_predefs.h

# qtcreator generated files
Expand Down Expand Up @@ -71,4 +72,4 @@ moc_predefs.h
# --------
*.dll
*.exe

TombRaiderLinuxLauncher
Binary file removed TombRaiderPWModder/TombRaiderPWModder
Binary file not shown.
7 changes: 7 additions & 0 deletions TombRaiderPWModder/TombRaiderPWModder.pro
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++17
LIBS += -lcurl -lzip -lssl -lcrypto

TARGET = TombRaiderLinuxLauncher

# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
Expand All @@ -15,6 +17,8 @@ SOURCES += \
networkTR3.cpp

HEADERS += \
files.h \
originalFileList.h \
tombraiderpwmodder.h \
leveldata.h

Expand All @@ -25,3 +29,6 @@ FORMS += \
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

RESOURCES += \
resources.qrc
52 changes: 52 additions & 0 deletions TombRaiderPWModder/files.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#pragma once
#include <string>
#include <vector>
#include <algorithm>
class file
{
public:
file(const std::string path, const std::string md5sum)
: path(path), md5sum(md5sum) {}
const std::string& getPath() const { return path; }
const std::string& getMd5sum() const { return md5sum; }
private:
const std::string path; //path + name
const std::string md5sum;
};
class gameFileList
{
public:
gameFileList(const std::string name) : name(name) {}
const std::string getMd5sum(std::string& path)
{
auto it = std::find_if(list.begin(), list.end(),
[&path](const file& obj) { return obj.getPath() == path; });
if (it != list.end())
return it->getMd5sum();
return "";
}
size_t getIndex(std::string path)
{
auto it = std::find_if(list.begin(), list.end(),
[&path](const file& obj) { return obj.getPath() == path; });
if (it != list.end())
return std::distance(list.begin(), it);
else
return 0;
}
size_t getSize()
{
return list.size();
}
void addFile(const std::string path, const std::string md5sum)
{
list.push_back(file(path,md5sum));
}
file getFile(size_t index)
{
return list.at(index);
}
private:
const std::string name;
std::vector<file> list;
};
5 changes: 5 additions & 0 deletions TombRaiderPWModder/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@

#include <QApplication>


int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QApplication::setOrganizationName("TombRaiderLinuxLauncher");
QApplication::setApplicationName("TombRaiderLinuxLauncher");

// Construct the QSettings object
TombRaiderPWModder w;
w.show();
return a.exec();
Expand Down
90 changes: 90 additions & 0 deletions TombRaiderPWModder/originalFileList.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
#pragma once
#include "files.h"
//it should be put in a database, it's terrible to have this here

gameFileList TR3FileList ("TR3.Original");
void work()
{
TR3FileList.addFile("acc750411877527f118028aee957a854", "installscript.vdf");
TR3FileList.addFile("61f1377c2123f1c971cbfbf9c7ce8faf", "DATA.TAG");
TR3FileList.addFile("d09677d10864caa509ab2ffbd7ad37e7", "DEC130.DLL");
TR3FileList.addFile("4ee5d4026f15c967ed3ae599885018b0", "WINPLAY.DLL");
TR3FileList.addFile("af1d8d9435cb10fe2f4b4215eaf6bec4", "os.dat");
TR3FileList.addFile("3561c0dffdb90248fa1fc2d4fb86f08a", "data.bin");
TR3FileList.addFile("4044dc2c58f02bfea2572e80dd8f2abb", "tomb3.exe");
TR3FileList.addFile("d0f7f7eda9e692eac06b32813a86e0c3", "layout.bin");
TR3FileList.addFile("26b1f5d031c67a0b4a1832d1b4e6422c", "EDEC.DLL");
TR3FileList.addFile("bd9397ee53c1dbe34d1b4fc168d8025e", "WINSTR.DLL");
TR3FileList.addFile("f220b7353e550c8e017ab2d90fd83ae3", "WINSDEC.DLL");
TR3FileList.addFile("1df215184e1f011b274f3e7b5959adcc", "config.txt");
TR3FileList.addFile("90e64689804b4f4b0197c07290965a3c", "lang.dat");
TR3FileList.addFile("0e4643dc86f0228969c0e0c1b30c0711", "audio/cdaudio.wad");
TR3FileList.addFile("7d88aa20642a41e9d68558456683f57b", "pix/TITLEUK.BMP");
TR3FileList.addFile("ffb8d2d1cc6a4723e0c58a2fe548f94f", "pix/SOUTHPAC.BMP");
TR3FileList.addFile("2e5453045748420e576806917e0a30e3", "pix/CREDIT07.BMP");
TR3FileList.addFile("5511970cf790c81a351e19baab1b1068", "pix/CREDIT03.BMP");
TR3FileList.addFile("17e2230f562c04d2f0c0afabcad60629", "pix/CREDIT05.BMP");
TR3FileList.addFile("88332670006eb121a705c839288c0e36", "pix/CREDIT04.BMP");
TR3FileList.addFile("05608fdd5355624192a2b95eeaf21bc5", "pix/CREDIT01.BMP");
TR3FileList.addFile("8682420d6bdefcb87820065dd87e50f0", "pix/ANTARC.BMP");
TR3FileList.addFile("d942b38b5ce68d4a96b8b484e38f486f", "pix/THEEND.BMP");
TR3FileList.addFile("deb5c81fc134fb2207f16df45bf97352", "pix/CREDIT08.BMP");
TR3FileList.addFile("f1928fd6d00e1aefff2338f681c5a229", "pix/CREDIT09.BMP");
TR3FileList.addFile("7456ab850b9444fa622250ca70aac6d5", "pix/HOUSE.BMP");
TR3FileList.addFile("7fa680415bbabe15b155632a722b2ea0", "pix/CREDIT02.BMP");
TR3FileList.addFile("92756534d2ac4dc9e118c906c7c16098", "pix/INDIA.BMP");
TR3FileList.addFile("abb63ed2a790b5795082324b14a1fea7", "pix/CREDIT06.BMP");
TR3FileList.addFile("b59fc9ad5f0bd64000c73bed4c2c6e21", "pix/LEGAL.BMP");
TR3FileList.addFile("db7ae096fced4eaa630c0bec83114ee4", "pix/NEVADA.BMP");
TR3FileList.addFile("67b5cab900f04c913f6bab241c4638ff", "pix/LONDON.BMP");
TR3FileList.addFile("f56331cf11bf04dfef47492626cc9073", "pix/THEEND2.BMP");
TR3FileList.addFile("9befdc5075fdb84450d2ed0533719b12", "data/JUNGLE.TR2");
TR3FileList.addFile("69daad41e8a9ac9fad5aab6d22908de7", "data/CITY.TR2");
TR3FileList.addFile("508ba45acbe4317e23daaf54ba919d04", "data/MAIN.SFX");
TR3FileList.addFile("80f7907ded8a372bb87b1bcea178f94e", "data/ANTARC.TR2");
TR3FileList.addFile("7a46c92685674a95024a9886152f8c2c", "data/TOWER.TR2");
TR3FileList.addFile("8dc8bdc53dc53e1ec7943fac3b680a7c", "data/NEVADA.TR2");
TR3FileList.addFile("28395720a88971b6dc590489ff47d9e3", "data/TITLE.TR2");
TR3FileList.addFile("070d4a7b486c234d3e84ebaba904d48a", "data/TONYBOSS.TR2");
TR3FileList.addFile("01e6f703493807dfd513d4fcd7f29ffd", "data/VICT.TR2");
TR3FileList.addFile("3ae21d4e98daf1692a1eaf0acd9d6958", "data/TOMBPC.DAT");
TR3FileList.addFile("18af2d4384904bf48c6941fb51382672", "data/TEMPLE.TR2");
TR3FileList.addFile("ee80c9522dffc40aef5576de09ad5ded", "data/QUADCHAS.TR2");
TR3FileList.addFile("59dc31d9020943e5ef85942df0a88c58", "data/AREA51.TR2");
TR3FileList.addFile("438cd76e0e7be12464c3bef35d0216f5", "data/CHAMBER.TR2");
TR3FileList.addFile("d2f6ef3fbd87a86f9c2d561765a19d89", "data/SEWER.TR2");
TR3FileList.addFile("7b064a9d5b7cb17bd4e16261242bc940", "data/SHORE.TR2");
TR3FileList.addFile("538f602ac876cee837a07760a3dbe3aa", "data/MINES.TR2");
TR3FileList.addFile("9b3f54902d526472008408949f23032b", "data/ROOFS.TR2");
TR3FileList.addFile("1630b3f25a226d51d7f4875300133e8e", "data/COMPOUND.TR2");
TR3FileList.addFile("ab8b5f6f568432666aaf5c4d83b9f6f2", "data/CRASH.TR2");
TR3FileList.addFile("ba54a5782912a4ef83929f687009377e", "data/OFFICE.TR2");
TR3FileList.addFile("0275cb33c94e840859a622763865a2e9", "data/STPAUL.TR2");
TR3FileList.addFile("c9c011b71964426ecd269c314ad5f4c1", "data/TRIBOSS.TR2");
TR3FileList.addFile("f080de24577654474fa1ebd6d07673e2", "data/RAPIDS.TR2");
TR3FileList.addFile("5e11d251ddb12b98ebead1883dc12d2a", "data/HOUSE.TR2");
TR3FileList.addFile("ee2d0aa76754fe0744c47f4ad9fcd607", "fmv/Crsh_Eng.rpl");
TR3FileList.addFile("6947a8a13b70235f9fc1aa3ea4db1da9", "fmv/Sail_Eng.rpl");
TR3FileList.addFile("20be937db48b25b57bc88e9d47517905", "fmv/logo.rpl");
TR3FileList.addFile("3afa8b9903af0c8dabee5f6f1eb396d0", "fmv/Intr_Eng.rpl");
TR3FileList.addFile("24b90bdd3219facfdde240c954164a59", "fmv/Endgame.rpl");
TR3FileList.addFile("e54ce1ac0106a76f72432db8e02c8dbf", "cuts/CUT1.TR2");
TR3FileList.addFile("81ff9f99044738510cccacc3646fc347", "cuts/CUT2.TR2");
TR3FileList.addFile("e93435fb9577ed5da27b8cb95e6a85f0", "cuts/CUT6.TR2");
TR3FileList.addFile("a75d14b398ffbbca13bee7bc3ff0c080", "cuts/CUT11.TR2");
TR3FileList.addFile("28180b6e049b439413cd657870bf8474", "cuts/CUT9.TR2");
TR3FileList.addFile("4a061d14750d36c236ae4e2c22e75aa4", "cuts/CUT4.TR2");
TR3FileList.addFile("19b04538646d2603308f37cea64d8e66", "cuts/CUT7.TR2");
TR3FileList.addFile("0bfe24996a41984434de13470e359b05", "cuts/CUT12.TR2");
TR3FileList.addFile("86290b1ac08dfb0d500357d9e861c072", "cuts/CUT5.TR2");
TR3FileList.addFile("3135f022bceccc129c43997c2e53320c", "cuts/CUT3.TR2");
TR3FileList.addFile("ab459301b03aab6c35327284cacbd0bd", "cuts/CUT8.TR2");
TR3FileList.addFile("72890403f686d0a199cfcfed5296fed0", "support/info/Readme.txt");
TR3FileList.addFile("746c9a7ab8cd2bd375f6520b5cf4ae3a", "support/info/ninjahead.gif");
TR3FileList.addFile("3f463cc01e32b8de7542b1f9a2aa9e91", "support/info/support.htm");
TR3FileList.addFile("bb72ad0b84f5d6cad35b6a3a7cb28ab9", "support/info/slegal.gif");
TR3FileList.addFile("cf6df27145b94333dffa488e52a905ff", "support/info/eidos.gif");
TR3FileList.addFile("cfaa679cd484b0709c36c8324dbf0960", "support/info/Ninja.jpg");
TR3FileList.addFile("a78b2f1ec41c1443d04592714b9ab36c", "support/info/core.jpg");
TR3FileList.addFile("a1030488e87c0edbdfc5b8ebeba53235", "support/info/tr3logo.jpg");
}
Binary file added TombRaiderPWModder/pictures/Lara.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added TombRaiderPWModder/pictures/Tomb_Raider_I.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added TombRaiderPWModder/pictures/Tomb_Raider_II.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added TombRaiderPWModder/pictures/Tomb_Raider_III.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added TombRaiderPWModder/pictures/Tomb_Raider_IIII.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
10 changes: 10 additions & 0 deletions TombRaiderPWModder/resources.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<RCC>
<qresource prefix="/pictures">
<file>pictures/Lara.jpg</file>
<file>pictures/Tomb_Raider_I.jpg</file>
<file>pictures/Tomb_Raider_II.jpg</file>
<file>pictures/Tomb_Raider_III.jpg</file>
<file>pictures/Tomb_Raider_IIII.jpg</file>
<file>pictures/Tomb_Raider_IIIII.jpg</file>
</qresource>
</RCC>
26 changes: 23 additions & 3 deletions TombRaiderPWModder/tombraiderpwmodder.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#include <QSettings>
#include <QDebug>
#include "tombraiderpwmodder.h"
#include "ui_tombraiderpwmodder.h"
#include "originalFileList.h"
#include <iostream>
#include <filesystem>
#include <dirent.h>
#include <unistd.h>

/* int currentIndex = stackedWidget->currentIndex();
* int nextPage = (currentIndex + 1) % stackedWidget->count();
* stackedWidget->setCurrentIndex(nextPage);
Expand All @@ -16,6 +18,10 @@ TombRaiderPWModder::TombRaiderPWModder(QWidget *parent)
{
ui->setupUi(this);
connect(ui->pushButtonLink, SIGNAL (clicked()), this, SLOT (linkClicked()));

// Construct the QSettings object
QSettings settings;

DIR *dpdf;
struct dirent *epdf;
const int prefixSize = 18;
Expand Down Expand Up @@ -43,7 +49,7 @@ TombRaiderPWModder::TombRaiderPWModder(QWidget *parent)
std::filesystem::path p(path2);
std::filesystem::exists(p) ?
std::filesystem::is_symlink(p) ?
std::cout << std::filesystem::read_symlink(p) << '\n' :
std::cout << std::filesystem::read_symlink(p) << '\n' : //TODO SET SECLECTED
std::cout << " exists but it is not a symlink\n" :
std::cout << " does not exist\n";

Expand Down Expand Up @@ -73,7 +79,7 @@ TombRaiderPWModder::TombRaiderPWModder(QWidget *parent)
QString s(epdf->d_name + 17);
if(s == "Jonson-TheInfadaCult")//this is just a test to add picture
{
QIcon i("3573.jpg");
QIcon i("./3573.jpg");
QListWidgetItem *wi = new QListWidgetItem(i, s);
wi->setIcon(i);
ui->listWidgetModds->addItem(wi);
Expand All @@ -88,6 +94,20 @@ TombRaiderPWModder::TombRaiderPWModder(QWidget *parent)
closedir(dpdf);
}
}
void readSavedSettings()
{

// Save a setting
//settings.setValue("exampleKey", "exampleValue");

// Read a setting
//QString value = settings.value("exampleKey").toString();
//qDebug() << "Read value:" << value;
}
void setup()
{
//make qt save changes
}

void TombRaiderPWModder::readNextCstring(int &index, char* cString, char* path)
{
Expand Down
1 change: 1 addition & 0 deletions TombRaiderPWModder/tombraiderpwmodder.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public slots:
void linkClicked();

private:
void setup();
void readNextCstring(int &index, char* cString, char* path);
Ui::TombRaiderPWModder *ui;
};
Expand Down
Loading

0 comments on commit 870b9fc

Please sign in to comment.