1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-21 12:17: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
${LIBRARIES}
libxiv
astra_core
astra_desktop
astra_cli

View file

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

View file

@ -1,9 +1,9 @@
#include "gameinstaller.h"
#include <installextract.h>
#include <QNetworkReply>
#include <QStandardPaths>
#include <QFile>
#include <physis.hpp>
#include "launchercore.h"
@ -25,7 +25,7 @@ void installGame(LauncherCore& launcher, ProfileSettings& profile, std::function
file.write(reply->readAll());
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 << "!";

View file

@ -27,8 +27,6 @@
#include "settingswindow.h"
#include "assetupdater.h"
#include "encryptedarg.h"
#include "gamedata.h"
#include "exdparser.h"
#ifdef ENABLE_WATCHDOG
#include "watchdog.h"
@ -712,14 +710,17 @@ void LauncherCore::addRegistryKey(const ProfileSettings& settings,
}
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")) {
auto path = getEXDFilename(*exh, "exversion", "en", exh->pages[0]);
auto exd = readEXD(*exh, *data.extractFile("exd/" + path), exh->pages[0]);
EXH* exh = physis_gamedata_read_excel_sheet_header(game_data, "ExVersion");
if(exh != nullptr) {
physis_EXD exd = physis_gamedata_read_excel_sheet(game_data, "ExVersion", exh, Language::English, 0);
for(auto row : exd.rows) {
expansionNames.push_back(row.data[0].data.c_str());
for(int i = 0; i < exd.row_count; i++) {
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 <keychain.h>
#include <QDir>
#include <physis.hpp>
#include "sapphirelauncher.h"
#include "squareboot.h"
#include "gameinstaller.h"
#include "../launcher/tablet/include/tabletinterface.h"
#include "cmdinterface.h"
#include "config.h"
#include "desktopinterface.h"
#include "cmdinterface.h"
#include "../launcher/tablet/include/tabletinterface.h"
#include "gameinstaller.h"
#include "sapphirelauncher.h"
#include "squareboot.h"
int main(int argc, char* argv[]) {
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);