Skip to content

Commit

Permalink
Update for 1.35.0 (Draft) (#2)
Browse files Browse the repository at this point in the history
* initial 1.34 update

* 1.35 first pass

* Comment out MTThreadInvoke Invoke

* 1.35.0 fixes second pass

* Math first part

* Fix potential crash

* WIP

* Fix crash in animations loading

* Fix flow coordinator external static

* Fix LevelSelection

* Fix BeatmapLevel_ForEachBeatmapKey

* More fixes

* Update UserPlatform.cpp

* Update main.cpp

* Update visibility

* Final fixes

* Bump version 6.3.0

* Update workflows

* Create action.yml

* Fix QMod building

---------

Co-authored-by: Futuremappermydud <[email protected]>
  • Loading branch information
hardcpp and Futuremappermydud authored Jun 2, 2024
1 parent cdab6f9 commit 3fc289e
Show file tree
Hide file tree
Showing 180 changed files with 2,006 additions and 1,853 deletions.
35 changes: 35 additions & 0 deletions .github/actions/canary-ndk/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: "Setup canary ndk"
description: "Sets up canary ndk"
outputs:
ndk-path:
value: ${{ steps.path.outputs.path }}
description: "Output path of the ndk"
cache-hit:
value: ${{ steps.cache.outputs.cache-hit }}
description: "Whether a cache hit occurred for the ndk"
runs:
using: "composite"
steps:
- name: NDK cache
id: cache
uses: actions/cache@v3
with:
path: ${HOME}/android-ndk-r27-canary/
key: ${{ runner.os }}-ndk-r27-canary

- name: Download canary ndk
if: ${{ !steps.cache.outputs.cache-hit }}
env:
CANARY_URL: https://github.com/QuestPackageManager/ndk-canary-archive/releases/download/27.0.1/android-ndk-10883340-linux-x86_64.zip
run: wget ${CANARY_URL} -O ${HOME}/ndk.zip
shell: bash

- name: Unzip ndk
if: ${{ !steps.cache.outputs.cache-hit }}
run: 7z x "${HOME}/ndk.zip" -o"${HOME}/"
shell: bash

- name: Set output
id: path
shell: bash
run: echo "path=${HOME}/android-ndk-r27-canary" >> ${GITHUB_OUTPUT}
15 changes: 14 additions & 1 deletion .github/workflows/build-ndk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,24 @@ jobs:

- uses: seanmiddleditch/gha-setup-ninja@v3

# Use canary NDK to avoid lesser known compile bugs
- name: Setup canary NDK
id: setup-ndk
uses: ./.github/actions/canary-ndk

- name: Create ndkpath.txt
run: |
echo "$ANDROID_NDK_LATEST_HOME" > ${GITHUB_WORKSPACE}/ndkpath.txt
echo ${{ steps.setup-ndk.outputs.ndk-path }} > ${GITHUB_WORKSPACE}/ndkpath.txt
cat ${GITHUB_WORKSPACE}/ndkpath.txt
# get version from pushed tag
- name: Extract version
if: startsWith(github.ref, 'refs/tags/v')
id: version
run: |
echo "TAG=${GITHUB_REF#refs/tags/}" >> ${GITHUB_OUTPUT}
echo "VERSION=${GITHUB_REF#refs/tags/v}" >> ${GITHUB_OUTPUT}
- name: Setup qpm
uses: Fernthedev/qpm-action@main
with:
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,24 @@ jobs:

- uses: seanmiddleditch/gha-setup-ninja@v3

# Use canary NDK to avoid lesser known compile bugs
- name: Setup canary NDK
id: setup-ndk
uses: ./.github/actions/canary-ndk

- name: Create ndkpath.txt
run: |
echo "$ANDROID_NDK_LATEST_HOME" > ${GITHUB_WORKSPACE}/ndkpath.txt
echo ${{ steps.setup-ndk.outputs.ndk-path }} > ${GITHUB_WORKSPACE}/ndkpath.txt
cat ${GITHUB_WORKSPACE}/ndkpath.txt
# get version from pushed tag
- name: Extract version
if: startsWith(github.ref, 'refs/tags/v')
id: version
run: |
echo "TAG=${GITHUB_REF#refs/tags/}" >> ${GITHUB_OUTPUT}
echo "VERSION=${GITHUB_REF#refs/tags/v}" >> ${GITHUB_OUTPUT}
- name: Get Tag Version
id: get_tag_version
run: |
Expand Down
4 changes: 2 additions & 2 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"env": {
"ndkPath": "D:/User/Repositories/GitHubQuestModding/android-ndk-r24"
"ndkPath": "D:/User/Repositories/GitHubQuestModding/android-ndk-r27-canary"
},
"configurations": [
{
Expand All @@ -13,7 +13,7 @@
],
"includePath": [
"${workspaceFolder}/extern/includes/libil2cpp/il2cpp/libil2cpp",
"${workspaceFolder}/extern/includes/codegen/include",
"${workspaceFolder}/extern/includes/bs-cordl/include",
"${workspaceFolder}/extern/includes",
"${workspaceFolder}/include",
"${workspaceFolder}/shared",
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@
"stop_token": "cpp",
"__std_stream": "cpp",
"memory_resource": "cpp",
"ranges": "cpp"
"ranges": "cpp",
"__verbose_abort": "cpp"
},
"editor.formatOnSave": false,
"editor.trimAutoWhitespace": true,
Expand Down
34 changes: 30 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# include some defines automatically made by qpm
include(qpm_defines.cmake)
include(${EXTERN_DIR}/includes/kaleb/shared/cmake/assets.cmake)

add_definitions(-DCP_SDK_BMBF)
add_definitions(-DDEBUG_SCENES)
Expand Down Expand Up @@ -32,10 +33,34 @@ set(SHARED_DIR ${CMAKE_CURRENT_SOURCE_DIR}/shared)
# compile options used
add_compile_options(-frtti -fexceptions)
add_compile_options(-O3)

# get git info
execute_process(COMMAND git config user.name OUTPUT_VARIABLE GIT_USER)
execute_process(COMMAND git branch --show-current OUTPUT_VARIABLE GIT_BRANCH)
execute_process(COMMAND git rev-parse --short HEAD OUTPUT_VARIABLE GIT_COMMIT)
execute_process(COMMAND git diff-index --quiet HEAD RESULT_VARIABLE GIT_MODIFIED)

string(STRIP "${GIT_USER}" GIT_USER)
string(STRIP "${GIT_BRANCH}" GIT_BRANCH)
string(STRIP "${GIT_COMMIT}" GIT_COMMIT)
string(STRIP "${GIT_MODIFIED}" GIT_MODIFIED)

message(STATUS "GIT_USER: ${GIT_USER}")
message(STATUS "GIT_BRANCH: ${GIT_BRANCH}")
message(STATUS "GIT_COMMIT: 0x${GIT_COMMIT}")
message(STATUS "GIT_MODIFIED: ${GIT_MODIFIED}")

# set git defines
add_compile_definitions(GIT_USER=\"${GIT_USER}\")
add_compile_definitions(GIT_BRANCH=\"${GIT_BRANCH}\")
add_compile_definitions(GIT_COMMIT=0x${GIT_COMMIT})
add_compile_definitions(GIT_MODIFIED=${GIT_MODIFIED})

# compile definitions used
add_compile_definitions(VERSION=\"${MOD_VERSION}\")
add_compile_definitions(MOD_ID=\"${MOD_ID}\")
add_compile_definitions(__USE_LARGEFILE64)
add_compile_definitions(BEATSABER_1_29_4_OR_NEWER)

# recursively get all src files
RECURSE_FILES(h_file_lista ${INCLUDE_DIR}/*.hpp)
Expand All @@ -58,6 +83,9 @@ add_library(
${c_file_list}
)

# Add any assets
add_assets(assets_${COMPILE_ID} STATIC ${CMAKE_CURRENT_LIST_DIR}/assets ${INCLUDE_DIR}/assets.hpp)

# get the vcpkg dir from env variables
if(EXISTS $ENV{VCPKG_ROOT})
set(VCPKG_ROOT $ENV{VCPKG_ROOT})
Expand All @@ -77,6 +105,7 @@ target_include_directories(${COMPILE_ID} PUBLIC ${SHARED_DIR})
target_include_directories(${COMPILE_ID} PRIVATE ${EXTERN_DIR}/includes/${CODEGEN_ID}/include)

target_link_libraries(${COMPILE_ID} PRIVATE -llog)
target_link_libraries(${COMPILE_ID} PRIVATE assets_${COMPILE_ID})

# add extern stuff like libs and other includes
include(extern.cmake)
Expand Down Expand Up @@ -120,7 +149,4 @@ add_custom_command(TARGET ${COMPILE_ID} POST_BUILD
add_custom_command(TARGET ${COMPILE_ID} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${a_file} debug/${file}
COMMENT "Copy a files for ndk stack")
endforeach()


include(assets_include.cmake)
endforeach()
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ And to initilize the module
#include "MyModule.hpp"

#include <CP_SDK/ChatPlexSDK.hpp>
#include <CP_SDK/Logging/BMBFLogger.hpp>
#include <CP_SDK/Logging/PaperLogger.hpp>

#include <beatsaber-hook/shared/utils/il2cpp-functions.hpp>
#include <custom-types/shared/register.hpp>
Expand Down
Binary file modified assets/QuestFonts.bundle
Binary file not shown.
116 changes: 0 additions & 116 deletions assets_include.cmake

This file was deleted.

14 changes: 12 additions & 2 deletions copy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,22 @@ $modFiles = $modJson.modFiles

foreach ($fileName in $modFiles) {
if ($useDebug -eq $true) {
& adb push build/debug/$fileName /sdcard/Android/data/com.beatgames.beatsaber/files/mods/$fileName
& adb push build/debug/$fileName /sdcard/ModData/com.beatgames.beatsaber/Modloader/mods/$fileName
} else {
& adb push build/$fileName /sdcard/Android/data/com.beatgames.beatsaber/files/mods/$fileName
& adb push build/$fileName /sdcard/ModData/com.beatgames.beatsaber/Modloader/mods/$fileName
}
}

$modFiles = $modJson.lateModFiles
foreach ($fileName in $modFiles) {
if ($useDebug -eq $true) {
& adb push build/debug/$fileName /sdcard/ModData/com.beatgames.beatsaber/Modloader/mods/$fileName
} else {
& adb push build/$fileName /sdcard/ModData/com.beatgames.beatsaber/Modloader/mods/$fileName
}
}


& $PSScriptRoot/restart-game.ps1

if ($log -eq $true) {
Expand Down
29 changes: 17 additions & 12 deletions createqmod.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,35 @@ if ((-not ($cover -eq "./")) -and (Test-Path $cover))
$fileList += ,$cover
}

foreach ($mod in $modJson.modFiles)
{
foreach ($mod in $modJson.modFiles) {
$path = "./build/" + $mod
if (-not (Test-Path $path)) {
$path = "./extern/libs/" + $mod
}
if (-not (Test-Path $path)) {
Write-Output "Error: could not find dependency: $path"
exit 1
}
$filelist += $path
}
foreach ($mod in $modJson.lateModFiles) {
$path = "./build/" + $mod
if (-not (Test-Path $path))
{
if (-not (Test-Path $path)) {
$path = "./extern/libs/" + $mod
}
if (-not (Test-Path $path))
{
if (-not (Test-Path $path)) {
Write-Output "Error: could not find dependency: $path"
exit 1
}
$filelist += $path
}

foreach ($lib in $modJson.libraryFiles)
{
foreach ($lib in $modJson.libraryFiles) {
$path = "./build/" + $lib
if (-not (Test-Path $path))
{
if (-not (Test-Path $path)) {
$path = "./extern/libs/" + $lib
}
if (-not (Test-Path $path))
{
if (-not (Test-Path $path)) {
Write-Output "Error: could not find dependency: $path"
exit 1
}
Expand Down
Loading

0 comments on commit 3fc289e

Please sign in to comment.