1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-21 20:27:45 +00:00

Switch to using physis for expansion names and game installation

This commit is contained in:
Joshua Goins 2022-07-21 20:53:19 -04:00
parent afae349ae8
commit 6458ef0ef7
5 changed files with 18 additions and 17 deletions

View file

@ -9,7 +9,6 @@ add_executable(astra
target_link_libraries(astra PUBLIC target_link_libraries(astra PUBLIC
${LIBRARIES} ${LIBRARIES}
libxiv
astra_core astra_core
astra_desktop astra_desktop
astra_cli astra_cli

View file

@ -38,8 +38,8 @@ target_include_directories(astra_core PUBLIC
${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}
include) include)
target_link_libraries(astra_core PUBLIC target_link_libraries(astra_core PUBLIC
libxiv
physis physis
z # FIXME: remove!
${LIBRARIES} ${LIBRARIES}
Qt5::Core Qt5::Core
Qt5::Network Qt5::Network

View file

@ -1,9 +1,9 @@
#include "gameinstaller.h" #include "gameinstaller.h"
#include <installextract.h>
#include <QNetworkReply> #include <QNetworkReply>
#include <QStandardPaths> #include <QStandardPaths>
#include <QFile> #include <QFile>
#include <physis.hpp>
#include "launchercore.h" #include "launchercore.h"
@ -25,7 +25,7 @@ void installGame(LauncherCore& launcher, ProfileSettings& profile, std::function
file.write(reply->readAll()); file.write(reply->readAll());
file.close(); file.close();
extractBootstrapFiles((dataDir + "/ffxivsetup.exe").toStdString(), installDirectory.toStdString()); physis_install_game(installDirectory.toStdString().c_str(), (dataDir + "/ffxivsetup.exe").toStdString().c_str());
qDebug() << "Done installing to " << installDirectory << "!"; qDebug() << "Done installing to " << installDirectory << "!";

View file

@ -27,8 +27,6 @@
#include "settingswindow.h" #include "settingswindow.h"
#include "assetupdater.h" #include "assetupdater.h"
#include "encryptedarg.h" #include "encryptedarg.h"
#include "gamedata.h"
#include "exdparser.h"
#ifdef ENABLE_WATCHDOG #ifdef ENABLE_WATCHDOG
#include "watchdog.h" #include "watchdog.h"
@ -712,14 +710,17 @@ void LauncherCore::addRegistryKey(const ProfileSettings& settings,
} }
void LauncherCore::readGameData(ProfileSettings& profile) { void LauncherCore::readGameData(ProfileSettings& profile) {
GameData data(profile.gamePath.toStdString() + "/game/sqpack"); auto path = profile.gamePath.toStdString() + "/game";
GameData* game_data = physis_gamedata_initialize(path.c_str());
if(auto exh = data.readExcelSheet("ExVersion")) { EXH* exh = physis_gamedata_read_excel_sheet_header(game_data, "ExVersion");
auto path = getEXDFilename(*exh, "exversion", "en", exh->pages[0]); if(exh != nullptr) {
auto exd = readEXD(*exh, *data.extractFile("exd/" + path), exh->pages[0]); physis_EXD exd = physis_gamedata_read_excel_sheet(game_data, "ExVersion", exh, Language::English, 0);
for(auto row : exd.rows) { for(int i = 0; i < exd.row_count; i++) {
expansionNames.push_back(row.data[0].data.c_str()); expansionNames.push_back(exd.row_data[i].column_data[0].string._0);
} }
} }
physis_gamedata_free(game_data);
} }

View file

@ -5,14 +5,15 @@
#include <QCommandLineParser> #include <QCommandLineParser>
#include <keychain.h> #include <keychain.h>
#include <QDir> #include <QDir>
#include <physis.hpp>
#include "sapphirelauncher.h" #include "../launcher/tablet/include/tabletinterface.h"
#include "squareboot.h" #include "cmdinterface.h"
#include "gameinstaller.h"
#include "config.h" #include "config.h"
#include "desktopinterface.h" #include "desktopinterface.h"
#include "cmdinterface.h" #include "gameinstaller.h"
#include "../launcher/tablet/include/tabletinterface.h" #include "sapphirelauncher.h"
#include "squareboot.h"
int main(int argc, char* argv[]) { int main(int argc, char* argv[]) {
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);