Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
steps:

# Checkout project
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
submodules: true

Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:
shell: bash
run: cmake --install . --config $BUILD_TYPE --prefix comp_cl --component cl
- name: Upload Cl
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.artifact }}-cl
path: build/comp_cl/
Expand All @@ -98,7 +98,7 @@ jobs:
shell: bash
run: cmake --install . --config $BUILD_TYPE --prefix comp_lib --component lib
- name: Upload Lib
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.artifact }}-lib
path: build/comp_lib/
Expand All @@ -108,7 +108,7 @@ jobs:
shell: bash
run: cmake --install . --config $BUILD_TYPE --prefix comp_clib --component clib
- name: Upload Clib
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: ${{matrix.artifact}}-clib
path: build/comp_clib
Expand All @@ -118,35 +118,35 @@ jobs:
working-directory: ${{github.workspace}}/build
shell: bash
run: |
cmake $GITHUB_WORKSPACE -DINKCPP_UNREAL_TARGET_VERSION="5.7" -DINKCPP_UNREAL=ON
cmake $GITHUB_WORKSPACE -DINKCPP_UNREAL_TARGET_VERSION="5.7" -DINKCPP_UNREAL=ON -DINKCPP_INKLECATE=NONE
cmake --install . --config $BUILD_TYPE --prefix comp_unreal_5_7 --component unreal
cmake $GITHUB_WORKSPACE -DINKCPP_UNREAL_TARGET_VERSION="5.6" -DINKCPP_UNREAL=ON
cmake $GITHUB_WORKSPACE -DINKCPP_UNREAL_TARGET_VERSION="5.6" -DINKCPP_UNREAL=ON -DINKCPP_INKLECATE=NONE
cmake --install . --config $BUILD_TYPE --prefix comp_unreal_5_6 --component unreal
cmake $GITHUB_WORKSPACE -DINKCPP_UNREAL_TARGET_VERSION="5.5" -DINKCPP_UNREAL=ON
cmake $GITHUB_WORKSPACE -DINKCPP_UNREAL_TARGET_VERSION="5.5" -DINKCPP_UNREAL=ON -DINKCPP_INKLECATE=NONE
cmake --install . --config $BUILD_TYPE --prefix comp_unreal_5_5 --component unreal
cmake $GITHUB_WORKSPACE -DINKCPP_UNREAL_TARGET_VERSION="5.4" -DINKCPP_UNREAL=ON
cmake $GITHUB_WORKSPACE -DINKCPP_UNREAL_TARGET_VERSION="5.4" -DINKCPP_UNREAL=ON -DINKCPP_INKLECATE=NONE
cmake --install . --config $BUILD_TYPE --prefix comp_unreal_5_4 --component unreal
- name: Upload UE 5.7
if: ${{ matrix.unreal }}
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: unreal_5_7
path: build/comp_unreal_5_7/
- name: Upload UE 5.6
if: ${{ matrix.unreal }}
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: unreal_5_6
path: build/comp_unreal_5_6/
- name: Upload UE 5.5
if: ${{ matrix.unreal }}
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: unreal_5_5
path: build/comp_unreal_5_5/
- name: Upload UE 5.4
if: ${{ matrix.unreal }}
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: unreal_5_4
path: build/comp_unreal_5_4/
Expand Down Expand Up @@ -183,15 +183,15 @@ jobs:

# Upload results artifact
- name: Upload Results Artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: result-${{ matrix.artifact }}
path: proofing/ink-proof/${{ matrix.artifact }}.txt

# Upload website artifact
- name: Upload Ink-Proof Website Artifact
if: ${{ matrix.proof }}
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.artifact }}-www
path: proofing/ink-proof/out
Expand All @@ -203,7 +203,7 @@ jobs:
env:
DOXYGEN_VERSION: "1.17.0"
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
submodules: true
- name: Set upt Python
Expand Down Expand Up @@ -246,7 +246,7 @@ jobs:
shell: bash
run: cmake --build . --target doc --config Release
- name: Upload
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: doxygen
path: Documentation/
Expand All @@ -256,7 +256,7 @@ jobs:
needs: compilation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
submodules: true
- name: Set up Python
Expand Down Expand Up @@ -296,7 +296,7 @@ jobs:
run: |
rm dist/*.whl
- name: Upload Python files
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: python-package-distribution
path: dist/
Expand All @@ -306,7 +306,7 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'master' }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Fetch master branch
run: |
git fetch origin master
Expand All @@ -329,7 +329,7 @@ jobs:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

# Download Ink Proof page for Linux
- uses: actions/download-artifact@v4
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Download artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -35,6 +35,7 @@ jobs:
- name: List
run: tree
- name: Publish to PyPI
if: ${{! contains(github.ref_name, "+UEPatch")}}
uses: pypa/gh-action-pypi-publish@release/v1.12
- name: Create release
env:
Expand Down
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ FetchContent_Declare(
URL_HASH SHA256=26f4e188e02536d6e99e73e71d9b13e2c2144187f1368a87e82fd5066176cff8
SOURCE_DIR "${CMAKE_BINARY_DIR}/inklecate/linux")
set(FETCHCONTENT_QUIET OFF)
set(CMAKE_TLS_VERIFY ON)
mark_as_advanced(FETCHCONTENT_QUIET)
set(CMAKE_TLS_VERIFY true)
mark_as_advanced(CMAKE_TLS_VERIFY)
Expand Down Expand Up @@ -58,8 +59,8 @@ option(INKCPP_PY "Build python bindings" OFF)
cmake_dependent_option(WHEEL_BUILD "Set for build wheel python lib. (see setup.py for ussage)" OFF
"INKCPP_PY" OFF)
option(INKCPP_C "Build c library" OFF)
option(INKCPP_TEST "Build inkcpp tests (requires: inklecate in path / env: INKLECATE set \
/ INKCPP_INKLECATE=OS or ALL)" OFF)
option(INKCPP_TEST "Build inkcpp tests (requires: inklecate in path OR env: INKLECATE set \
OR INKCPP_INKLECATE=OS or ALL)" OFF)
set(INKCPP_INKLECATE
"NONE"
CACHE STRING "If inklecate should be downloaded automatically from the official release page. \
Expand Down
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,15 @@ KeyFeatures: snapshots, observers, binding ink functions, support ink [function
## Unreal Plugin

InkCPP is available via the [UE Marketplace](https://www.unrealengine.com/marketplace/product/inkcpp).
Since the Unrea Marketplace does not allow for bundling executables, you must install inklecate by hand.
If you add the first asset you will get prompted to download the correct version. Alternativly download [inklecate v1.1.1](https://github.com/inkle/ink/releases/tag/v1.1.1) unzip it and set `Project Settings > Plugins > InkCPP > Inklecate Executable Path` to the path.


Alternativly is the latest version of the UE plugin can be downloaded from the [release page](https://github.com/JBenda/inkcpp/releases/latest) (`unreal.zip`).
Place the content of this file at your plugin folder of your UE project and at the next start up it will be intigrated.
Place the content of this file at a location of your choice and run the following command to build the Plugin.
```sh
\PATH\TO\UNREAL_ENGINE\Build\BatchFiles\RunUAT.bat BuildPlugin -plugin=<location_of_your_choice>\inkcpp\inkcpp.uplugin -package=GameProject\Plugins\inkcpp -TargetPlatforms=Win64 # compile plugin
```


A example project can be found [here](https://jbenda.github.io/inkcpp/unreal/InkCPP_DEMO.zip). And here the [Documentation](https://jbenda.github.io/inkcpp/html/group__unreal.html).
Expand All @@ -57,12 +63,14 @@ mkdir build
cd build
mkdir plugin
mkdir plugin-build
cmake -DINKCPP_UNREAL_TARGET_VERSION="5.5" ..
cmake --install . --component unreal --prefix .\plugin # create source files for plugin
\PATH\TO\UNREAL_ENGINE\Build\BatchFiles\RunUAT.bat BuildPlugin -plugin=GIT_REPO\build\plugin\inkcpp\inkcpp.uplugin -package=GIT_REPO\build\plugin-build\inkcpp -TargetPlatforms=Win64 # compile plugin
move plugin-build\inkcpp UE_ENGINE\Engine\Plugins\inkcpp
cmake -DINKCPP_UNREAL_TARGET_VERSION="5.7" -DINKCPP_UNREAL=ON -DINKCPP_INKLECATE=OS -DINKCPP_UNREAL_RunUAT_PATH=\Path\TO\UNREAL_ENGINE\Build\BatchFiles\RunUAT.bat -DINKCPP_UNREAL_TARGET_PLATFORM=Win64 ..
# to set the variables with a GUI use
# cmake ..
# cmage-gui .
cmake --build . --target unreal
cmake --install . --componunt unreal_plugin --perifx ./your_project/Plugins # --prefix = path to global Plugins directory of UE or to your GameProject
```
Adapt `TargetPlatforms` as nessesarry. You might also want to install the Plugin directly into a project or the in UE5.5 introduced external plugin directory. Just adapt the pathets accordendly.
Adapt `TargetPlatforms` as nessesarry. You might also want to install the Plugin directly into a project or the in UE5.5 introduced external plugin directory. Just adapt the pathes accordendly.

## Use standalone

Expand Down
6 changes: 6 additions & 0 deletions inkcpp/hungarian_solver.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/* Copyright (c) 2024 Julian Benda
*
* This file is part of inkCPP which is released under MIT license.
* See file LICENSE.txt or go to
* https://github.com/JBenda/inkcpp for full license details.
*/
#pragma once

#include "system.h"
Expand Down
73 changes: 50 additions & 23 deletions unreal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,48 @@ if(INKCPP_UNREAL)
include(FetchContent)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/inkcpp/inkcpp.uplugin.in"
"${CMAKE_CURRENT_BINARY_DIR}/inkcpp/inkcpp.uplugin")
# download inklecate for unreal plugin
FetchContent_MakeAvailable(inklecate_mac inklecate_windows inklecate_linux)
set(FETCHCONTENT_QUIET OFF)
set(CMAKE_TLS_VERIFY true)
if(NOT inklecate_windows_SOURCE_DIR)
message(WARNING "failed to download inklecate for windows, "
"the unreal plugin will be unable use a .ink file as asset directly")
else()

# Default all platform paths to empty (= "not bundled"). They are filled in only when the download
# succeeded.
set(INKLECATE_CMD_WIN "")
set(INKLECATE_CMD_MAC "")
set(INKLECATE_CMD_LINUX "")
set(INKCPP_INKLECATE_BUNDLED FALSE)

if(inklecate_windows_SOURCE_DIR)
set(INKLECATE_CMD_WIN "Source/ThirdParty/inklecate/windows/inklecate.exe")
file(COPY "${CMAKE_BINARY_DIR}/inklecate/windows"
DESTINATION "inkcpp/Source/ThirdParty/inklecate/")
endif()
if(NOT inklecate_mac_SOURCE_DIR)
message(WARNING "failed to download inklecate for MacOS, "
"the unreal plugin will be unable use a .ink file as asset directly")
DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/inkcpp/Source/ThirdParty/inklecate/")
set(INKCPP_INKLECATE_BUNDLED TRUE)
else()
set(INKLECATE_CMD_MAC "Source/ThirdParty/inklecate/mac/inklecate")
file(COPY "${CMAKE_BINARY_DIR}/inklecate/mac" DESTINATION "inkcpp/Source/ThirdParty/inklecate/")
file(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/inkcpp/Source/ThirdParty/inklecate/windows")
message(WARNING "InkCPP: failed to download inklecate for Windows. "
"A .ink file can still be imported if the user configures the inklecate path "
"in Project Settings > Plugins > InkCPP.")
endif()
if(NOT inklecate_linux_SOURCE_DIR)
message(WARNING "failed to download inklecate for linux, "
"the unreal plugin will be unable use a .ink file as asset directly")
if(inklecate_mac_SOURCE_DIR)
set(INKLECATE_CMD_MAC "Source/ThirdParty/inklecate/mac/inklecate")
file(COPY "${CMAKE_BINARY_DIR}/inklecate/mac"
DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/inkcpp/Source/ThirdParty/inklecate/")
set(INKCPP_INKLECATE_BUNDLED TRUE)
else()
file(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/inkcpp/Source/ThirdParty/inklecate/mac")
message(WARNING "InkCPP: failed to download inklecate for macOS. "
"A .ink file can still be imported if the user configures the inklecate path "
"in Project Settings > Plugins > InkCPP.")
endif()
if(inklecate_linux_SOURCE_DIR)
set(INKLECATE_CMD_LINUX "Source/ThirdParty/inklecate/linux/inklecate")
file(COPY "${CMAKE_BINARY_DIR}/inklecate/linux"
DESTINATION "inkcpp/Source/ThirdParty/inklecate/")
DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/inkcpp/Source/ThirdParty/inklecate/")
set(INKCPP_INKLECATE_BUNDLED TRUE)
else()
file(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/inkcpp/Source/ThirdParty/inklecate/linux")
message(WARNING "InkCPP: failed to download inklecate for Linux. "
"A .ink file can still be imported if the user configures the inklecate path "
"in Project Settings > Plugins > InkCPP.")
endif()
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/inkcpp/Source/inkcpp_editor/Private/inklecate_cmd.cpp.in"
"${CMAKE_CURRENT_BINARY_DIR}/inkcpp/Source/inkcpp_editor/Private/inklecate_cmd.cpp")

file(
GLOB_RECURSE SOURCE_FILES
LIST_DIRECTORIES TRUE
Expand All @@ -57,6 +69,21 @@ if(INKCPP_UNREAL)
"${CMAKE_CURRENT_BINARY_DIR}/${src_file}" COPYONLY)
endif()
endforeach()

# When at least one inklecate binary was downloaded, regenerate inklecate_cmd.cpp from the .in
# template so the bundled paths are compiled in. The runtime code will use those paths as a
# default and also auto-fill Project Settings on first use. When no binary was downloaded
# (Fab/offline build) the COPYONLY loop above has already copied the static inklecate_cmd.cpp
# (which reads only from Project Settings), so nothing extra is needed.
if(INKCPP_INKLECATE_BUNDLED)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/inkcpp/Source/inkcpp_editor/Private/inklecate_cmd.cpp.in"
"${CMAKE_CURRENT_BINARY_DIR}/inkcpp/Source/inkcpp_editor/Private/inklecate_cmd.cpp")
message(STATUS "InkCPP: inklecate bundled — generated inklecate_cmd.cpp with embedded paths.")
else()
message(STATUS "InkCPP: no inklecate downloaded — using settings-only inklecate_cmd.cpp.")
endif()

install(
DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/inkcpp/"
DESTINATION "inkcpp"
Expand All @@ -70,7 +97,7 @@ if(INKCPP_UNREAL)
to build target `unreal` set the filepath with the variable INKCPP_UNREAL_RunUAT_PATH")
endif()
else()
message(WARNING, "To directly build the plugin with `cmake --build . --target unreal` please \
message(WARNING "To directly build the plugin with `cmake --build . --target unreal` please \
set INKCPP_UNREAL_RunUAT_PATH to point to unreals RunUAT script.")
endif()

Expand Down
4 changes: 2 additions & 2 deletions unreal/inkcpp/Source/inkcpp/Public/InkSnapshot.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ struct INKCPP_API FInkSnapshot {
, Migratable(migratable)
{
}
UPROPERTY(BlueprintReadWrite, SaveGame, Category = "ink|SaveGame")
UPROPERTY(BlueprintReadWrite, SaveGame, Category = "Ink|SaveGame")
/** Raw data used to restore runtime state.
* not needed if a USaveGame is used.
*/
TArray<uint8> data;

UPROPERTY(BlueprintReadOnly, SaveGame, Category = "ink|SaveGame")
UPROPERTY(BlueprintReadOnly, SaveGame, Category = "Ink|SaveGame")
/** Is true if the snapshot is migratable.
*/
bool Migratable;
Expand Down
Loading
Loading