diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..b84d220 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,76 @@ +name: NDK build + +env: + module_id: fingersaber + qmodName: FingerSaber + cache-name: FS_cache + +on: + workflow_dispatch: + push: + branches: [ main, dev ] + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + name: Checkout + with: + submodules: true + lfs: true + + - uses: seanmiddleditch/gha-setup-ninja@v5 + + + + - name: Get QPM + uses: Fernthedev/qpm-action@v1 + with: + resolve_ndk: true + #required + workflow_token: ${{secrets.GITHUB_TOKEN}} + restore: true # will run restore on download + cache: true #will cache dependencies + + - name: Build + run: | + cd ${GITHUB_WORKSPACE} + pwsh -Command ./scripts/build.ps1 + qpm qmod build + + - name: Create Qmod + run: | + pwsh -Command ./scripts/createqmod.ps1 ${{env.qmodName}} + + - name: Get Library Name + id: libname + run: | + cd ./build/ + pattern="lib${module_id}*.so" + files=( $pattern ) + echo ::set-output name=NAME::"${files[0]}" + + - name: Upload non-debug artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ steps.libname.outputs.NAME }} + path: ./build/${{ steps.libname.outputs.NAME }} + if-no-files-found: error + + - name: Upload qmod artifact + uses: actions/upload-artifact@v4 + with: + name: ${{env.qmodName}}.qmod + path: ./${{ env.qmodName }}.qmod + if-no-files-found: error + + - name: Upload debug artifact + uses: actions/upload-artifact@v4 + with: + name: debug_${{ steps.libname.outputs.NAME }} + path: ./build/debug/${{ steps.libname.outputs.NAME }} + if-no-files-found: error diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e85e459 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,95 @@ +name: Publish release artifacts + +env: + module_id: fingersaber + qmodName: FingerSaber + cache-name: FS_release_cache + +on: + push: + tags: + - "v*.*.*" + +permissions: + contents: write + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - name: Get Mod version from tag name + id: modversion + run: | + echo "VERSION_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV + TEMP=$(echo "$GITHUB_REF_NAME" | grep -Po "(?<=v)\d+.\d+.\d+") + echo "VERSION=$TEMP" >> $GITHUB_ENV + + - uses: actions/checkout@v4 + name: Checkout + with: + submodules: true + lfs: true + + - uses: seanmiddleditch/gha-setup-ninja@v5 + + - name: Get QPM + uses: Fernthedev/qpm-action@v1 + with: + resolve_ndk: true + #required + workflow_token: ${{secrets.GITHUB_TOKEN}} + restore: true # will run restore on download + cache: true #will cache dependencies + + - name: QPM Edit Version + run: | + qpm package edit --version "${{ env.VERSION }}" + + - name: Build + run: | + cd ${GITHUB_WORKSPACE} + pwsh -Command ./scripts/build.ps1 + qpm qmod build + + - name: Create Qmod + run: | + pwsh -Command ./scripts/createqmod.ps1 ${{env.qmodName}} + + - name: Get Library Name and Build ID + id: libname + run: | + cd ./build/ + pattern="lib${module_id}*.so" + files=( $pattern ) + echo "LIBNAME=${files[0]}" >> $GITHUB_ENV + echo "BUILD_ID=$(readelf -n ${files[0]} | grep -Po "(?<=Build ID: )[0-9a-f]+")" >> $GITHUB_ENV + + - name: Rename debug file + run: mv "./build/debug/${{ env.LIBNAME }}" "./build/debug/debug_${{ env.LIBNAME }}" + + - name: Calculate SHA-256 of the qmod file + id: qmodsha + run: | + echo "QMOD_SHA=$(sha256sum ./${{ env.qmodName }}.qmod | grep -Po "^[0-9a-f]+")" >> $GITHUB_ENV + + - name: Release + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + tag_name: ${{ env.VERSION_TAG }} + name: FingerSaber ${{ env.VERSION }} + generate_release_notes: true + body: | + --- + + ### Build info + + SHA-256: ${{ env.QMOD_SHA }} + Build ID: ${{ env.BUILD_ID }} + files: | + ./${{ env.qmodName }}.qmod + ./build/${{ env.LIBNAME }} + ./build/debug/debug_${{ env.LIBNAME }} + draft: true + prerelease: false \ No newline at end of file diff --git a/.gitignore b/.gitignore index 43e9cba..bafdb3a 100644 --- a/.gitignore +++ b/.gitignore @@ -67,4 +67,5 @@ extern.cmake mod.json.schema # Ndk path -ndkpath.txt \ No newline at end of file +ndkpath.txt +.cache \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 87946f0..f312310 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,12 +37,17 @@ add_compile_definitions(VERSION_LONG=0) RECURSE_FILES(cpp_file_list ${SOURCE_DIR}/*.cpp) RECURSE_FILES(c_file_list ${SOURCE_DIR}/*.c) +RECURSE_FILES(inline_hook_c ${EXTERN_DIR}/includes/beatsaber-hook/shared/inline-hook/*.c) +RECURSE_FILES(inline_hook_cpp ${EXTERN_DIR}/includes/beatsaber-hook/shared/inline-hook/*.cpp) + # add all src files to compile add_library( ${COMPILE_ID} SHARED ${cpp_file_list} ${c_file_list} + ${inline_hook_c} + ${inline_hook_cpp} ) target_include_directories(${COMPILE_ID} PRIVATE .) diff --git a/include/ModConfig.hpp b/include/ModConfig.hpp index 7c644fd..9a3cb5c 100644 --- a/include/ModConfig.hpp +++ b/include/ModConfig.hpp @@ -2,8 +2,7 @@ #include "config-utils/shared/config-utils.hpp" -DECLARE_CONFIG(ModConfig, - +DECLARE_CONFIG(ModConfig) { CONFIG_VALUE(PlatformHeightOffsetMeters, float, "platformHeightOffsetMeters", -0.34); CONFIG_VALUE(PlatformDistanceOffsetMeters, float, "platformDistanceOffsetMeters", -0.25); @@ -16,4 +15,4 @@ DECLARE_CONFIG(ModConfig, CONFIG_VALUE(SmoothedMenuHands, bool, "SmoothedMenuHands", true); CONFIG_VALUE(LeftHandTargetIdx, int, "LeftHandTargetIdx", 1); CONFIG_VALUE(RightHandTargetIdx, int, "RightHandTargetIdx", 1); -) \ No newline at end of file +}; \ No newline at end of file diff --git a/include/ModGameplaySetupMenu.hpp b/include/ModGameplaySetupMenu.hpp index 10de840..74e05e1 100644 --- a/include/ModGameplaySetupMenu.hpp +++ b/include/ModGameplaySetupMenu.hpp @@ -6,10 +6,10 @@ #include "custom-types/shared/macros.hpp" #include "bsml/shared/BSML/Components/Settings/ToggleSetting.hpp" -DECLARE_CLASS_CODEGEN(FingerSaberSettings, ModGameplaySetupMenu, UnityEngine::MonoBehaviour, +DECLARE_CLASS_CODEGEN(FingerSaberSettings, ModGameplaySetupMenu, UnityEngine::MonoBehaviour) { DECLARE_INSTANCE_FIELD(UnityW, modEnabledToggle); DECLARE_INSTANCE_FIELD(UnityW, handsOnlyToggle); DECLARE_INSTANCE_FIELD(UnityW, handRenderingToggle); DECLARE_INSTANCE_METHOD(void, DidActivate, bool firstActivation); -) \ No newline at end of file +}; \ No newline at end of file diff --git a/include/ModSettingsViewController.hpp b/include/ModSettingsViewController.hpp index c4fef2a..267220b 100644 --- a/include/ModSettingsViewController.hpp +++ b/include/ModSettingsViewController.hpp @@ -5,11 +5,11 @@ #include "custom-types/shared/macros.hpp" -DECLARE_CLASS_CODEGEN(FingerSaberSettings, ModSettingsViewController, HMUI::ViewController, +DECLARE_CLASS_CODEGEN(FingerSaberSettings, ModSettingsViewController, HMUI::ViewController) { DECLARE_INSTANCE_FIELD(UnityW, modEnabledToggle); DECLARE_INSTANCE_FIELD(UnityW, handsOnlyToggle); DECLARE_INSTANCE_FIELD(UnityW, handRenderingToggle); DECLARE_OVERRIDE_METHOD(void, DidActivate, il2cpp_utils::FindMethodUnsafe("HMUI", "ViewController", "DidActivate", 3), bool firstActivation, bool addedToHierarchy, bool screenSystemEnabling); DECLARE_OVERRIDE_METHOD(void, DidDeactivate, il2cpp_utils::FindMethodUnsafe("HMUI", "ViewController", "DidDeactivate", 2), bool removedFromHierarchy, bool screenSystemDisabling); -) \ No newline at end of file +}; \ No newline at end of file diff --git a/include/logging.hpp b/include/logging.hpp index 6e8a882..e08a517 100644 --- a/include/logging.hpp +++ b/include/logging.hpp @@ -1,7 +1,7 @@ #pragma once #include "beatsaber-hook/shared/utils/utils.h" -#include "paper/shared/logger.hpp" +#include "paper2_scotland2/shared/logger.hpp" static constexpr auto Logger = Paper::ConstLoggerContext(MOD_ID); diff --git a/mod.template.json b/mod.template.json index ee0f6ec..9edcf5d 100644 --- a/mod.template.json +++ b/mod.template.json @@ -6,7 +6,7 @@ "author": "Henri", "version": "0.2.1", "packageId": "com.beatgames.beatsaber", - "packageVersion": "1.37.0_9064817954", + "packageVersion": "1.40.6_6407", "description": "Beat Saber At Your Finger Tips. Discord @drumtool", "coverImage": "cover.jpg", "dependencies": [], diff --git a/qpm.json b/qpm.json index e59d017..a6dc790 100644 --- a/qpm.json +++ b/qpm.json @@ -1,4 +1,5 @@ { + "$schema": "https://raw.githubusercontent.com/QuestPackageManager/QPM.Package/refs/heads/main/qpm.schema.json", "version": "0.1.0", "sharedDir": "shared", "dependenciesDir": "extern", @@ -37,6 +38,7 @@ "pwsh ./scripts/pull-tombstone.ps1" ] }, + "ndk": "^27.2.12479018", "qmodIncludeDirs": [], "qmodIncludeFiles": [], "qmodOutput": null @@ -44,12 +46,12 @@ "dependencies": [ { "id": "beatsaber-hook", - "versionRange": "^5.1.9", + "versionRange": "^6.4.2", "additionalData": {} }, { "id": "scotland2", - "versionRange": "^0.1.3", + "versionRange": "^0.1.6", "additionalData": { "includeQmod": false, "private": true @@ -57,34 +59,32 @@ }, { "id": "bsml", - "versionRange": "^0.4.43", + "versionRange": "^0.4.53", "additionalData": {} }, { "id": "bs-cordl", - "versionRange": "^3700.0.0", + "versionRange": "4006.*", "additionalData": {} }, { "id": "config-utils", - "versionRange": "^1.4.0", + "versionRange": "^2.0.3", "additionalData": {} }, { "id": "custom-types", - "versionRange": "^0.17.6", + "versionRange": "^0.18.3", "additionalData": {} }, { - "id": "paper", - "versionRange": "^3.6.3", - "additionalData": { - "private": true - } + "id": "paper2_scotland2", + "versionRange": "^4.6.4", + "additionalData": {} }, { - "id": "bs-utils", - "versionRange": "^0.8.4", + "id": "metacore", + "versionRange": "^1.0.0", "additionalData": {} } ] diff --git a/qpm.shared.json b/qpm.shared.json index 3467255..11e38ea 100644 --- a/qpm.shared.json +++ b/qpm.shared.json @@ -1,4 +1,5 @@ { + "$schema": "https://raw.githubusercontent.com/QuestPackageManager/QPM.Package/refs/heads/main/qpm.shared.schema.json", "config": { "version": "0.1.0", "sharedDir": "shared", @@ -45,12 +46,12 @@ "dependencies": [ { "id": "beatsaber-hook", - "versionRange": "^5.1.9", + "versionRange": "^6.4.2", "additionalData": {} }, { "id": "scotland2", - "versionRange": "^0.1.3", + "versionRange": "^0.1.6", "additionalData": { "includeQmod": false, "private": true @@ -58,34 +59,32 @@ }, { "id": "bsml", - "versionRange": "^0.4.43", + "versionRange": "^0.4.53", "additionalData": {} }, { "id": "bs-cordl", - "versionRange": "^3700.0.0", + "versionRange": "4006.*", "additionalData": {} }, { "id": "config-utils", - "versionRange": "^1.4.0", + "versionRange": "^2.0.3", "additionalData": {} }, { "id": "custom-types", - "versionRange": "^0.17.6", + "versionRange": "^0.18.3", "additionalData": {} }, { - "id": "paper", - "versionRange": "^3.6.3", - "additionalData": { - "private": true - } + "id": "paper2_scotland2", + "versionRange": "^4.6.4", + "additionalData": {} }, { - "id": "bs-utils", - "versionRange": "^0.8.4", + "id": "metacore", + "versionRange": "^1.0.0", "additionalData": {} } ] @@ -93,118 +92,129 @@ "restoredDependencies": [ { "dependency": { - "id": "paper", - "versionRange": "=3.6.4", + "id": "custom-types", + "versionRange": "=0.18.3", "additionalData": { - "soLink": "https://github.com/Fernthedev/paperlog/releases/download/v3.6.4/libpaperlog.so", - "debugSoLink": "https://github.com/Fernthedev/paperlog/releases/download/v3.6.4/debug_libpaperlog.so", - "overrideSoName": "libpaperlog.so", - "modLink": "https://github.com/Fernthedev/paperlog/releases/download/v3.6.4/paperlog.qmod", - "branchName": "version/v3_6_4", + "soLink": "https://github.com/QuestPackageManager/Il2CppQuestTypePatching/releases/download/v0.18.3/libcustom-types.so", + "debugSoLink": "https://github.com/QuestPackageManager/Il2CppQuestTypePatching/releases/download/v0.18.3/debug_libcustom-types.so", + "overrideSoName": "libcustom-types.so", + "modLink": "https://github.com/QuestPackageManager/Il2CppQuestTypePatching/releases/download/v0.18.3/CustomTypes.qmod", + "branchName": "version/v0_18_3", "compileOptions": { - "systemIncludes": [ - "shared/utfcpp/source" + "cppFlags": [ + "-Wno-invalid-offsetof" ] }, - "cmake": false + "cmake": true } }, - "version": "3.6.4" + "version": "0.18.3" }, { "dependency": { - "id": "bs-utils", - "versionRange": "=0.8.4", + "id": "bs-cordl", + "versionRange": "=4006.0.0", "additionalData": { - "soLink": "https://github.com/RedBrumbler/QuestBS-Utils/releases/download/v0.8.4/libbs-utils.so", - "debugSoLink": "https://github.com/RedBrumbler/QuestBS-Utils/releases/download/v0.8.4/debug_libbs-utils.so", - "overrideSoName": "libbs-utils.so", - "modLink": "https://github.com/RedBrumbler/QuestBS-Utils/releases/download/v0.8.4/BS-Utils.qmod", - "branchName": "version/v0_8_4", - "cmake": true + "headersOnly": true, + "branchName": "version/v4006_0_0", + "compileOptions": { + "includePaths": [ + "include" + ], + "cppFeatures": [], + "cppFlags": [ + "-DNEED_UNSAFE_CSHARP", + "-fdeclspec", + "-DUNITY_2021", + "-DHAS_CODEGEN", + "-Wno-invalid-offsetof" + ] + } } }, - "version": "0.8.4" + "version": "4006.0.0" }, { "dependency": { - "id": "bsml", - "versionRange": "=0.4.43", + "id": "paper2_scotland2", + "versionRange": "=4.6.4", "additionalData": { - "soLink": "https://github.com/RedBrumbler/Quest-BSML/releases/download/v0.4.43/libbsml.so", - "debugSoLink": "https://github.com/RedBrumbler/Quest-BSML/releases/download/v0.4.43/debug_libbsml.so", - "overrideSoName": "libbsml.so", - "modLink": "https://github.com/RedBrumbler/Quest-BSML/releases/download/v0.4.43/BSML.qmod", - "branchName": "version/v0_4_43", - "cmake": true + "soLink": "https://github.com/Fernthedev/paperlog/releases/download/v4.6.4/libpaper2_scotland2.so", + "overrideSoName": "libpaper2_scotland2.so", + "modLink": "https://github.com/Fernthedev/paperlog/releases/download/v4.6.4/paper2_scotland2.qmod", + "branchName": "version/v4_6_4", + "compileOptions": { + "systemIncludes": [ + "shared/utfcpp/source" + ] + }, + "cmake": false } }, - "version": "0.4.43" + "version": "4.6.4" }, { "dependency": { - "id": "config-utils", - "versionRange": "=1.4.2", + "id": "tinyxml2", + "versionRange": "=10.0.0", "additionalData": { - "headersOnly": true, - "soLink": "https://github.com/darknight1050/config-utils/releases/download/v1.4.2/libconfig-utils_test.so", - "overrideSoName": "libconfig-utils_test.so", - "branchName": "version/v1_4_2", + "soLink": "https://github.com/MillzyDev/NDK-tinyxml2/releases/download/v10.0.0/libtinyxml2.so", + "debugSoLink": "https://github.com/MillzyDev/NDK-tinyxml2/releases/download/v10.0.0/debug_libtinyxml2.so", + "overrideSoName": "libtinyxml2.so", + "modLink": "https://github.com/MillzyDev/NDK-tinyxml2/releases/download/v10.0.0/tinyxml2.qmod", + "branchName": "version/v10_0_0", "cmake": true } }, - "version": "1.4.2" + "version": "10.0.0" }, { "dependency": { - "id": "custom-types", - "versionRange": "=0.17.10", + "id": "rapidjson-macros", + "versionRange": "=2.1.0", "additionalData": { - "soLink": "https://github.com/QuestPackageManager/Il2CppQuestTypePatching/releases/download/v0.17.10/libcustom-types.so", - "debugSoLink": "https://github.com/QuestPackageManager/Il2CppQuestTypePatching/releases/download/v0.17.10/debug_libcustom-types.so", - "overrideSoName": "libcustom-types.so", - "modLink": "https://github.com/QuestPackageManager/Il2CppQuestTypePatching/releases/download/v0.17.10/CustomTypes.qmod", - "branchName": "version/v0_17_10", - "compileOptions": { - "cppFlags": [ - "-Wno-invalid-offsetof" - ] - }, - "cmake": true + "headersOnly": true, + "branchName": "version/v2_1_0", + "cmake": false } }, - "version": "0.17.10" + "version": "2.1.0" }, { "dependency": { - "id": "libil2cpp", - "versionRange": "=0.3.2", + "id": "metacore", + "versionRange": "=1.3.1", "additionalData": { - "headersOnly": true, - "cmake": false + "soLink": "https://github.com/Metalit/MetaCore/releases/download/v1.3.1/libmetacore.so", + "overrideSoName": "libmetacore.so", + "modLink": "https://github.com/Metalit/MetaCore/releases/download/v1.3.1/MetaCore.qmod", + "branchName": "version/v1_3_1", + "cmake": true } }, - "version": "0.3.2" + "version": "1.3.1" }, { "dependency": { - "id": "rapidjson-macros", - "versionRange": "=1.2.1", + "id": "config-utils", + "versionRange": "=2.0.3", "additionalData": { "headersOnly": true, - "branchName": "version/v1_2_1", + "soLink": "https://github.com/darknight1050/config-utils/releases/download/v2.0.3/libconfig-utils_test.so", + "overrideSoName": "libconfig-utils_test.so", + "branchName": "version/v2_0_3", "cmake": true } }, - "version": "1.2.1" + "version": "2.0.3" }, { "dependency": { "id": "fmt", - "versionRange": "=10.0.0", + "versionRange": "=11.0.2", "additionalData": { "headersOnly": true, - "branchName": "version/v10_0_0", + "branchName": "version/v11_0_2", "compileOptions": { "systemIncludes": [ "fmt/include/" @@ -215,71 +225,71 @@ } } }, - "version": "10.0.0" + "version": "11.0.2" }, { "dependency": { - "id": "bs-cordl", - "versionRange": "=3700.0.0", + "id": "beatsaber-hook", + "versionRange": "=6.4.2", "additionalData": { - "headersOnly": true, - "branchName": "version/v3700_0_0", + "soLink": "https://github.com/QuestPackageManager/beatsaber-hook/releases/download/v6.4.2/libbeatsaber-hook.so", + "debugSoLink": "https://github.com/QuestPackageManager/beatsaber-hook/releases/download/v6.4.2/debug_libbeatsaber-hook.so", + "overrideSoName": "libbeatsaber-hook.so", + "modLink": "https://github.com/QuestPackageManager/beatsaber-hook/releases/download/v6.4.2/beatsaber-hook.qmod", + "branchName": "version/v6_4_2", "compileOptions": { - "includePaths": [ - "include" - ], - "cppFeatures": [], "cppFlags": [ - "-DNEED_UNSAFE_CSHARP", - "-fdeclspec", - "-DUNITY_2021", - "-DHAS_CODEGEN" + "-Wno-extra-qualification" ] - } + }, + "cmake": true } }, - "version": "3700.0.0" + "version": "6.4.2" }, { "dependency": { - "id": "beatsaber-hook", - "versionRange": "=5.1.9", + "id": "bsml", + "versionRange": "=0.4.53", "additionalData": { - "soLink": "https://github.com/QuestPackageManager/beatsaber-hook/releases/download/v5.1.9/libbeatsaber-hook_5_1_9.so", - "debugSoLink": "https://github.com/QuestPackageManager/beatsaber-hook/releases/download/v5.1.9/debug_libbeatsaber-hook_5_1_9.so", - "branchName": "version/v5_1_9", + "soLink": "https://github.com/bsq-ports/Quest-BSML/releases/download/v0.4.53/libbsml.so", + "debugSoLink": "https://github.com/bsq-ports/Quest-BSML/releases/download/v0.4.53/debug_libbsml.so", + "overrideSoName": "libbsml.so", + "modLink": "https://github.com/bsq-ports/Quest-BSML/releases/download/v0.4.53/BSML.qmod", + "branchName": "version/v0_4_53", "cmake": true } }, - "version": "5.1.9" + "version": "0.4.53" }, { "dependency": { "id": "scotland2", - "versionRange": "=0.1.4", + "versionRange": "=0.1.6", "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", + "soLink": "https://github.com/sc2ad/scotland2/releases/download/v0.1.6/libsl2.so", + "debugSoLink": "https://github.com/sc2ad/scotland2/releases/download/v0.1.6/debug_libsl2.so", "overrideSoName": "libsl2.so", - "branchName": "version/v0_1_4" + "branchName": "version/v0_1_6" } }, - "version": "0.1.4" + "version": "0.1.6" }, { "dependency": { - "id": "tinyxml2", - "versionRange": "=10.0.0", + "id": "libil2cpp", + "versionRange": "=0.4.0", "additionalData": { - "soLink": "https://github.com/MillzyDev/NDK-tinyxml2/releases/download/v10.0.0/libtinyxml2.so", - "debugSoLink": "https://github.com/MillzyDev/NDK-tinyxml2/releases/download/v10.0.0/debug_libtinyxml2.so", - "overrideSoName": "libtinyxml2.so", - "modLink": "https://github.com/MillzyDev/NDK-tinyxml2/releases/download/v10.0.0/tinyxml2.qmod", - "branchName": "version/v10_0_0", - "cmake": true + "headersOnly": true, + "compileOptions": { + "systemIncludes": [ + "il2cpp/external/baselib/Include", + "il2cpp/external/baselib/Platforms/Android/Include" + ] + } } }, - "version": "10.0.0" + "version": "0.4.0" } ] } \ No newline at end of file diff --git a/src/FingerSaber.cpp b/src/FingerSaber.cpp index cc3668b..ba2cd17 100644 --- a/src/FingerSaber.cpp +++ b/src/FingerSaber.cpp @@ -62,7 +62,7 @@ #include "logging.hpp" -#include "bs-utils/shared/utils.hpp" +#include "metacore/shared/game.hpp" FingerSaber modManager; extern modloader::ModInfo modInfo; @@ -85,10 +85,7 @@ const UnityEngine::Color defaultLeftColor{0.784314, 0.078431, 0.078431, 1.000000 void FingerSaber::update_scoreSubmission() { - if (getModConfig().ModEnabled.GetValue() == true) - bs_utils::Submission::disable(modInfo); - else - bs_utils::Submission::enable(modInfo); + MetaCore::Game::SetScoreSubmission(modInfo.id, getModConfig().ModEnabled.GetValue()); } void FingerSaber::_Destroy_OculusHands() diff --git a/src/hooks/SaberModelController_Init.cpp b/src/hooks/SaberModelController_Init.cpp index 47696f1..4116b9b 100644 --- a/src/hooks/SaberModelController_Init.cpp +++ b/src/hooks/SaberModelController_Init.cpp @@ -26,12 +26,13 @@ MAKE_HOOK_MATCH( void, GlobalNamespace::SaberModelController* self, UnityEngine::Transform* parent, - GlobalNamespace::Saber* saber + GlobalNamespace::Saber* saber, + ::UnityEngine::Color trailTintColor ) { INFO("SaberModelController::Init()"); - SaberModelController_Init(self, parent, saber); + SaberModelController_Init(self, parent, saber, trailTintColor); // Exiting early if sabers are not players. Needed for multiplayer. if (parent->get_parent()->get_parent()->get_name() != "VRGameCore")