diff --git a/.github/actions/canary-ndk/action.yml b/.github/actions/canary-ndk/action.yml new file mode 100644 index 0000000..6454ad5 --- /dev/null +++ b/.github/actions/canary-ndk/action.yml @@ -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} \ No newline at end of file diff --git a/.github/workflows/build-ndk.yml b/.github/workflows/build-ndk.yml index 7dff990..a0323d6 100644 --- a/.github/workflows/build-ndk.yml +++ b/.github/workflows/build-ndk.yml @@ -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: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8320945..37b1150 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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: | diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index d2878d5..1915577 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -1,6 +1,6 @@ { "env": { - "ndkPath": "D:/User/Repositories/GitHubQuestModding/android-ndk-r24" + "ndkPath": "D:/User/Repositories/GitHubQuestModding/android-ndk-r27-canary" }, "configurations": [ { @@ -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/chatplex-sdk-bs/shared", "${workspaceFolder}/extern/includes", "${workspaceFolder}/include", diff --git a/.vscode/settings.json b/.vscode/settings.json index 9624ff3..17a6f4e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -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, diff --git a/CMakeLists.txt b/CMakeLists.txt index 1be0fb5..e07a967 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,8 @@ # include some defines automatically made by qpm include(qpm_defines.cmake) +include(${EXTERN_DIR}/includes/kaleb/shared/cmake/assets.cmake) -add_definitions(-DCP_SDK_UNITY) +add_definitions(-DPAPER_DISABLE_SOURCE_LOC) add_definitions(-DCP_SDK_BMBF) # override mod id @@ -32,6 +33,29 @@ 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}\") @@ -56,6 +80,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}) @@ -77,6 +104,7 @@ target_include_directories(${COMPILE_ID} PRIVATE ${EXTERN_DIR}/includes/${CODEGE target_include_directories(${COMPILE_ID} PRIVATE ${EXTERN_DIR}/includes/chatplex-sdk-bs/shared) 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) @@ -120,7 +148,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) \ No newline at end of file + endforeach() \ No newline at end of file diff --git a/assets_include.cmake b/assets_include.cmake deleted file mode 100644 index c9d5ce0..0000000 --- a/assets_include.cmake +++ /dev/null @@ -1,116 +0,0 @@ -# credit goes to https://github.com/Lauriethefish for this -# Directory where our arbitrary asset files are stored -set(ASSETS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/assets) -# Directory to save the object files generated by llvm-objcopy -set(ASSET_BINARIES_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/binaryAssets) -# Directory to save the prepended files to -set(PREPENDED_ASSETS_DIR ${CMAKE_CURRENT_BINARY_DIR}/prependedAssets) -set(ASSET_HEADER_PATH "${CMAKE_CURRENT_SOURCE_DIR}/include/assets.hpp") - -# Define a macro which we will use for defining the symbols to access our asset files below -set(ASSET_HEADER_DATA -"#pragma once - -#include -#include \"beatsaber-hook/shared/utils/typedefs.h\" - -struct IncludedAsset { - - IncludedAsset(uint8_t* start, uint8_t* end) : array(reinterpret_cast*>(start)) { - array->klass = nullptr; - array->monitor = nullptr; - array->bounds = nullptr; - array->max_length = end - start - 33; - *(end - 1)= '\\0'; - } - - operator ArrayW() const { - init(); - return array; - } - - Array* Raw() const { - init(); - return array; - } - - operator std::string_view() const { - return { reinterpret_cast(array->values), array->Length() }; - } - - operator std::span() const { - return { array->values, array->Length() }; - } - - void init() const { - if(!array->klass) - array->klass = classof(Array*); - } - - private: - Array* array; - -}; - -#define DECLARE_FILE(name) \\ - extern \"C\" uint8_t _binary_##name##_start[]; \\ - extern \"C\" uint8_t _binary_##name##_end[]; \\ - const IncludedAsset name { _binary_##name##_start, _binary_##name##_end}; - -namespace IncludedAssets { -\n") - -if (EXISTS ${ASSETS_DIRECTORY}) - file(MAKE_DIRECTORY ${ASSET_BINARIES_DIRECTORY}) - file(MAKE_DIRECTORY ${PREPENDED_ASSETS_DIR}) - file(GLOB ASSETS LIST_DIRECTORIES false ${ASSETS_DIRECTORY}/*) - - # Iterate through each file in the assets directory. TODO: This could be recursive - foreach(FILE IN LISTS ASSETS) - message("-- Including asset: ${FILE}") - get_filename_component(ASSET ${FILE} NAME) # Find the asset's file name - - # make a copy of the file with 32 bytes added in the build dir - add_custom_command( - OUTPUT ${PREPENDED_ASSETS_DIR}/${ASSET} - COMMAND ${CMAKE_COMMAND} -E echo_append " " > ${PREPENDED_ASSETS_DIR}/${ASSET} - COMMAND ${CMAKE_COMMAND} -E cat ${ASSETS_DIRECTORY}/${ASSET} >> ${PREPENDED_ASSETS_DIR}/${ASSET} - COMMAND ${CMAKE_COMMAND} -E echo_append " " >> ${PREPENDED_ASSETS_DIR}/${ASSET} - DEPENDS ${ASSETS_DIRECTORY}/${ASSET} - ) - - set(OUTPUT_FILE "${ASSET_BINARIES_DIRECTORY}/${ASSET}.o") # Save our asset in the asset binaries directory - - # Use llvm-objcopy to create an object file that stores our binary asset - # The resulting file contains 3 symbols: _binary__start, _binary__size and _binary__end - # We only use the first two - add_custom_command( - OUTPUT ${OUTPUT_FILE} - COMMAND ${CMAKE_OBJCOPY} ${ASSET} ${OUTPUT_FILE} --input-target binary --output-target elf64-aarch64 --set-section-flags binary=strings - DEPENDS ${PREPENDED_ASSETS_DIR}/${ASSET} - WORKING_DIRECTORY ${PREPENDED_ASSETS_DIR} - ) - list(APPEND BINARY_ASSET_FILES ${OUTPUT_FILE}) - - # Find the correct objcopy symbol name, this is always the file name with any non-alphanumeric characters replaced with _ - string(REGEX REPLACE "[^a-zA-Z0-9]" "_" FIXED_ASSET ${ASSET}) - # Add to our assets header - set(ASSET_HEADER_DATA "${ASSET_HEADER_DATA}\tDECLARE_FILE(${FIXED_ASSET})\n") - endforeach() - set(ASSET_HEADER_DATA "${ASSET_HEADER_DATA}\n}\n") - - # check if at least 1 asset file, otherwise ignore - list(LENGTH BINARY_ASSET_FILES COUNT) - if (${COUNT} GREATER 0) - # Generate the assets header file - file(GENERATE OUTPUT ${ASSET_HEADER_PATH} CONTENT "${ASSET_HEADER_DATA}") - - # Add our assets files to the final SO - add_library(asset_files OBJECT ${BINARY_ASSET_FILES}) - set_target_properties(asset_files PROPERTIES LINKER_LANGUAGE CXX) - target_link_libraries(${COMPILE_ID} PRIVATE asset_files ${BINARY_ASSET_FILES}) - endif() -else() - message("-- Removing '${ASSET_HEADER_PATH}' as no assets have been found in '${ASSETS_DIRECTORY}'") - file(REMOVE ${ASSET_HEADER_PATH}) -endif() diff --git a/copy.ps1 b/copy.ps1 index 312152c..92456f1 100644 --- a/copy.ps1 +++ b/copy.ps1 @@ -56,9 +56,18 @@ $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 } } diff --git a/createqmod.ps1 b/createqmod.ps1 index 6e5b4c9..79b25f8 100644 --- a/createqmod.ps1 +++ b/createqmod.ps1 @@ -32,13 +32,19 @@ foreach ($mod in $modJson.modFiles) { } $filelist += $path } +foreach ($mod in $modJson.lateModFiles) { + $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 ($lib in $modJson.libraryFiles) { - #if ($lib -eq "libchatplex-sdk-bs.so") { - # Continue - #} - - $path = "./build/" + $lib if (-not (Test-Path $path)) { $path = "./extern/libs/" + $lib diff --git a/mod.json b/mod.json index 0fe9346..77ee123 100644 --- a/mod.json +++ b/mod.json @@ -1,40 +1,42 @@ { - "_QPVersion": "0.1.2", + "_QPVersion": "0.1.1", "name": "QBeatSaberPlus-NoteTweaker", "id": "qbeatsaberplus-notetweaker", + "modloader": "Scotland2", "author": "HardCPP", - "version": "6.2.0", + "version": "6.3.0", "packageId": "com.beatgames.beatsaber", - "packageVersion": "1.28.0_4124311467", + "packageVersion": "1.35.0_8016709773", "description": "Feel good!", "coverImage": "cover.png", "dependencies": [ { - "version": "^0.33.0", - "id": "codegen", - "downloadIfMissing": "https://github.com/sc2ad/BeatSaber-Quest-Codegen/releases/download/v0.33.0/Codegen.qmod" + "version": "^0.17.6", + "id": "custom-types", + "downloadIfMissing": "https://github.com/QuestPackageManager/Il2CppQuestTypePatching/releases/download/v0.17.7/CustomTypes.qmod" }, { - "version": "^0.15.24", - "id": "custom-types", - "downloadIfMissing": "https://github.com/sc2ad/Il2CppQuestTypePatching/releases/download/v0.15.24/CustomTypes.qmod" + "version": "=1.1.4", + "id": "songcore", + "downloadIfMissing": "https://github.com/raineio/Quest-SongCore/releases/download/v1.1.4/SongCore.qmod" }, { - "version": "^0.10.15", - "id": "songloader", - "downloadIfMissing": "https://github.com/darknight1050/SongLoader/releases/download/v0.10.17/SongLoader.qmod" + "version": "^3.6.3", + "id": "paper", + "downloadIfMissing": "https://github.com/Fernthedev/paperlog/releases/download/v3.6.3/paperlog.qmod" }, { - "version": "^6.2.0", + "version": "^6.3.0", "id": "chatplex-sdk-bs", - "downloadIfMissing": "https://github.com/hardcpp/QuestChatPlexSDK-BS/releases/download/v6.2.0/ChatPlexSDK-BS.qmod" + "downloadIfMissing": "https://github.com/hardcpp/QuestChatPlexSDK-BS/releases/download/v6.3.0/ChatPlexSDK-BS.qmod" } ], - "modFiles": [ + "modFiles": [], + "lateModFiles": [ "libqbeatsaberplus-notetweaker.so" ], "libraryFiles": [ - "libbeatsaber-hook_3_14_0.so" + "libbeatsaber-hook_5_1_6.so" ], "fileCopies": [], "copyExtensions": [] diff --git a/mod.template.json b/mod.template.json index b67a3fe..aeebbde 100644 --- a/mod.template.json +++ b/mod.template.json @@ -1,16 +1,18 @@ { "$schema": "https://raw.githubusercontent.com/Lauriethefish/QuestPatcher.QMod/main/QuestPatcher.QMod/Resources/qmod.schema.json", - "_QPVersion": "0.1.2", + "_QPVersion": "0.1.1", "name": "${mod_name}", "id": "${mod_id}", + "modloader": "Scotland2", "author": "HardCPP", "version": "${version}", "packageId": "com.beatgames.beatsaber", - "packageVersion": "1.28.0_4124311467", + "packageVersion": "1.35.0_8016709773", "description": "Feel good!", "coverImage": "cover.png", "dependencies": [], "modFiles": [], "libraryFiles": [], - "fileCopies": [] + "fileCopies": [], + "copyExtensions": [] } \ No newline at end of file diff --git a/qpm.json b/qpm.json index 1354277..b821ba3 100644 --- a/qpm.json +++ b/qpm.json @@ -1,87 +1,101 @@ { + "version": "0.1.0", "sharedDir": "shared", "dependenciesDir": "extern", "info": { "name": "QBeatSaberPlus-NoteTweaker", "id": "qbeatsaberplus-notetweaker", - "version": "6.2.0", + "version": "6.3.0", "url": "https://github.com/hardcpp/QBeatSaberPlus-NoteTweaker", "additionalData": { - "cmake": true, - "overrideSoName": "libqbeatsaberplus-notetweaker.so" + "overrideSoName": "libqbeatsaberplus-notetweaker.so", + "cmake": true + } + }, + "workspace": { + "scripts": { + "build": [ + "pwsh ./build.ps1" + ], + "clean": [ + "pwsh ./build.ps1 -clean" + ], + "copy": [ + "pwsh ./copy.ps1" + ], + "log": [ + "pwsh ./start-logging.ps1" + ], + "qmod": [ + "pwsh ./build.ps1 -clean", + "pwsh ./createqmod.ps1 -clean" + ], + "qmod_backup": [ + "pwsh ./build.ps1 -clean", + "qpm qmod build", + "pwsh ./createqmod.ps1 -clean" + ] } }, "dependencies": [ { "id": "beatsaber-hook", - "versionRange": "^3.14.0", - "additionalData": { - "extraFiles": [ - "src/inline-hook" - ] - } + "versionRange": "^5.1.6", + "additionalData": {} }, { - "id": "codegen", - "versionRange": "^0.33.0", + "id": "bs-cordl", + "versionRange": "^3500.0.0", "additionalData": {} }, { "id": "custom-types", - "versionRange": "^0.15.24", + "versionRange": "^0.17.6", "additionalData": {} }, { - "id": "modloader", - "versionRange": "^1.2.3", - "additionalData": {} + "id": "scotland2", + "versionRange": "^0.1.4", + "additionalData": { + "includeQmod": false, + "private": true + } }, { "id": "libil2cpp", - "versionRange": "^0.2.3", + "versionRange": "^0.3.1", "additionalData": {} }, { - "id": "songloader", - "versionRange": "^0.10.15", - "additionalData": {} + "id": "songcore", + "versionRange": "=1.1.4", + "additionalData": { + "private": true + } }, { "id": "conditional-dependencies", - "versionRange": "^0.1.0", + "versionRange": "^0.3.0", + "additionalData": { + "private": true + } + }, + { + "id": "paper", + "versionRange": "^3.6.3", + "additionalData": {} + }, + { + "id": "kaleb", + "versionRange": "^0.1.9", "additionalData": {} }, { "id": "chatplex-sdk-bs", - "versionRange": "^6.2.0", + "versionRange": "^6.3.0", "additionalData": { "private": true } } - ], - "workspace": { - "scripts": { - "build": [ - "pwsh ./build.ps1" - ], - "clean": [ - "pwsh ./build.ps1 -clean" - ], - "copy": [ - "pwsh ./copy.ps1" - ], - "log": [ - "pwsh ./start-logging.ps1" - ], - "qmod": [ - "pwsh ./build.ps1 -clean", - "pwsh ./createqmod.ps1 -clean" - ], - "qmod_backup": [ - "pwsh ./build.ps1 -clean", - "qpm qmod build", - "pwsh ./createqmod.ps1 -clean" - ] - } - } + ] } \ No newline at end of file diff --git a/qpm.shared.json b/qpm.shared.json index 6448cf1..6c8c05c 100644 --- a/qpm.shared.json +++ b/qpm.shared.json @@ -1,191 +1,285 @@ { "config": { + "version": "0.1.0", "sharedDir": "shared", "dependenciesDir": "extern", "info": { "name": "QBeatSaberPlus-NoteTweaker", "id": "qbeatsaberplus-notetweaker", - "version": "6.2.0", + "version": "6.3.0", "url": "https://github.com/hardcpp/QBeatSaberPlus-NoteTweaker", "additionalData": { "overrideSoName": "libqbeatsaberplus-notetweaker.so", "cmake": true } }, + "workspace": { + "scripts": { + "build": [ + "pwsh ./build.ps1" + ], + "clean": [ + "pwsh ./build.ps1 -clean" + ], + "copy": [ + "pwsh ./copy.ps1" + ], + "log": [ + "pwsh ./start-logging.ps1" + ], + "qmod": [ + "pwsh ./build.ps1 -clean", + "pwsh ./createqmod.ps1 -clean" + ], + "qmod_backup": [ + "pwsh ./build.ps1 -clean", + "qpm qmod build", + "pwsh ./createqmod.ps1 -clean" + ] + }, + "qmodIncludeDirs": [], + "qmodIncludeFiles": [], + "qmodOutput": null + }, "dependencies": [ { "id": "beatsaber-hook", - "versionRange": "^3.14.0", - "additionalData": { - "extraFiles": [ - "src/inline-hook" - ] - } + "versionRange": "^5.1.6", + "additionalData": {} }, { - "id": "codegen", - "versionRange": "^0.33.0", + "id": "bs-cordl", + "versionRange": "^3500.0.0", "additionalData": {} }, { "id": "custom-types", - "versionRange": "^0.15.24", + "versionRange": "^0.17.6", "additionalData": {} }, { - "id": "modloader", - "versionRange": "^1.2.3", - "additionalData": {} + "id": "scotland2", + "versionRange": "^0.1.4", + "additionalData": { + "includeQmod": false, + "private": true + } }, { "id": "libil2cpp", - "versionRange": "^0.2.3", + "versionRange": "^0.3.1", "additionalData": {} }, { - "id": "songloader", - "versionRange": "^0.10.15", - "additionalData": {} + "id": "songcore", + "versionRange": "=1.1.4", + "additionalData": { + "private": true + } }, { "id": "conditional-dependencies", - "versionRange": "^0.1.0", + "versionRange": "^0.3.0", + "additionalData": { + "private": true + } + }, + { + "id": "paper", + "versionRange": "^3.6.3", + "additionalData": {} + }, + { + "id": "kaleb", + "versionRange": "^0.1.9", "additionalData": {} }, { "id": "chatplex-sdk-bs", - "versionRange": "^6.2.0", + "versionRange": "^6.3.0", "additionalData": { "private": true } } - ], - "workspace": { - "scripts": { - "build": [ - "pwsh ./build.ps1" - ], - "clean": [ - "pwsh ./build.ps1 -clean" - ], - "copy": [ - "pwsh ./copy.ps1" - ], - "log": [ - "pwsh ./start-logging.ps1" - ], - "qmod": [ - "pwsh ./build.ps1 -clean", - "pwsh ./createqmod.ps1 -clean" - ], - "qmod_backup": [ - "pwsh ./build.ps1 -clean", - "qpm qmod build", - "pwsh ./createqmod.ps1 -clean" - ] - } - } + ] }, "restoredDependencies": [ { "dependency": { - "id": "libil2cpp", - "versionRange": "=0.2.3", + "id": "paper", + "versionRange": "=3.6.3", "additionalData": { - "headersOnly": true + "soLink": "https://github.com/Fernthedev/paperlog/releases/download/v3.6.3/libpaperlog.so", + "debugSoLink": "https://github.com/Fernthedev/paperlog/releases/download/v3.6.3/debug_libpaperlog.so", + "overrideSoName": "libpaperlog.so", + "modLink": "https://github.com/Fernthedev/paperlog/releases/download/v3.6.3/paperlog.qmod", + "branchName": "version/v3_6_3", + "compileOptions": { + "systemIncludes": [ + "shared/utfcpp/source" + ] + }, + "cmake": false } }, - "version": "0.2.3" + "version": "3.6.3" }, { "dependency": { - "id": "modloader", - "versionRange": "=1.2.3", + "id": "libil2cpp", + "versionRange": "=0.3.2", "additionalData": { - "soLink": "https://github.com/sc2ad/QuestLoader/releases/download/v1.2.3/libmodloader64.so", - "overrideSoName": "libmodloader.so", - "branchName": "version-v1.2.3" + "headersOnly": true, + "cmake": false } }, - "version": "1.2.3" + "version": "0.3.2" }, { "dependency": { "id": "chatplex-sdk-bs", - "versionRange": "=6.2.0", + "versionRange": "=6.3.0", "additionalData": { - "soLink": "https://github.com/hardcpp/QuestChatPlexSDK-BS/releases/download/v6.2.0/libchatplex-sdk-bs.so", - "debugSoLink": "https://github.com/hardcpp/QuestChatPlexSDK-BS/releases/download/v6.2.0/debug_libchatplex-sdk-bs.so", + "soLink": "https://github.com/hardcpp/QuestChatPlexSDK-BS/releases/download/v6.3.0/libchatplex-sdk-bs.so", + "debugSoLink": "https://github.com/hardcpp/QuestChatPlexSDK-BS/releases/download/v6.3.0/debug_libchatplex-sdk-bs.so", "overrideSoName": "libchatplex-sdk-bs.so", - "modLink": "https://github.com/hardcpp/QuestChatPlexSDK-BS/releases/download/v6.2.0/ChatPlexSDK-BS.qmod", - "branchName": "version/v6_2_0", + "modLink": "https://github.com/hardcpp/QuestChatPlexSDK-BS/releases/download/v6.3.0/ChatPlexSDK-BS.qmod", + "branchName": "version/v6_3_0", "cmake": true } }, - "version": "6.2.0" + "version": "6.3.0" }, { "dependency": { - "id": "songloader", - "versionRange": "=0.10.17", + "id": "custom-types", + "versionRange": "=0.17.7", "additionalData": { - "soLink": "https://github.com/darknight1050/SongLoader/releases/download/v0.10.17/libsongloader.so", - "debugSoLink": "https://github.com/darknight1050/SongLoader/releases/download/v0.10.17/debug_libsongloader.so", - "overrideSoName": "libsongloader.so", - "modLink": "https://github.com/darknight1050/SongLoader/releases/download/v0.10.17/SongLoader.qmod", - "branchName": "version-v0.10.17" + "soLink": "https://github.com/QuestPackageManager/Il2CppQuestTypePatching/releases/download/v0.17.7/libcustom-types.so", + "debugSoLink": "https://github.com/QuestPackageManager/Il2CppQuestTypePatching/releases/download/v0.17.7/debug_libcustom-types.so", + "overrideSoName": "libcustom-types.so", + "modLink": "https://github.com/QuestPackageManager/Il2CppQuestTypePatching/releases/download/v0.17.7/CustomTypes.qmod", + "branchName": "version/v0_17_7", + "compileOptions": { + "cppFlags": [ + "-Wno-invalid-offsetof" + ] + }, + "cmake": true } }, - "version": "0.10.17" + "version": "0.17.7" }, { "dependency": { - "id": "custom-types", - "versionRange": "=0.15.24", + "id": "bs-cordl", + "versionRange": "=3500.0.0", "additionalData": { - "soLink": "https://github.com/sc2ad/Il2CppQuestTypePatching/releases/download/v0.15.24/libcustom-types.so", - "debugSoLink": "https://github.com/sc2ad/Il2CppQuestTypePatching/releases/download/v0.15.24/debug_libcustom-types.so", - "overrideSoName": "libcustom-types.so", - "modLink": "https://github.com/sc2ad/Il2CppQuestTypePatching/releases/download/v0.15.24/CustomTypes.qmod", - "branchName": "version-v0.15.24" + "headersOnly": true, + "branchName": "version/v3500_0_0", + "compileOptions": { + "includePaths": [ + "include" + ], + "cppFeatures": [], + "cppFlags": [ + "-DNEED_UNSAFE_CSHARP", + "-fdeclspec", + "-DUNITY_2021", + "-DHAS_CODEGEN" + ] + } } }, - "version": "0.15.24" + "version": "3500.0.0" }, { "dependency": { "id": "conditional-dependencies", - "versionRange": "=0.1.0", + "versionRange": "=0.3.0", + "additionalData": { + "headersOnly": true, + "branchName": "version/v0_3_0", + "cmake": false + } + }, + "version": "0.3.0" + }, + { + "dependency": { + "id": "songcore", + "versionRange": "=1.1.4", "additionalData": { - "headersOnly": true + "soLink": "https://github.com/raineio/Quest-SongCore/releases/download/v1.1.4/libsongcore.so", + "debugSoLink": "https://github.com/raineio/Quest-SongCore/releases/download/v1.1.4/debug_libsongcore.so", + "overrideSoName": "libsongcore.so", + "modLink": "https://github.com/raineio/Quest-SongCore/releases/download/v1.1.4/SongCore.qmod", + "branchName": "version/v1_1_4" } }, - "version": "0.1.0" + "version": "1.1.4" }, { "dependency": { "id": "beatsaber-hook", - "versionRange": "=3.14.0", + "versionRange": "=5.1.6", + "additionalData": { + "soLink": "https://github.com/QuestPackageManager/beatsaber-hook/releases/download/v5.1.6/libbeatsaber-hook_5_1_6.so", + "debugSoLink": "https://github.com/QuestPackageManager/beatsaber-hook/releases/download/v5.1.6/debug_libbeatsaber-hook_5_1_6.so", + "branchName": "version/v5_1_6", + "cmake": true + } + }, + "version": "5.1.6" + }, + { + "dependency": { + "id": "scotland2", + "versionRange": "=0.1.4", + "additionalData": { + "soLink": "https://github.com/sc2ad/scotland2/releases/download/v0.1.4/libsl2.so", + "debugSoLink": "https://github.com/sc2ad/scotland2/releases/download/v0.1.4/debug_libsl2.so", + "overrideSoName": "libsl2.so", + "branchName": "version/v0_1_4" + } + }, + "version": "0.1.4" + }, + { + "dependency": { + "id": "fmt", + "versionRange": "=10.0.0", "additionalData": { - "soLink": "https://github.com/sc2ad/beatsaber-hook/releases/download/v3.14.0/libbeatsaber-hook_3_14_0.so", - "debugSoLink": "https://github.com/sc2ad/beatsaber-hook/releases/download/v3.14.0/debug_libbeatsaber-hook_3_14_0.so", - "branchName": "version-v3.14.0" + "headersOnly": true, + "branchName": "version/v10_0_0", + "compileOptions": { + "systemIncludes": [ + "fmt/include/" + ], + "cppFlags": [ + "-DFMT_HEADER_ONLY" + ] + } } }, - "version": "3.14.0" + "version": "10.0.0" }, { "dependency": { - "id": "codegen", - "versionRange": "=0.33.0", + "id": "kaleb", + "versionRange": "=0.1.9", "additionalData": { - "soLink": "https://github.com/sc2ad/BeatSaber-Quest-Codegen/releases/download/v0.33.0/libcodegen.so", - "overrideSoName": "libcodegen.so", - "modLink": "https://github.com/sc2ad/BeatSaber-Quest-Codegen/releases/download/v0.33.0/Codegen.qmod", - "branchName": "version-v0.33.0" + "headersOnly": true, + "branchName": "version/v0_1_9", + "compileOptions": { + "cppFlags": [ + "-DKALEB_VERSION=\"0.1.9\"" + ] + }, + "cmake": false } }, - "version": "0.33.0" + "version": "0.1.9" } ] } \ No newline at end of file diff --git a/src/Patches/PBombNoteController.cpp b/src/Patches/PBombNoteController.cpp index 55f51a7..fee9546 100644 --- a/src/Patches/PBombNoteController.cpp +++ b/src/Patches/PBombNoteController.cpp @@ -4,6 +4,7 @@ #include +#include #include #include #include @@ -73,7 +74,7 @@ namespace QBeatSaberPlus_NoteTweaker::Patches { PBombNoteController_Enabled = IsScaleAllowed() ? NTConfig::Instance()->Enabled : false; PBombNoteController_Color = (PBombNoteController_Enabled && l_Profile->BombsOverrideColor) ? l_Profile->BombsColor : Color(0.251f, 0.251f, 0.251f, 1.000f); - PBombNoteController_Scale = ( l_BombScale) * Vector3::get_one(); + PBombNoteController_Scale = l_BombScale * Vector3::get_one(); PBombNoteController_InvScale = 1.0f / l_BombScale; if (p_OnSceneSwitch) @@ -92,7 +93,7 @@ namespace QBeatSaberPlus_NoteTweaker::Patches { p_Scale = FilterScale(p_Scale); PBombNoteController_TempEnabled = p_Enabled; - PBombNoteController_TempScale = (p_Scale) * Vector3::get_one(); + PBombNoteController_TempScale = p_Scale * Vector3::get_one(); PBombNoteController_TempInvScale = 1.0f / (p_Scale); } @@ -105,10 +106,10 @@ namespace QBeatSaberPlus_NoteTweaker::Patches { auto& l_LevelData = CP_SDK_BS::Game::Logic::LevelData(); if (l_LevelData) { - auto l_GameplayModifiers = l_LevelData->Data ? l_LevelData->Data->gameplayModifiers : nullptr; + auto l_GameplayModifiers = l_LevelData->Data ? l_LevelData->Data->___gameplayModifiers : nullptr; if (l_GameplayModifiers) { - if (l_GameplayModifiers->proMode || l_GameplayModifiers->smallCubes || l_GameplayModifiers->strictAngles) + if (l_GameplayModifiers->____proMode || l_GameplayModifiers->____smallCubes || l_GameplayModifiers->____strictAngles) return false; } } @@ -167,16 +168,16 @@ namespace QBeatSaberPlus_NoteTweaker::Patches { PBombNoteController_Cache.push_back({ __Instance, __Instance->GetComponentInChildren(), - __Instance->cuttableBySaber->GetComponent(), + __Instance->____cuttableBySaber->GetComponent(), __Instance->get_transform() }); l_Cache = &PBombNoteController_Cache.back(); - if (!l_Cache->materialPropertyBlockController->materialPropertyBlock) - l_Cache->materialPropertyBlockController->materialPropertyBlock = MaterialPropertyBlock::New_ctor(); + if (!l_Cache->materialPropertyBlockController->____materialPropertyBlock) + l_Cache->materialPropertyBlockController->____materialPropertyBlock = MaterialPropertyBlock::New_ctor(); } - l_Cache->materialPropertyBlockController->materialPropertyBlock->SetColor(PBombNoteController_ColorID, PBombNoteController_Color); + l_Cache->materialPropertyBlockController->____materialPropertyBlock->SetColor(PBombNoteController_ColorID, PBombNoteController_Color); l_Cache->materialPropertyBlockController->ApplyChanges(); l_Cache->sphereCollider->set_radius(0.18f * (PBombNoteController_TempEnabled ? PBombNoteController_TempInvScale : PBombNoteController_InvScale)); l_Cache->transform->set_localScale(PBombNoteController_TempEnabled ? PBombNoteController_TempScale : PBombNoteController_Scale); diff --git a/src/Patches/PBurstSliderGameNoteController.cpp b/src/Patches/PBurstSliderGameNoteController.cpp index 9bb9566..4bbb69a 100644 --- a/src/Patches/PBurstSliderGameNoteController.cpp +++ b/src/Patches/PBurstSliderGameNoteController.cpp @@ -2,6 +2,7 @@ #include "NTConfig.hpp" #include "Logger.hpp" +#include #include #include #include @@ -64,8 +65,8 @@ namespace QBeatSaberPlus_NoteTweaker::Patches { p_Scale = FilterScale(p_Scale); PBurstSliderGameNoteController_TempEnabled = p_Enabled; - PBurstSliderGameNoteController_TempNoteScale = (p_Scale) * Vector3::get_one(); - PBurstSliderGameNoteController_TempNoteInvScale = (1.0f / (p_Scale))* Vector3::get_one(); + PBurstSliderGameNoteController_TempNoteScale = ( p_Scale) * Vector3::get_one(); + PBurstSliderGameNoteController_TempNoteInvScale = (1.0f / p_Scale) * Vector3::get_one(); } //////////////////////////////////////////////////////////////////////////// @@ -77,10 +78,10 @@ namespace QBeatSaberPlus_NoteTweaker::Patches { auto& l_LevelData = CP_SDK_BS::Game::Logic::LevelData(); if (l_LevelData) { - auto l_GameplayModifiers = l_LevelData->Data ? l_LevelData->Data->gameplayModifiers : nullptr; + auto l_GameplayModifiers = l_LevelData->Data ? l_LevelData->Data->___gameplayModifiers : nullptr; if (l_GameplayModifiers) { - if (l_GameplayModifiers->proMode || l_GameplayModifiers->smallCubes || l_GameplayModifiers->strictAngles) + if (l_GameplayModifiers->____proMode || l_GameplayModifiers->____smallCubes || l_GameplayModifiers->____strictAngles) return false; } } @@ -114,10 +115,10 @@ namespace QBeatSaberPlus_NoteTweaker::Patches { auto l_BoxScale = PBurstSliderGameNoteController_TempEnabled ? PBurstSliderGameNoteController_TempNoteInvScale : PBurstSliderGameNoteController_NoteInvScale; - for (auto l_Current : __Instance->bigCuttableBySaberList) + for (auto l_Current : __Instance->____bigCuttableBySaberList) l_Current->get_transform()->set_localScale(l_BoxScale); - for (auto l_Current : __Instance->smallCuttableBySaberList) + for (auto l_Current : __Instance->____smallCuttableBySaberList) l_Current->get_transform()->set_localScale(l_BoxScale); } diff --git a/src/Patches/PColorNoteVisuals.cpp b/src/Patches/PColorNoteVisuals.cpp index cdb6f58..18788f9 100644 --- a/src/Patches/PColorNoteVisuals.cpp +++ b/src/Patches/PColorNoteVisuals.cpp @@ -3,6 +3,7 @@ #include "Logger.hpp" #include +#include #include #include #include @@ -206,10 +207,10 @@ namespace QBeatSaberPlus_NoteTweaker::Patches { auto l_NoteArrowGlowsIt = 0; auto l_NoteArrowGlowsMaterialPropertyBlockControllersIt = 0; - for (auto l_CurrentBlock : __Instance->materialPropertyBlockControllers) + for (auto l_CurrentBlock : __Instance->____materialPropertyBlockControllers) { - if (!l_CurrentBlock->materialPropertyBlock) - l_CurrentBlock->materialPropertyBlock = MaterialPropertyBlock::New_ctor(); + if (!l_CurrentBlock->____materialPropertyBlock) + l_CurrentBlock->____materialPropertyBlock = MaterialPropertyBlock::New_ctor(); l_Cache->materialPropertyBlockControllers[l_MaterialPropertyBlockControllersIt++] = l_CurrentBlock; @@ -217,7 +218,7 @@ namespace QBeatSaberPlus_NoteTweaker::Patches { Logger::Instance->Error(u"[Patches][ColorNoteVisuals_HandleNoteControllerDidInit] Limit reached for l_MaterialPropertyBlockControllersIt"); } - for (auto l_CurrentArrow : __Instance->arrowMeshRenderers) + for (auto l_CurrentArrow : __Instance->____arrowMeshRenderers) { l_Cache->noteArrows[l_NoteArrowsIt++] = l_CurrentArrow->get_transform(); if (l_NoteArrowsIt >= PColorNoteVisualsCache_MaxSubArray) @@ -229,18 +230,18 @@ namespace QBeatSaberPlus_NoteTweaker::Patches { PColorNoteVisuals_ComponentsCache->Clear(); l_Cache->noteArrowGlows[l_NoteArrowGlowsIt++] = l_Glow; - l_Glow->GetComponents(reinterpret_cast(csTypeOf(MaterialPropertyBlockController*)), PColorNoteVisuals_ComponentsCache.Ptr()); + l_Glow->GetComponentsForListInternal(reinterpret_cast(csTypeOf(MaterialPropertyBlockController*).convert()), PColorNoteVisuals_ComponentsCache.Ptr()); if (l_NoteArrowGlowsIt >= PColorNoteVisualsCache_MaxSubArray) Logger::Instance->Error(u"[Patches][ColorNoteVisuals_HandleNoteControllerDidInit] Limit reached for l_NoteArrowGlowsIt"); auto l_Count = PColorNoteVisuals_ComponentsCache->get_Count(); - auto l_Items = PColorNoteVisuals_ComponentsCache->items->values; + auto l_Items = PColorNoteVisuals_ComponentsCache->____items->_values; for (auto l_I = 0; l_I < l_Count; ++l_I) { auto l_CurrentBlock = reinterpret_cast(l_Items[l_I]); - if (!l_CurrentBlock->materialPropertyBlock) - l_CurrentBlock->materialPropertyBlock = MaterialPropertyBlock::New_ctor(); + if (!l_CurrentBlock->____materialPropertyBlock) + l_CurrentBlock->____materialPropertyBlock = MaterialPropertyBlock::New_ctor(); l_Cache->noteArrowGlowsMaterialPropertyBlockControllers[l_NoteArrowGlowsMaterialPropertyBlockControllersIt++] = l_CurrentBlock; @@ -259,9 +260,9 @@ namespace QBeatSaberPlus_NoteTweaker::Patches { //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// - auto l_NoteData = __Instance->noteController->get_noteData(); - auto l_ColorType = l_NoteData->colorType; - auto l_CutDirection = l_NoteData->cutDirection; + auto l_NoteData = __Instance->____noteController->get_noteData(); + auto l_ColorType = l_NoteData->get_colorType(); + auto l_CutDirection = l_NoteData->get_cutDirection(); auto l_OverrideColor = l_ColorType == ColorType::ColorA ? PColorNoteVisuals_LeftBlockColor : PColorNoteVisuals_RightBlockColor; if (PColorNoteVisuals_BlockColorsEnabled) @@ -269,7 +270,7 @@ namespace QBeatSaberPlus_NoteTweaker::Patches { for (auto l_Current : l_Cache->materialPropertyBlockControllers) { if (!l_Current) break; - l_Current->materialPropertyBlock->SetColor(PColorNoteVisuals_ColorID, l_OverrideColor); + l_Current->____materialPropertyBlock->SetColor(PColorNoteVisuals_ColorID, l_OverrideColor); l_Current->ApplyChanges(); } @@ -279,7 +280,7 @@ namespace QBeatSaberPlus_NoteTweaker::Patches { for (auto l_Current : l_Cache->noteArrowGlowsMaterialPropertyBlockControllers) { if (!l_Current) break; - l_Current->materialPropertyBlock->SetColor(PColorNoteVisuals_ColorID, l_NoteArrowGlowColor); + l_Current->____materialPropertyBlock->SetColor(PColorNoteVisuals_ColorID, l_NoteArrowGlowColor); l_Current->ApplyChanges(); } } @@ -291,7 +292,7 @@ namespace QBeatSaberPlus_NoteTweaker::Patches { if (!PColorNoteVisuals_Enabled) return; - auto l_BaseColor = __Instance->colorManager->ColorForType(l_ColorType); + auto l_BaseColor = __Instance->____colorManager->ColorForType(l_ColorType); auto l_ArrowColor = ColorU::WithAlpha(PColorNoteVisuals_OverrideArrowColors ? (l_ColorType == ColorType::ColorB ? PColorNoteVisuals_RightArrowColor : PColorNoteVisuals_LeftArrowColor) : l_BaseColor, PColorNoteVisuals_ArrowAlpha); if (PColorNoteVisuals_BlockColorsEnabled) @@ -310,7 +311,7 @@ namespace QBeatSaberPlus_NoteTweaker::Patches { for (auto l_Current : l_Cache->noteArrowGlowsMaterialPropertyBlockControllers) { if (!l_Current) break; - l_Current->materialPropertyBlock->SetColor(PColorNoteVisuals_ColorID, l_ArrowColor); + l_Current->____materialPropertyBlock->SetColor(PColorNoteVisuals_ColorID, l_ArrowColor); l_Current->ApplyChanges(); } @@ -319,7 +320,7 @@ namespace QBeatSaberPlus_NoteTweaker::Patches { auto l_DotEnabled = l_CutDirection == NoteCutDirection::Any ? PColorNoteVisuals_CircleEnabled : (PColorNoteVisuals_CircleEnabled && PColorNoteVisuals_CircleForceEnabled); auto l_DotColor = ColorU::WithAlpha(PColorNoteVisuals_OverrideDotColors ? (l_ColorType == ColorType::ColorB ? PColorNoteVisuals_RightCircleColor : PColorNoteVisuals_LeftCircleColor) : l_BaseColor, PColorNoteVisuals_DotAlpha); - for (auto l_CurrentRenderer : __Instance->circleMeshRenderers) + for (auto l_CurrentRenderer : __Instance->____circleMeshRenderers) { l_CurrentRenderer->set_enabled (l_DotEnabled); l_CurrentRenderer->get_transform()->set_localScale(l_CircleScale); diff --git a/src/Patches/PGameNoteController.cpp b/src/Patches/PGameNoteController.cpp index 5aac0a5..570e4dd 100644 --- a/src/Patches/PGameNoteController.cpp +++ b/src/Patches/PGameNoteController.cpp @@ -2,6 +2,7 @@ #include "NTConfig.hpp" #include "Logger.hpp" +#include #include #include #include @@ -64,8 +65,8 @@ namespace QBeatSaberPlus_NoteTweaker::Patches { p_Scale = FilterScale(p_Scale); PGameNoteController_TempEnabled = p_Enabled; - PGameNoteController_TempNoteScale = (p_Scale) * Vector3::get_one(); - PGameNoteController_TempNoteInvScale = (1.0f / (p_Scale))* Vector3::get_one(); + PGameNoteController_TempNoteScale = ( p_Scale) * Vector3::get_one(); + PGameNoteController_TempNoteInvScale = (1.0f / p_Scale) * Vector3::get_one(); } //////////////////////////////////////////////////////////////////////////// @@ -77,10 +78,10 @@ namespace QBeatSaberPlus_NoteTweaker::Patches { auto& l_LevelData = CP_SDK_BS::Game::Logic::LevelData(); if (l_LevelData) { - auto l_GameplayModifiers = l_LevelData->Data ? l_LevelData->Data->gameplayModifiers : nullptr; + auto l_GameplayModifiers = l_LevelData->Data ? l_LevelData->Data->___gameplayModifiers : nullptr; if (l_GameplayModifiers) { - if (l_GameplayModifiers->proMode || l_GameplayModifiers->smallCubes || l_GameplayModifiers->strictAngles) + if (l_GameplayModifiers->____proMode || l_GameplayModifiers->____smallCubes || l_GameplayModifiers->____strictAngles) return false; } } @@ -114,10 +115,10 @@ namespace QBeatSaberPlus_NoteTweaker::Patches { auto l_BoxScale = PGameNoteController_TempEnabled ? PGameNoteController_TempNoteInvScale : PGameNoteController_NoteInvScale; - for (auto l_Current : __Instance->bigCuttableBySaberList) + for (auto l_Current : __Instance->____bigCuttableBySaberList) l_Current->get_transform()->set_localScale(l_BoxScale); - for (auto l_Current : __Instance->smallCuttableBySaberList) + for (auto l_Current : __Instance->____smallCuttableBySaberList) l_Current->get_transform()->set_localScale(l_BoxScale); } diff --git a/src/Patches/PSliderController.cpp b/src/Patches/PSliderController.cpp index aa19cbb..5b21319 100644 --- a/src/Patches/PSliderController.cpp +++ b/src/Patches/PSliderController.cpp @@ -43,7 +43,7 @@ namespace QBeatSaberPlus_NoteTweaker::Patches { SliderController_Init(__Instance, __a, __b, __c, __d, __e, __f, __g, __h, __i, __j, __k); if (PSliderController_Enabled) - __Instance->initColor = ColorU::WithAlpha(__Instance->initColor, PSliderController_Opacity); + __Instance->____initColor = ColorU::WithAlpha(__Instance->____initColor, PSliderController_Opacity); } } ///< namespace QBeatSaberPlus_NoteTweaker::Patches \ No newline at end of file diff --git a/src/UI/SettingsMainView.cpp b/src/UI/SettingsMainView.cpp index 3f90034..1c0a464 100644 --- a/src/UI/SettingsMainView.cpp +++ b/src/UI/SettingsMainView.cpp @@ -529,7 +529,7 @@ namespace QBeatSaberPlus_NoteTweaker::UI { try { StringW l_FileName = std::to_string(CP_SDK::Misc::Time::UnixTimeNow()) + "_" + CP_SDK::Utils::U16StrToStr(l_Profile->Name) + ".bspnt"; - l_FileName = NoteTweaker::Instance()->ExportFolder() + u"/" + Il2CppString::Join(u"", l_FileName->Split(System::IO::Path::GetInvalidFileNameChars())); + l_FileName = NoteTweaker::Instance()->ExportFolder() + u"/" + System::String::Join(u"", l_FileName->Split(System::IO::Path::GetInvalidPathChars())); l_Stream.open(l_FileName.operator std::__ndk1::string(), std::ios::trunc); @@ -546,7 +546,7 @@ namespace QBeatSaberPlus_NoteTweaker::UI { l_Stream.close(); - ShowMessageModal("Profile exported in\n" + NoteTweaker::Instance()->ExportFolder()); + ShowMessageModal(u"Profile exported in\n" + NoteTweaker::Instance()->ExportFolder()); } catch (const std::exception& l_Exception) { diff --git a/src/UI/SettingsRightView.cpp b/src/UI/SettingsRightView.cpp index a219d6f..9dde1ca 100644 --- a/src/UI/SettingsRightView.cpp +++ b/src/UI/SettingsRightView.cpp @@ -3,6 +3,7 @@ #include "Logger.hpp" #include +#include #include #include @@ -87,31 +88,31 @@ namespace QBeatSaberPlus_NoteTweaker::UI { GameObject::DontDestroyOnLoad(m_Parent.Ptr()); - auto l_MenuTransitionsHelper = Resources::FindObjectsOfTypeAll().FirstOrDefault(); - auto l_StandardLevelScenesTransitionSetupData = l_MenuTransitionsHelper->standardLevelScenesTransitionSetupData; - auto l_StandardGameplaySceneInfo = l_StandardLevelScenesTransitionSetupData->standardGameplaySceneInfo; - auto l_GameCoreSceneInfo = l_StandardLevelScenesTransitionSetupData->gameCoreSceneInfo; + auto l_MenuTransitionsHelper = Resources::FindObjectsOfTypeAll()->FirstOrDefault(); + auto l_StandardLevelScenesTransitionSetupData = l_MenuTransitionsHelper->____standardLevelScenesTransitionSetupData; + auto l_StandardGameplaySceneInfo = l_StandardLevelScenesTransitionSetupData->____standardGameplaySceneInfo; + auto l_GameCoreSceneInfo = l_StandardLevelScenesTransitionSetupData->____gameCoreSceneInfo; using t_Delegate1 = System::Action_1*; - SceneManagement::SceneManager::LoadSceneAsync(l_GameCoreSceneInfo->sceneName, SceneManagement::LoadSceneMode::Additive)->add_completed(custom_types::MakeDelegate(std::function([=, this](AsyncOperation*) + SceneManagement::SceneManager::LoadSceneAsync(l_GameCoreSceneInfo->____sceneName, SceneManagement::LoadSceneMode::Additive)->add_completed(custom_types::MakeDelegate(std::function([=, this](AsyncOperation*) { - SceneManagement::SceneManager::LoadSceneAsync(l_StandardGameplaySceneInfo->sceneName, SceneManagement::LoadSceneMode::Additive)->add_completed(custom_types::MakeDelegate(std::function([=, this](AsyncOperation*) + SceneManagement::SceneManager::LoadSceneAsync(l_StandardGameplaySceneInfo->____sceneName, SceneManagement::LoadSceneMode::Additive)->add_completed(custom_types::MakeDelegate(std::function([=, this](AsyncOperation*) { - auto l_BeatmapObjectsInstaller = Resources::FindObjectsOfTypeAll().FirstOrDefault(); - auto l_OriginalNotePrefab = l_BeatmapObjectsInstaller->normalBasicNotePrefab; + auto l_BeatmapObjectsInstaller = Resources::FindObjectsOfTypeAll()->FirstOrDefault(); + auto l_OriginalNotePrefab = l_BeatmapObjectsInstaller->____normalBasicNotePrefab; m_NoteTemplate = GameObject::Instantiate(l_OriginalNotePrefab->get_transform()->GetChild(0)->get_gameObject()); m_NoteTemplate->get_gameObject()->SetActive(false); GameObject::DontDestroyOnLoad(m_NoteTemplate.Ptr()); - auto l_OriginalBombPrefab = l_BeatmapObjectsInstaller->bombNotePrefab; + auto l_OriginalBombPrefab = l_BeatmapObjectsInstaller->____bombNotePrefab; m_BombTemplate = GameObject::Instantiate(l_OriginalBombPrefab->get_transform()->GetChild(0)->get_gameObject()); m_BombTemplate->get_gameObject()->SetActive(false); GameObject::DontDestroyOnLoad(m_BombTemplate.Ptr()); - auto l_OriginalBurstSliderPrefab = l_BeatmapObjectsInstaller->burstSliderNotePrefab; + auto l_OriginalBurstSliderPrefab = l_BeatmapObjectsInstaller->____burstSliderNotePrefab; m_BurstSliderTemplate = GameObject::Instantiate(l_OriginalBurstSliderPrefab->get_transform()->GetChild(0)->get_gameObject()); m_BurstSliderTemplate->get_gameObject()->SetActive(false); @@ -127,8 +128,8 @@ namespace QBeatSaberPlus_NoteTweaker::UI { Logger::Instance->Error(ex); } - SceneManagement::SceneManager::UnloadSceneAsync(l_StandardGameplaySceneInfo->sceneName); - SceneManagement::SceneManager::UnloadSceneAsync(l_GameCoreSceneInfo->sceneName); + SceneManagement::SceneManager::UnloadSceneAsync(SceneManagement::SceneManager::GetSceneByName(l_StandardGameplaySceneInfo->____sceneName)); + SceneManagement::SceneManager::UnloadSceneAsync(SceneManagement::SceneManager::GetSceneByName(l_GameCoreSceneInfo->____sceneName)); }))); }))); } @@ -206,8 +207,8 @@ namespace QBeatSaberPlus_NoteTweaker::UI { m_CustomPreviewDL->get_transform()->set_localScale(Vector3::get_one() * l_Profile->NotesScale); m_CustomPreviewDR->get_transform()->set_localScale(Vector3::get_one() * l_Profile->NotesScale); - auto l_PlayerData = Resources::FindObjectsOfTypeAll().First()->playerData; - auto l_ColorScheme = l_PlayerData->colorSchemesSettings->overrideDefaultColors ? l_PlayerData->colorSchemesSettings->GetSelectedColorScheme() : nullptr; + auto l_PlayerData = Resources::FindObjectsOfTypeAll()->First()->____playerData; + auto l_ColorScheme = l_PlayerData->get_colorSchemesSettings()->overrideDefaultColors ? l_PlayerData->get_colorSchemesSettings()->GetSelectedColorScheme() : nullptr; auto l_LeftColor = l_ColorScheme != nullptr ? l_ColorScheme->saberAColor : Color(0.658823549747467f, 0.125490203499794f, 0.125490203499794f, 1.0f); auto l_RightColor = l_ColorScheme != nullptr ? l_ColorScheme->saberBColor : Color(0.125490203499794f, 0.3921568691730499f, 0.658823549747467f, 1.0f); @@ -244,10 +245,10 @@ namespace QBeatSaberPlus_NoteTweaker::UI { void SettingsRightView::CreatePreview(GameObject* p_NoteTemplate, GameObject* p_BombTemplate, GameObject* m_BurstFillTemplate) { auto& l_Profile = NTConfig::Instance()->GetActiveProfile(); - auto l_PlayerData = Resources::FindObjectsOfTypeAll().First()->playerData; - auto l_ColorScheme = l_PlayerData->colorSchemesSettings->overrideDefaultColors ? l_PlayerData->colorSchemesSettings->GetSelectedColorScheme() : nullptr; - auto l_LeftColor = l_ColorScheme != nullptr ? l_ColorScheme->saberAColor : Color(0.658823549747467f, 0.125490203499794f, 0.125490203499794f, 1.0f); - auto l_RightColor = l_ColorScheme != nullptr ? l_ColorScheme->saberBColor : Color(0.125490203499794f, 0.3921568691730499f, 0.658823549747467f, 1.0f); + auto l_PlayerData = Resources::FindObjectsOfTypeAll()->First()->get_playerData(); + auto l_ColorScheme = l_PlayerData->get_colorSchemesSettings()->___overrideDefaultColors ? l_PlayerData->get_colorSchemesSettings()->GetSelectedColorScheme() : nullptr; + auto l_LeftColor = l_ColorScheme != nullptr ? l_ColorScheme->get_saberAColor() : Color(0.658823549747467f, 0.125490203499794f, 0.125490203499794f, 1.0f); + auto l_RightColor = l_ColorScheme != nullptr ? l_ColorScheme->get_saberBColor() : Color(0.125490203499794f, 0.3921568691730499f, 0.658823549747467f, 1.0f); /// ============== @@ -432,13 +433,13 @@ namespace QBeatSaberPlus_NoteTweaker::UI { for (auto l_PropertyBlockController : p_Object->GetComponents()) { - if (!l_PropertyBlockController->materialPropertyBlock) - l_PropertyBlockController->materialPropertyBlock = MaterialPropertyBlock::New_ctor(); + if (!l_PropertyBlockController->____materialPropertyBlock) + l_PropertyBlockController->____materialPropertyBlock = MaterialPropertyBlock::New_ctor(); - l_PropertyBlockController->materialPropertyBlock->SetColor(Shader::PropertyToID("_Color"), ColorU::WithAlpha(p_Color, 1.0f)); - l_PropertyBlockController->materialPropertyBlock->SetFloat(Shader::PropertyToID("_EnableRimDim"), 0.0f); - l_PropertyBlockController->materialPropertyBlock->SetFloat(Shader::PropertyToID("_EnableFog"), 0.0f); - l_PropertyBlockController->materialPropertyBlock->SetFloat(Shader::PropertyToID("_RimDarkenning"), 0.0f); + l_PropertyBlockController->____materialPropertyBlock->SetColor(Shader::PropertyToID("_Color"), ColorU::WithAlpha(p_Color, 1.0f)); + l_PropertyBlockController->____materialPropertyBlock->SetFloat(Shader::PropertyToID("_EnableRimDim"), 0.0f); + l_PropertyBlockController->____materialPropertyBlock->SetFloat(Shader::PropertyToID("_EnableFog"), 0.0f); + l_PropertyBlockController->____materialPropertyBlock->SetFloat(Shader::PropertyToID("_RimDarkenning"), 0.0f); l_PropertyBlockController->ApplyChanges(); } @@ -460,14 +461,14 @@ namespace QBeatSaberPlus_NoteTweaker::UI { auto l_Glow = p_Note->get_transform()->Find("NoteArrowGlow"); if (l_Glow) { - l_Glow->get_transform()->set_localScale(Vector3(0.6f, 0.3f, 0.6f) * p_Scale); + l_Glow->get_transform()->set_localScale(Vector3(0.6f * p_Scale, 0.3f * p_Scale, 0.6f * p_Scale)); for (auto l_PropertyBlockController : l_Glow->GetComponents()) { - if (!l_PropertyBlockController->materialPropertyBlock) - l_PropertyBlockController->materialPropertyBlock = MaterialPropertyBlock::New_ctor(); + if (!l_PropertyBlockController->____materialPropertyBlock) + l_PropertyBlockController->____materialPropertyBlock = MaterialPropertyBlock::New_ctor(); - l_PropertyBlockController->materialPropertyBlock->SetColor(Shader::PropertyToID("_Color"), p_Color); + l_PropertyBlockController->____materialPropertyBlock->SetColor(Shader::PropertyToID("_Color"), p_Color); l_PropertyBlockController->ApplyChanges(); } @@ -485,14 +486,14 @@ namespace QBeatSaberPlus_NoteTweaker::UI { auto l_Circle = p_Note->get_transform()->Find("Circle"); if (l_CircleGlow) { - l_CircleGlow->get_transform()->set_localScale(Vector3(0.5f, 0.5f, 0.5f) * p_Scale); + l_CircleGlow->get_transform()->set_localScale(Vector3(0.5f * p_Scale, 0.5f * p_Scale, 0.5f * p_Scale)); for (auto l_PropertyBlockController : l_CircleGlow->GetComponents()) { - if (!l_PropertyBlockController->materialPropertyBlock) - l_PropertyBlockController->materialPropertyBlock = MaterialPropertyBlock::New_ctor(); + if (!l_PropertyBlockController->____materialPropertyBlock) + l_PropertyBlockController->____materialPropertyBlock = MaterialPropertyBlock::New_ctor(); - l_PropertyBlockController->materialPropertyBlock->SetColor(Shader::PropertyToID("_Color"), p_Color); + l_PropertyBlockController->____materialPropertyBlock->SetColor(Shader::PropertyToID("_Color"), p_Color); l_PropertyBlockController->ApplyChanges(); } @@ -500,14 +501,14 @@ namespace QBeatSaberPlus_NoteTweaker::UI { } else if (l_Circle) { - l_Circle->get_transform()->set_localScale(Vector3(0.1f, 0.1f, 0.1f) * p_Scale); + l_Circle->get_transform()->set_localScale(Vector3(0.1f * p_Scale, 0.1f * p_Scale, 0.1f * p_Scale)); for (auto l_PropertyBlockController : l_Circle->GetComponents()) { - if (!l_PropertyBlockController->materialPropertyBlock) - l_PropertyBlockController->materialPropertyBlock = MaterialPropertyBlock::New_ctor(); + if (!l_PropertyBlockController->____materialPropertyBlock) + l_PropertyBlockController->____materialPropertyBlock = MaterialPropertyBlock::New_ctor(); - l_PropertyBlockController->materialPropertyBlock->SetColor(Shader::PropertyToID("_Color"), p_Color); + l_PropertyBlockController->____materialPropertyBlock->SetColor(Shader::PropertyToID("_Color"), p_Color); l_PropertyBlockController->ApplyChanges(); } diff --git a/src/main.cpp b/src/main.cpp index c832411..8390815 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2,22 +2,21 @@ #include "NoteTweaker.hpp" #include -#include +#include #include #include -static ModInfo s_ModInfo; +static modloader::ModInfo s_ModInfo{"QBeatSaberPlus-NoteTweaker", VERSION, GIT_COMMIT}; // Called at the early stages of game loading -extern "C" void setup(ModInfo & p_ModInfo) +extern "C" void setup(CModInfo* p_ModInfo) { - p_ModInfo.id = "QBeatSaberPlus-NoteTweaker"; - p_ModInfo.version = VERSION; + p_ModInfo->id = s_ModInfo.id.c_str(); + p_ModInfo->version = s_ModInfo.version.c_str(); + p_ModInfo->version_long = s_ModInfo.versionLong; - s_ModInfo = p_ModInfo; - - auto l_Logger = new CP_SDK::Logging::BMBFLogger(new Logger(p_ModInfo, LoggerOptions(false, true))); + auto l_Logger = new CP_SDK::Logging::PaperLogger(p_ModInfo->id); l_Logger->Error(u"QBeatSaberPlus-NoteTweaker Setuping!"); @@ -31,7 +30,7 @@ extern "C" void setup(ModInfo & p_ModInfo) //////////////////////////////////////////////////////////////////////////// // Called later on in the game loading - a good time to install function hooks -extern "C" void load() +extern "C" void late_load() { il2cpp_functions::Init(); diff --git a/start-logging.ps1 b/start-logging.ps1 index a04bbd1..91fdbab 100644 --- a/start-logging.ps1 +++ b/start-logging.ps1 @@ -62,7 +62,7 @@ if ($all -eq $false) { $pattern += "$custom|" } if ($pattern -eq "(") { - $pattern = "(QuestHook|modloader|ChatPlexSDK-BS|" + $pattern = "(QuestHook|modloader|scotland2|ChatPlexSDK-BS|" } $pattern += "AndroidRuntime|CRASH)" $command += " | Select-String -pattern `"$pattern`""