Skip to content

Commit

Permalink
Merge pull request #26 from oblivioncth/feature/qx_conform
Browse files Browse the repository at this point in the history
Update support to Flashpoint 12, conform to new Qx paradigms
  • Loading branch information
oblivioncth authored Jul 25, 2023
2 parents dfcc47c + cf11444 commit 16e778d
Show file tree
Hide file tree
Showing 35 changed files with 2,162 additions and 1,336 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/build-fil-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Install Qt (custom build)
uses: oblivioncth/actions/general/install-and-cache-qt-from-ffynnon@dev
with:
version: 6.4.2
version: 6.5.1
os: windows
compiler: msvc2022
linkage: ${{ matrix.lib_linkage }}
Expand Down Expand Up @@ -65,9 +65,6 @@ jobs:
echo "Packaging FIL..."
cpack -C "Release"
echo "Build complete."
- name: Remove VC Runtime Redistributable Added by Qt # Required until an option to disable this is added to Qt
run: |
Remove-Item "${{ env.fil_install_path }}/bin/vc_redist*"
- name: Get FIL artifact name
run: |
$artifact_name=$((Get-ChildItem -Path "${{ env.fil_package_path }}" -Filter *.zip)[0].BaseName)
Expand Down
17 changes: 8 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
#================= Project Setup ==========================

# CMake
cmake_minimum_required(VERSION 3.24.0)
cmake_minimum_required(VERSION 3.24.0...3.26.0)

# Project
# NOTE: DON'T USE TRAILING ZEROS IN VERSIONS
project(FIL
VERSION 0.6.1.1
VERSION 0.7
LANGUAGES CXX
DESCRIPTION "Flashpoint Importer for Launchers"
)

# Get helper scripts
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/FetchOBCMake.cmake)
fetch_ob_cmake("v0.3")
fetch_ob_cmake("v0.3.2")

# Initialize project according to standard rules
include(OB/Project)
ob_standard_project_setup()

# Additional Project Variables
set(TARGET_FP_VERSION_PREFIX 11.1)
set(TARGET_FP_VERSION_PREFIX 12.0)

# Configuration options
# Handled by fetched libs, but set this here formally since they aren't part of the main project
Expand Down Expand Up @@ -64,18 +64,18 @@ set(FIL_QX_COMPONENTS

include(OB/FetchQx)
ob_fetch_qx(
REF "v0.5.0.1"
REF "v0.5.1"
COMPONENTS
${FIL_QX_COMPONENTS}
)

# Fetch libfp (build and import from source)
include(OB/Fetchlibfp)
ob_fetch_libfp("v0.3.1")
ob_fetch_libfp("v0.4.1")

# Fetch CLIFp (build and import from source)
include(OB/FetchCLIFp)
ob_fetch_clifp("v0.9.4.1")
ob_fetch_clifp("v0.9.5")

# TODO: The shared build of this is essentially useless as only the CLIFp executable
# is deployed, which only works if it's statically linked. There isn't a simple way
Expand All @@ -92,7 +92,7 @@ ob_fetch_clifp("v0.9.4.1")

# Fetch Neargye's Magic Enum
include(OB/FetchMagicEnum)
ob_fetch_magicenum("v0.8.0")
ob_fetch_magicenum("v0.9.3")

# Process Targets
set(APP_TARGET_NAME ${PROJECT_NAMESPACE_LC}_${PROJECT_NAMESPACE_LC})
Expand All @@ -108,7 +108,6 @@ ob_standard_project_package_config(
TARGET "${PROJECT_NAMESPACE}::${APP_ALIAS_NAME}" COMPONENT "${APP_ALIAS_NAME}" DEFAULT
)


#================= Install ==========================

ob_standard_project_misc_install()
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# FIL (Flashpoint Importer for Launchers)
<img align="left" src="https://i.imgur.com/WZbXSO2.png" width=25%>

FIL is an importer tool for several launchers/frontends that allows one to add platforms and playlists from [BlueMaxima's Flashpoint](https://bluemaxima.org/flashpoint/) project to their collection. It is fully automated and only requires the user to provide the paths to their launcher and Flashpoint installs, choose which Platforms/Playlists they wish to import, and select between a few import mode options. Once the import is started the current progress is displayed and any errors that occur are shown to the user, with resolvable errors including a prompt for what the user would like to do. After the process has completed, the specified launcher can be started and the games from Flashpoint can be played like those from any other Platform.
FIL is an importer tool for several launchers/frontends that allows one to add platforms and playlists from [Flashpoint Archive](https://flashpointarchive.org/) to their collection. It is fully automated and only requires the user to provide the paths to their launcher and Flashpoint installs, choose which Platforms/Playlists they wish to import, and select between a few import mode options. Once the import is started the current progress is displayed and any errors that occur are shown to the user, with resolvable errors including a prompt for what the user would like to do. After the process has completed, the specified launcher can be started and the games from Flashpoint can be played like those from any other Platform.

For Platforms, the importer is capable of importing each game/animation along with any additional apps, images, and most of the metadata fields (i.e. Title, Description, etc, see below).

Expand Down Expand Up @@ -38,7 +38,7 @@ Each metadata field (i.e. Title, Author, etc.) is matched to the closest equival
Both Flashpoint Ultimate and Flashpoint Infinity are supported.

### Version Matching
Each release of this application targets a specific version series of BlueMaxima's Flashpoint, which are composed of a major and minor version number, and are designed to work with all Flashpoint updates within that series. For example, a FIL release that targets Flashpoint 10.1 is intended to be used with any version of flashpoint that fits the scheme `10.1.x.x`, such as `10.1`, `10.1.0.3`, `10.1.2`, etc, but **not** `10.2`.
Each release of this application targets a specific version series of Flashpoint Archive, which are composed of a major and minor version number, and are designed to work with all Flashpoint updates within that series. For example, a FIL release that targets Flashpoint 10.1 is intended to be used with any version of flashpoint that fits the scheme `10.1.x.x`, such as `10.1`, `10.1.0.3`, `10.1.2`, etc, but **not** `10.2`.

Using a version of FIL that does not target the version of Flashpoint you wish to use it with is highly discouraged as some features may not work correctly or at all and in some cases the utility may fail to function entirely or even damage the Flashpoint install it is used with.

Expand All @@ -50,7 +50,9 @@ The title of each [release](github.com/oblivioncth/FIL/releases) will indicate w
--------------------------------------------------------------------------------------------------
**LaunchBox**

The import strategy for LaunchBox results in a setup that is straightforward and very similar to when Flashpoint used LaunchBox as its frontend. Platforms to platforms, playlists to playlists, games to games, additional apps to additional apps, and so forth.
The import strategy for LaunchBox results in a setup that is straightforward and very similar to when Flashpoint Archive used LaunchBox as its frontend. Platforms to platforms, playlists to playlists, games to games, additional apps to additional apps, and so forth.

Each platform is grouped within the platform category "Flashpoint".

All entry metadata is converted to its nearest LaunchBox equivalent, with nearly all fields being covered. One minor exception is the Flashpoint "Language" field, as it is added as a LaunchBox Custom Field, which requires a premium license to see.

Expand Down
Binary file added app/res/flashpoint/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/res/resources.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
<file>frontend/LaunchBox/icon.svg</file>
<file>frontend/AttractMode/icon.png</file>
<file>frontend/AttractMode/marquee.png</file>
<file>flashpoint/icon.png</file>
</qresource>
</RCC>
16 changes: 8 additions & 8 deletions app/src/clifp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

//-Class Functions--------------------------------------------------------------------------------------------
//Public:
QString CLIFp::standardCLIFpPath(const Fp::Install& fpInstall) { return fpInstall.fullPath() + "/" + EXE_NAME; }
QString CLIFp::standardCLIFpPath(const Fp::Install& fpInstall) { return fpInstall.fullPath() + '/' + EXE_NAME; }

bool CLIFp::hasCLIFp(const Fp::Install& fpInstall)
{
Expand All @@ -29,7 +29,7 @@ Qx::VersionNumber CLIFp::currentCLIFpVersion(const Fp::Install& fpInstall)
return Qx::FileDetails::readFileDetails(standardCLIFpPath(fpInstall)).fileVersion();
}

bool CLIFp::deployCLIFp(QString& errorMsg, const Fp::Install& fpInstall, QString sourcePath)
bool CLIFp::deployCLIFp(QString& errorMsg, const Fp::Install& fpInstall, const QString& sourcePath)
{
// Delete existing if present
QFile clifp(standardCLIFpPath(fpInstall));
Expand Down Expand Up @@ -58,18 +58,18 @@ bool CLIFp::deployCLIFp(QString& errorMsg, const Fp::Install& fpInstall, QString
return true;
}

QString CLIFp::parametersFromStandard(QString originalAppPath, QString originalAppParams)
QString CLIFp::parametersFromStandard(QStringView originalAppPath, QStringView originalAppParams)
{
QString clifpParam = "-q "; // Start with global quiet switch
QString clifpParam = u"-q "_s; // Start with global quiet switch

if(originalAppPath == Fp::Db::Table_Add_App::ENTRY_MESSAGE)
clifpParam += SHOW_COMMAND + " " + MSG_ARG.arg(originalAppParams);
clifpParam += SHOW_COMMAND + ' ' + MSG_ARG.arg(originalAppParams);
else if(originalAppPath == Fp::Db::Table_Add_App::ENTRY_EXTRAS)
clifpParam += SHOW_COMMAND + " " + EXTRA_ARG.arg(originalAppParams);
clifpParam += SHOW_COMMAND + ' ' + EXTRA_ARG.arg(originalAppParams);
else
clifpParam += RUN_COMMAND + " " + APP_ARG.arg(originalAppPath) + " " + PARAM_ARG.arg(originalAppParams);
clifpParam += RUN_COMMAND + ' ' + APP_ARG.arg(originalAppPath) + ' ' + PARAM_ARG.arg(originalAppParams);

return clifpParam;
}

QString CLIFp::parametersFromStandard(QUuid titleId) { return "-q " + PLAY_COMMAND + " " + ID_ARG.arg(titleId.toString(QUuid::WithoutBraces)); }
QString CLIFp::parametersFromStandard(QUuid titleId) { return u"-q "_s + PLAY_COMMAND + ' ' + ID_ARG.arg(titleId.toString(QUuid::WithoutBraces)); }
28 changes: 14 additions & 14 deletions app/src/clifp.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ class CLIFp
{
// Class members
public:
static inline const QString NAME = "CLIFp";
static inline const QString EXE_NAME = NAME + ".exe";
static inline const QString PLAY_COMMAND = "play";
static inline const QString RUN_COMMAND = "run";
static inline const QString SHOW_COMMAND = "show";
static inline const QString ID_ARG = R"(--id="%1")";
static inline const QString APP_ARG = R"(--app="%1")";
static inline const QString PARAM_ARG = R"(--param="%1")";
static inline const QString MSG_ARG = R"(--msg="%1")";
static inline const QString EXTRA_ARG = R"(--extra="%1")";

static inline const QString ERR_FP_CANT_DEPLOY_CLIFP = "Failed to deploy " + EXE_NAME + " to the selected Flashpoint install.\n"
static inline const QString NAME = u"CLIFp"_s;
static inline const QString EXE_NAME = NAME + u".exe"_s;
static inline const QString PLAY_COMMAND = u"play"_s;
static inline const QString RUN_COMMAND = u"run"_s;
static inline const QString SHOW_COMMAND = u"show"_s;
static inline const QString ID_ARG = uR"(--id="%1")"_s;
static inline const QString APP_ARG = uR"(--app="%1")"_s;
static inline const QString PARAM_ARG = uR"(--param="%1")"_s;
static inline const QString MSG_ARG = uR"(--msg="%1")"_s;
static inline const QString EXTRA_ARG = uR"(--extra="%1")"_s;

static inline const QString ERR_FP_CANT_DEPLOY_CLIFP = u"Failed to deploy "_s + EXE_NAME + u" to the selected Flashpoint install.\n"_s
"\n"
"%1\n"
"\n"
Expand All @@ -36,9 +36,9 @@ class CLIFp
static QString standardCLIFpPath(const Fp::Install& fpInstall);
static bool hasCLIFp(const Fp::Install& fpInstall);
static Qx::VersionNumber currentCLIFpVersion(const Fp::Install& fpInstall);
static bool deployCLIFp(QString& errorMsg, const Fp::Install& fpInstall, QString sourcePath);
static bool deployCLIFp(QString& errorMsg, const Fp::Install& fpInstall, const QString& sourcePath);

static QString parametersFromStandard(QString originalAppPath, QString originalAppParams);
static QString parametersFromStandard(QStringView originalAppPath, QStringView originalAppParams);
static QString parametersFromStandard(QUuid titleId);
};

Expand Down
Loading

0 comments on commit 16e778d

Please sign in to comment.