Skip to content

Commit 3fc289e

Browse files
Update for 1.35.0 (Draft) (#2)
* 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]>
1 parent cdab6f9 commit 3fc289e

File tree

180 files changed

+2006
-1853
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

180 files changed

+2006
-1853
lines changed

.github/actions/canary-ndk/action.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: "Setup canary ndk"
2+
description: "Sets up canary ndk"
3+
outputs:
4+
ndk-path:
5+
value: ${{ steps.path.outputs.path }}
6+
description: "Output path of the ndk"
7+
cache-hit:
8+
value: ${{ steps.cache.outputs.cache-hit }}
9+
description: "Whether a cache hit occurred for the ndk"
10+
runs:
11+
using: "composite"
12+
steps:
13+
- name: NDK cache
14+
id: cache
15+
uses: actions/cache@v3
16+
with:
17+
path: ${HOME}/android-ndk-r27-canary/
18+
key: ${{ runner.os }}-ndk-r27-canary
19+
20+
- name: Download canary ndk
21+
if: ${{ !steps.cache.outputs.cache-hit }}
22+
env:
23+
CANARY_URL: https://github.com/QuestPackageManager/ndk-canary-archive/releases/download/27.0.1/android-ndk-10883340-linux-x86_64.zip
24+
run: wget ${CANARY_URL} -O ${HOME}/ndk.zip
25+
shell: bash
26+
27+
- name: Unzip ndk
28+
if: ${{ !steps.cache.outputs.cache-hit }}
29+
run: 7z x "${HOME}/ndk.zip" -o"${HOME}/"
30+
shell: bash
31+
32+
- name: Set output
33+
id: path
34+
shell: bash
35+
run: echo "path=${HOME}/android-ndk-r27-canary" >> ${GITHUB_OUTPUT}

.github/workflows/build-ndk.yml

+14-1
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,24 @@ jobs:
3838

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

41+
# Use canary NDK to avoid lesser known compile bugs
42+
- name: Setup canary NDK
43+
id: setup-ndk
44+
uses: ./.github/actions/canary-ndk
45+
4146
- name: Create ndkpath.txt
4247
run: |
43-
echo "$ANDROID_NDK_LATEST_HOME" > ${GITHUB_WORKSPACE}/ndkpath.txt
48+
echo ${{ steps.setup-ndk.outputs.ndk-path }} > ${GITHUB_WORKSPACE}/ndkpath.txt
4449
cat ${GITHUB_WORKSPACE}/ndkpath.txt
4550
51+
# get version from pushed tag
52+
- name: Extract version
53+
if: startsWith(github.ref, 'refs/tags/v')
54+
id: version
55+
run: |
56+
echo "TAG=${GITHUB_REF#refs/tags/}" >> ${GITHUB_OUTPUT}
57+
echo "VERSION=${GITHUB_REF#refs/tags/v}" >> ${GITHUB_OUTPUT}
58+
4659
- name: Setup qpm
4760
uses: Fernthedev/qpm-action@main
4861
with:

.github/workflows/publish.yml

+14-1
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,24 @@ jobs:
2222

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

25+
# Use canary NDK to avoid lesser known compile bugs
26+
- name: Setup canary NDK
27+
id: setup-ndk
28+
uses: ./.github/actions/canary-ndk
29+
2530
- name: Create ndkpath.txt
2631
run: |
27-
echo "$ANDROID_NDK_LATEST_HOME" > ${GITHUB_WORKSPACE}/ndkpath.txt
32+
echo ${{ steps.setup-ndk.outputs.ndk-path }} > ${GITHUB_WORKSPACE}/ndkpath.txt
2833
cat ${GITHUB_WORKSPACE}/ndkpath.txt
2934
35+
# get version from pushed tag
36+
- name: Extract version
37+
if: startsWith(github.ref, 'refs/tags/v')
38+
id: version
39+
run: |
40+
echo "TAG=${GITHUB_REF#refs/tags/}" >> ${GITHUB_OUTPUT}
41+
echo "VERSION=${GITHUB_REF#refs/tags/v}" >> ${GITHUB_OUTPUT}
42+
3043
- name: Get Tag Version
3144
id: get_tag_version
3245
run: |

.vscode/c_cpp_properties.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"env": {
3-
"ndkPath": "D:/User/Repositories/GitHubQuestModding/android-ndk-r24"
3+
"ndkPath": "D:/User/Repositories/GitHubQuestModding/android-ndk-r27-canary"
44
},
55
"configurations": [
66
{
@@ -13,7 +13,7 @@
1313
],
1414
"includePath": [
1515
"${workspaceFolder}/extern/includes/libil2cpp/il2cpp/libil2cpp",
16-
"${workspaceFolder}/extern/includes/codegen/include",
16+
"${workspaceFolder}/extern/includes/bs-cordl/include",
1717
"${workspaceFolder}/extern/includes",
1818
"${workspaceFolder}/include",
1919
"${workspaceFolder}/shared",

.vscode/settings.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@
123123
"stop_token": "cpp",
124124
"__std_stream": "cpp",
125125
"memory_resource": "cpp",
126-
"ranges": "cpp"
126+
"ranges": "cpp",
127+
"__verbose_abort": "cpp"
127128
},
128129
"editor.formatOnSave": false,
129130
"editor.trimAutoWhitespace": true,

CMakeLists.txt

+30-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# include some defines automatically made by qpm
22
include(qpm_defines.cmake)
3+
include(${EXTERN_DIR}/includes/kaleb/shared/cmake/assets.cmake)
34

45
add_definitions(-DCP_SDK_BMBF)
56
add_definitions(-DDEBUG_SCENES)
@@ -32,10 +33,34 @@ set(SHARED_DIR ${CMAKE_CURRENT_SOURCE_DIR}/shared)
3233
# compile options used
3334
add_compile_options(-frtti -fexceptions)
3435
add_compile_options(-O3)
36+
37+
# get git info
38+
execute_process(COMMAND git config user.name OUTPUT_VARIABLE GIT_USER)
39+
execute_process(COMMAND git branch --show-current OUTPUT_VARIABLE GIT_BRANCH)
40+
execute_process(COMMAND git rev-parse --short HEAD OUTPUT_VARIABLE GIT_COMMIT)
41+
execute_process(COMMAND git diff-index --quiet HEAD RESULT_VARIABLE GIT_MODIFIED)
42+
43+
string(STRIP "${GIT_USER}" GIT_USER)
44+
string(STRIP "${GIT_BRANCH}" GIT_BRANCH)
45+
string(STRIP "${GIT_COMMIT}" GIT_COMMIT)
46+
string(STRIP "${GIT_MODIFIED}" GIT_MODIFIED)
47+
48+
message(STATUS "GIT_USER: ${GIT_USER}")
49+
message(STATUS "GIT_BRANCH: ${GIT_BRANCH}")
50+
message(STATUS "GIT_COMMIT: 0x${GIT_COMMIT}")
51+
message(STATUS "GIT_MODIFIED: ${GIT_MODIFIED}")
52+
53+
# set git defines
54+
add_compile_definitions(GIT_USER=\"${GIT_USER}\")
55+
add_compile_definitions(GIT_BRANCH=\"${GIT_BRANCH}\")
56+
add_compile_definitions(GIT_COMMIT=0x${GIT_COMMIT})
57+
add_compile_definitions(GIT_MODIFIED=${GIT_MODIFIED})
58+
3559
# compile definitions used
3660
add_compile_definitions(VERSION=\"${MOD_VERSION}\")
3761
add_compile_definitions(MOD_ID=\"${MOD_ID}\")
3862
add_compile_definitions(__USE_LARGEFILE64)
63+
add_compile_definitions(BEATSABER_1_29_4_OR_NEWER)
3964

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

86+
# Add any assets
87+
add_assets(assets_${COMPILE_ID} STATIC ${CMAKE_CURRENT_LIST_DIR}/assets ${INCLUDE_DIR}/assets.hpp)
88+
6189
# get the vcpkg dir from env variables
6290
if(EXISTS $ENV{VCPKG_ROOT})
6391
set(VCPKG_ROOT $ENV{VCPKG_ROOT})
@@ -77,6 +105,7 @@ target_include_directories(${COMPILE_ID} PUBLIC ${SHARED_DIR})
77105
target_include_directories(${COMPILE_ID} PRIVATE ${EXTERN_DIR}/includes/${CODEGEN_ID}/include)
78106

79107
target_link_libraries(${COMPILE_ID} PRIVATE -llog)
108+
target_link_libraries(${COMPILE_ID} PRIVATE assets_${COMPILE_ID})
80109

81110
# add extern stuff like libs and other includes
82111
include(extern.cmake)
@@ -120,7 +149,4 @@ add_custom_command(TARGET ${COMPILE_ID} POST_BUILD
120149
add_custom_command(TARGET ${COMPILE_ID} POST_BUILD
121150
COMMAND ${CMAKE_COMMAND} -E copy ${a_file} debug/${file}
122151
COMMENT "Copy a files for ndk stack")
123-
endforeach()
124-
125-
126-
include(assets_include.cmake)
152+
endforeach()

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ And to initilize the module
192192
#include "MyModule.hpp"
193193

194194
#include <CP_SDK/ChatPlexSDK.hpp>
195-
#include <CP_SDK/Logging/BMBFLogger.hpp>
195+
#include <CP_SDK/Logging/PaperLogger.hpp>
196196

197197
#include <beatsaber-hook/shared/utils/il2cpp-functions.hpp>
198198
#include <custom-types/shared/register.hpp>

assets/QuestFonts.bundle

15.6 KB
Binary file not shown.

assets_include.cmake

-116
This file was deleted.

copy.ps1

+12-2
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,22 @@ $modFiles = $modJson.modFiles
5656

5757
foreach ($fileName in $modFiles) {
5858
if ($useDebug -eq $true) {
59-
& adb push build/debug/$fileName /sdcard/Android/data/com.beatgames.beatsaber/files/mods/$fileName
59+
& adb push build/debug/$fileName /sdcard/ModData/com.beatgames.beatsaber/Modloader/mods/$fileName
6060
} else {
61-
& adb push build/$fileName /sdcard/Android/data/com.beatgames.beatsaber/files/mods/$fileName
61+
& adb push build/$fileName /sdcard/ModData/com.beatgames.beatsaber/Modloader/mods/$fileName
6262
}
6363
}
6464

65+
$modFiles = $modJson.lateModFiles
66+
foreach ($fileName in $modFiles) {
67+
if ($useDebug -eq $true) {
68+
& adb push build/debug/$fileName /sdcard/ModData/com.beatgames.beatsaber/Modloader/mods/$fileName
69+
} else {
70+
& adb push build/$fileName /sdcard/ModData/com.beatgames.beatsaber/Modloader/mods/$fileName
71+
}
72+
}
73+
74+
6575
& $PSScriptRoot/restart-game.ps1
6676

6777
if ($log -eq $true) {

createqmod.ps1

+17-12
Original file line numberDiff line numberDiff line change
@@ -21,30 +21,35 @@ if ((-not ($cover -eq "./")) -and (Test-Path $cover))
2121
$fileList += ,$cover
2222
}
2323

24-
foreach ($mod in $modJson.modFiles)
25-
{
24+
foreach ($mod in $modJson.modFiles) {
25+
$path = "./build/" + $mod
26+
if (-not (Test-Path $path)) {
27+
$path = "./extern/libs/" + $mod
28+
}
29+
if (-not (Test-Path $path)) {
30+
Write-Output "Error: could not find dependency: $path"
31+
exit 1
32+
}
33+
$filelist += $path
34+
}
35+
foreach ($mod in $modJson.lateModFiles) {
2636
$path = "./build/" + $mod
27-
if (-not (Test-Path $path))
28-
{
37+
if (-not (Test-Path $path)) {
2938
$path = "./extern/libs/" + $mod
3039
}
31-
if (-not (Test-Path $path))
32-
{
40+
if (-not (Test-Path $path)) {
3341
Write-Output "Error: could not find dependency: $path"
3442
exit 1
3543
}
3644
$filelist += $path
3745
}
3846

39-
foreach ($lib in $modJson.libraryFiles)
40-
{
47+
foreach ($lib in $modJson.libraryFiles) {
4148
$path = "./build/" + $lib
42-
if (-not (Test-Path $path))
43-
{
49+
if (-not (Test-Path $path)) {
4450
$path = "./extern/libs/" + $lib
4551
}
46-
if (-not (Test-Path $path))
47-
{
52+
if (-not (Test-Path $path)) {
4853
Write-Output "Error: could not find dependency: $path"
4954
exit 1
5055
}

0 commit comments

Comments
 (0)