Skip to content

Commit

Permalink
Merge pull request #61 from oblivioncth/dev
Browse files Browse the repository at this point in the history
Merge to master for v0.7.5.4
  • Loading branch information
oblivioncth authored Oct 17, 2024
2 parents a7f5de5 + 183ecd7 commit 7dfb0fa
Show file tree
Hide file tree
Showing 22 changed files with 581 additions and 258 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/build-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ jobs:
with:
runs_exclude: >
[
{ "os": "windows-latest", "linkage": "shared" },
{ "os": "ubuntu-20.04"},
{ "os": "ubuntu-22.04"}
{ "linkage": "shared" },
{ "compiler": "g++-10" }
]
17 changes: 14 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cmake_minimum_required(VERSION 3.24.0...3.30.0)
# Project
# NOTE: DON'T USE TRAILING ZEROS IN VERSIONS
project(FIL
VERSION 0.7.5.3
VERSION 0.7.5.4
LANGUAGES CXX
DESCRIPTION "Flashpoint Importer for Launchers"
)
Expand Down Expand Up @@ -34,7 +34,9 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
enable_language("RC")
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
enable_language("RC")
endif()

#================= Build =========================

Expand All @@ -59,10 +61,17 @@ set(FIL_QX_COMPONENTS
Gui
Network
Widgets
Windows-gui
Xml
)

if(CMAKE_SYSTEM_NAME STREQUAL Windows)
list(APPEND FIL_QX_COMPONENTS Windows-gui)
endif()

if(CMAKE_SYSTEM_NAME STREQUAL Linux)
list(APPEND FIL_QX_COMPONENTS Linux)
endif()

include(OB/FetchQx)
ob_fetch_qx(
REF "0572d288936afd63ff6f5b6ce4b1fbfc0f03b0eb"
Expand All @@ -75,6 +84,8 @@ include(OB/Fetchlibfp)
ob_fetch_libfp("183a479d00235d332aa1046a9b5ba98f62699752")

# Fetch CLIFp (build and import from source)
include(OB/Utility)
ob_cache_project_version(CLIFp)
include(OB/FetchCLIFp)
ob_fetch_clifp("7139ae998b292eb595e751ba4cb8599230435358")

Expand Down
40 changes: 31 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ For Platforms, the importer is capable of importing each game/animation along wi

Checkout **[Usage (Primary)](#usage-primary)** to get started.

[![Dev Builds](https://github.com/oblivioncth/FIL/actions/workflows/push-reaction.yml/badge.svg?branch=dev)](https://github.com/oblivioncth/FIL/actions/workflows/push-reaction.yml)
[![Dev Builds](https://github.com/oblivioncth/FIL/actions/workflows/build-project.yml/badge.svg?branch=dev)](https://github.com/oblivioncth/FIL/actions/workflows/build-project.yml)

## Function
This utility makes use of its sister project [CLIFp (Command-line Interface for Flashpoint)](https://github.com/oblivioncth/CLIFp) to allow launchers to actually start and exit the games correctly. It is automatically deployed into your Flashpoint installation (updated if necessary) at the end of a successful import and the latest version of CLIFp will be included in each release of this utility so it is not generally something the end-user needs to concern themselves with.
Expand Down Expand Up @@ -139,11 +139,11 @@ The symbolic link related options for handling images require the importer to be
## Usage (Tools)

### Tag Filter
The tag filter editor allows you to customize which titles will be imported based on their tags.
The tag filter editor allows you to customize which titles will be imported based on their tags.

![Tag Filter](https://i.imgur.com/EzEd0H1.png)

Tags are listed alphabetically, nested under their categories names so that you can select or unselect an entire category easily. Exclusions take precedence, so if a title features a single tag that you have unselected it will not be included in the import.
Tags are listed alphabetically, nested under their categories names so that you can select or unselect an entire category easily. Exclusions take precedence, so if a title features a single tag that you have unselected it will not be included in the import.

All tags are included by default.

Expand All @@ -160,7 +160,7 @@ This tool automatically handles installing/updating the command-line interface F

## Other Features
- The playlist import feature is "smart" in the sense that it won't include games that you aren't importing. So if you only want to import the Flash platform for example and a couple playlists, you wont have to worry about useless entries in the playlist that point to games from other platforms you didn't import. This of course does not apply if you are using the "Force All" playlist game mode.

## Limitations
- Although general compatibility is quite high, compatibility with every single title cannot be assured. Issues with a title or group of titles will be fixed as they are discovered.
- The "smart" feature of the Playlist import portion of the tool has the drawback that only games that were included in the same import will be considered for that playlist. If you previously imported a Platform and now want to import a Playlist that contains games from that Platform you must make sure you select it again for it to be updated/re-imported in order for those games to be added to that Playlist. Alternatively, you can use the "Force All" playlist game mode, but this will also possibly add new platforms you did not previously import.
Expand All @@ -171,7 +171,7 @@ This tool automatically handles installing/updating the command-line interface F
### Summary

- C++20
- CMake 3.24.0
- CMake >= 3.24.0
- Targets Windows 10 and above

### Dependencies
Expand All @@ -182,8 +182,30 @@ This tool automatically handles installing/updating the command-line interface F
- [Neargye's Magic Enum](https://github.com/Neargye/magic_enum)
- [OBCMake](https://github.com/oblivioncth/OBCmake)

### Builds
Tested with MSVC2022.

### Details
The source for this project is managed by a sensible CMake configuration that allows for straightforward compilation and consumption of its target(s), either as a sub-project or as an imported package. All required dependencies except for Qt6 are automatically acquired via CMake's FetchContent mechanism.
The source for this project is managed by a sensible CMake configuration that allows for straightforward compilation and consumption of its target(s), either as a sub-project or as an imported package. All required dependencies except for Qt6 are automatically acquired via CMake's FetchContent mechanism.

### Building
Ensure Qt6 is installed and locatable by CMake (or alternatively use the `qt-cmake` script that comes with Qt in-place of the`cmake` command).

Right now, a static build is required in order for CLIFp to work correctly.

Should work with MSVC, MINGW64, clang, and gcc.

```
# Acquire source
git clone https://github.com/oblivioncth/FIL
# Configure (ninja optional, but recommended)
cmake -S FIL -B build-FIL -G "Ninja Multi-config"
# Build
cmake --build build-FIL
# Install
cmake --install build-FIL
# Run
cd "build-FIL/out/install/bin"
fil
```
152 changes: 88 additions & 64 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# This statement creates a command that is known to be able to create the appropraite
# output file (CLIFP.exe) by copying it from the CLIFp build. The command depends on
# CLIFp having been built in-order to be invoked
set(CLIFP_RES_PATH "${CMAKE_CURRENT_BINARY_DIR}/res/file/CLIFp.exe")
set(CLIFP_RES_PATH "${CMAKE_CURRENT_BINARY_DIR}/res/file/clifp")
add_custom_command(OUTPUT
"${CLIFP_RES_PATH}"
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:CLIFp::CLIFp>
Expand All @@ -22,63 +22,84 @@ add_custom_target(fil_copy_clifp
)

# ------------------ Setup FIL --------------------------
set(FIL_SOURCE
frontend/fe-data.h
frontend/fe-data.cpp
frontend/fe-installfoundation.h
frontend/fe-installfoundation.cpp
frontend/fe-installfoundation_win.cpp
frontend/fe-installfoundation_linux.cpp
frontend/fe-install.h
frontend/fe-install.cpp
frontend/fe-items.h
frontend/fe-items.cpp
frontend/attractmode/am-data.h
frontend/attractmode/am-data.cpp
frontend/attractmode/am-install.h
frontend/attractmode/am-install.cpp
frontend/attractmode/am-install_win.cpp
frontend/attractmode/am-install_linux.cpp
frontend/attractmode/am-items.h
frontend/attractmode/am-items.cpp
frontend/attractmode/am-settings-data.h
frontend/attractmode/am-settings-data.cpp
frontend/attractmode/am-settings-items.h
frontend/attractmode/am-settings-items.cpp
ui/mainwindow.h
ui/mainwindow.cpp
ui/mainwindow.ui
ui/progresspresenter.h
ui/progresspresenter.cpp
clifp.h
clifp.cpp
import-worker.h
import-worker.cpp
main.cpp
)

# Add via ob standard executable
include(OB/Executable)
ob_add_standard_executable(${APP_TARGET_NAME}
NAMESPACE "${PROJECT_NAMESPACE}"
ALIAS "${APP_ALIAS_NAME}"
SOURCE
clifp.h
clifp.cpp
frontend/fe-data.h
frontend/fe-data.cpp
frontend/fe-installfoundation.h
frontend/fe-installfoundation.cpp
frontend/fe-install.h
frontend/fe-install.cpp
frontend/fe-items.h
frontend/fe-items.cpp
frontend/attractmode/am-data.h
frontend/attractmode/am-data.cpp
frontend/attractmode/am-install.h
frontend/attractmode/am-install.cpp
frontend/attractmode/am-items.h
frontend/attractmode/am-items.cpp
frontend/attractmode/am-settings-data.h
frontend/attractmode/am-settings-data.cpp
frontend/attractmode/am-settings-items.h
frontend/attractmode/am-settings-items.cpp
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
list(APPEND FIL_SOURCE
frontend/launchbox/lb-data.h
frontend/launchbox/lb-data.cpp
frontend/launchbox/lb-install.h
frontend/launchbox/lb-install.cpp
frontend/launchbox/lb-items.h
frontend/launchbox/lb-items.cpp
import-worker.h
import-worker.cpp
mainwindow.h
mainwindow.cpp
mainwindow.ui
main.cpp
)
endif()

set(FIL_LINKS
PRIVATE
Qt6::Core
Qt6::Gui
Qt6::Widgets
Qt6::Xml
Qt6::Sql
Qx::Core
Qx::Io
Qx::Gui
Qx::Network
Qx::Widgets
Qx::Xml
Fp::Fp
magic_enum::magic_enum
)

if(CMAKE_SYSTEM_NAME STREQUAL Windows)
list(APPEND FIL_LINKS
Qx::Windows
Qx::Windows-gui
)
endif()

# Add via ob standard executable
include(OB/Executable)
ob_add_standard_executable(${APP_TARGET_NAME}
NAMESPACE "${PROJECT_NAMESPACE}"
ALIAS "${APP_ALIAS_NAME}"
SOURCE ${FIL_SOURCE}
RESOURCE "resources.qrc"
LINKS
PRIVATE
Qt6::Core
Qt6::Gui
Qt6::Widgets
Qt6::Xml
Qt6::Sql
Qx::Core
Qx::Io
Qx::Gui
Qx::Network
Qx::Widgets
Qx::Windows
Qx::Windows-gui
Qx::Xml
Fp::Fp
magic_enum::magic_enum
LINKS ${FIL_LINKS}
CONFIG STANDARD
WIN32
)
Expand All @@ -104,20 +125,23 @@ ob_add_cpp_vars(${APP_TARGET_NAME}
SHORT_NAME "\"${PROJECT_NAME}\""
VERSION_STR "\"${PROJECT_VERSION}\""
TARGET_FP_VER_PFX_STR "\"${TARGET_FP_VERSION_PREFIX}\""
BUNDLED_CLIFP_VERSION "\"${CLIFp_VERSION}\""
)

# Set target exe details
include(OB/WinExecutableDetails)
ob_set_win_executable_details(${APP_TARGET_NAME}
ICON "res/app/FIL.ico"
FILE_VER ${PROJECT_VERSION}
PRODUCT_VER ${TARGET_FP_VERSION_PREFIX}
COMPANY_NAME "oblivioncth"
FILE_DESC "Flashpoint Importer for Launchers"
INTERNAL_NAME "FIL"
COPYRIGHT "Open Source @ 2021 oblivioncth"
TRADEMARKS_ONE "All Rights Reserved"
TRADEMARKS_TWO "GNU AGPL V3"
ORIG_FILENAME "FIL.exe"
PRODUCT_NAME "${PROJECT_DESCRIPTION}"
)
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
include(OB/WinExecutableDetails)
ob_set_win_executable_details(${APP_TARGET_NAME}
ICON "res/app/FIL.ico"
FILE_VER ${PROJECT_VERSION}
PRODUCT_VER ${TARGET_FP_VERSION_PREFIX}
COMPANY_NAME "oblivioncth"
FILE_DESC "Flashpoint Importer for Launchers"
INTERNAL_NAME "FIL"
COPYRIGHT "Open Source @ 2021 oblivioncth"
TRADEMARKS_ONE "All Rights Reserved"
TRADEMARKS_TWO "GNU AGPL V3"
ORIG_FILENAME "FIL.exe"
PRODUCT_NAME "${PROJECT_DESCRIPTION}"
)
endif()
38 changes: 30 additions & 8 deletions app/src/clifp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,56 @@
#include "clifp.h"

// Qx Includes
#ifdef _WIN32
#include <qx/windows/qx-filedetails.h>
#endif

// libfp Includes
#include <fp/fp-install.h>

// Project Includes
#include "project_vars.h"

//===============================================================================================================
// CLIFp
//===============================================================================================================

//-Class Functions--------------------------------------------------------------------------------------------
//Public:
QString CLIFp::standardCLIFpPath(const Fp::Install& fpInstall) { return fpInstall.dir().absoluteFilePath(EXE_NAME); }

bool CLIFp::hasCLIFp(const Fp::Install& fpInstall)
Qx::VersionNumber CLIFp::internalVersion()
{
QFileInfo presentInfo(standardCLIFpPath(fpInstall));
return presentInfo.exists() && presentInfo.isFile();
static Qx::VersionNumber v = Qx::VersionNumber::fromString(PROJECT_BUNDLED_CLIFP_VERSION);
return v;
}

Qx::VersionNumber CLIFp::currentCLIFpVersion(const Fp::Install& fpInstall)
Qx::VersionNumber CLIFp::installedVersion(const Fp::Install& fpInstall)
{
if(!hasCLIFp(fpInstall))
return Qx::VersionNumber();
else
{
#ifdef _WIN32
return Qx::FileDetails::readFileDetails(standardCLIFpPath(fpInstall)).fileVersion();
#endif
/* TODO: For now on Linux we just return a null version so that deployment always
* occurs. Eventually, find a good way to grab version info from the installed ELF.
*
* Currently, we can't run it since it doesn't output to console, and there is no
* standardized way to embed the info as part of the ELF structure.
*/
return Qx::VersionNumber();
}
}

QString CLIFp::standardCLIFpPath(const Fp::Install& fpInstall) { return fpInstall.dir().absoluteFilePath(EXE_NAME); }

bool CLIFp::hasCLIFp(const Fp::Install& fpInstall)
{
QFileInfo presentInfo(standardCLIFpPath(fpInstall));
return presentInfo.exists() && presentInfo.isFile();
}

bool CLIFp::deployCLIFp(QString& errorMsg, const Fp::Install& fpInstall, const QString& sourcePath)
bool CLIFp::deployCLIFp(QString& errorMsg, const Fp::Install& fpInstall)
{
// Delete existing if present
QFile clifp(standardCLIFpPath(fpInstall));
Expand All @@ -44,7 +66,7 @@ bool CLIFp::deployCLIFp(QString& errorMsg, const Fp::Install& fpInstall, const Q
}

// Deploy new
QFile internalCLIFp(sourcePath);
QFile internalCLIFp(u":/file/clifp"_s);
if(!internalCLIFp.copy(clifp.fileName()))
{
errorMsg = internalCLIFp.errorString();
Expand Down
Loading

0 comments on commit 7dfb0fa

Please sign in to comment.