diff --git a/.github/workflows/BuildQSounds.yml b/.github/workflows/BuildQSounds.yml index 350860c..50fd5cd 100644 --- a/.github/workflows/BuildQSounds.yml +++ b/.github/workflows/BuildQSounds.yml @@ -21,48 +21,31 @@ on: env: module_id: QuestSounds - version: 1.4.1-Dev.${{ github.run_number }} - BSVersion: 1.28.0_4124311467 -# ndkname: android-ndk-r24 + #version: 1.4.1-Dev.${{ github.run_number }} jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 name: Checkout with: submodules: true lfs: true - - uses: seanmiddleditch/gha-setup-ninja@v3 - -# - name: Install Powershell -# run: sudo apt-get install -y powershell - -# - name: Cache Android NDK -# id: cache-ndk -# uses: actions/cache@v2 -# env: -# cache-name: cache-ndk -# with: -# path: ndk -# key: ${{ runner.os }}-${{ env.cache-name }}-${{ env.ndkname }} -# restore-keys: | -# ${{ runner.os }}-${{ env.cache-name }}-${{ env.ndkname }} - -# - name: Install Android NDK -# if: steps.cache-ndk.outputs.cache-hit != 'true' -# run: | -# wget -q -O ndk.zip https://dl.google.com/android/repository/${ndkname}-linux-x86_64.zip -# unzip -q ndk.zip -# mv ${ndkname} ndk - -# - name: Create ndkpath.txt -# run: | -# cd ndk -# pwd > ${GITHUB_WORKSPACE}/ndkpath.txt + - name: Get Version + shell: pwsh + run: | + $branchParts = '${{ github.ref_name }}'.Split('/'); $branchMain = $branchParts[0]; if ($branchParts[0] -match "^\d+$") { $branchMain = 'pr'; $branchSub = "$($branchParts[0])." } elseif ($branchParts.Length -eq 2) { $branchSub = "$($branchParts[1].Replace('.', '-'))." }; echo "version=$((Get-Content ./qpm.shared.json -Raw | ConvertFrom-Json).config.info.version.Split('-')[0])-$($branchMain).${{ github.run_number }}+$($branchSub)ra${{ github.run_attempt }}.$($env:GITHUB_SHA.Substring(0, 7))" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + + # Not sure this is used in this workflow + - name: Get BSVersion + shell: pwsh + run: | + echo "BSVersion=$((Get-Content ./mod.template.json -Raw | ConvertFrom-Json).packageVersion)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + + - uses: seanmiddleditch/gha-setup-ninja@v5 - name: Create ndkpath.txt run: | @@ -74,14 +57,14 @@ jobs: with: github_token: ${{secrets.GITHUB_TOKEN}} workflow: cargo-build.yml - name: linux-qpm-rust + name: linux-qpm path: QPM - repo: RedBrumbler/QuestPackageManager-Rust + repo: QuestPackageManager/QPM.CLI - name: QPM Collapse run: | - chmod +x ./QPM/qpm-rust - ./QPM/qpm-rust collapse + chmod +x ./QPM/qpm + ./QPM/qpm collapse - name: QPM Dependencies Cache id: cache-qpm-deps @@ -89,15 +72,16 @@ jobs: env: cache-name: cache-qpm-deps with: - path: /home/runner/.local/share/QPM-Rust/cache - key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('qpm.json', '.github/BuildQSounds.yml') }} + path: /home/runner/.local/share/QPM-RS/cache + key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('qpm.shared.json') }} restore-keys: | ${{ runner.os }}-${{ env.cache-name }}- ${{ runner.os }}-${{ env.cache-name }} - - name: QPM Restore + - name: QPM Set Version & Restore run: | - ./QPM/qpm-rust restore + ./QPM/qpm package edit --version ${{ env.version }} + ./QPM/qpm restore - name: Check dependency Folders run: | @@ -107,15 +91,13 @@ jobs: echo "Checking libs" ls -lh ${GITHUB_WORKSPACE}/extern/libs echo "" - echo "Checking QPM-Rust/cache Folder" - ls -lh $HOME/.local/share/QPM-Rust/cache + echo "Checking QPM/cache Folder" + ls -lh $HOME/.local/share/QPM-RS/cache echo "" - name: Build run: | cd ${GITHUB_WORKSPACE} - ./QPM/qpm-rust package edit --version ${{ env.version }} - ./QPM/qpm-rust qmod build pwsh -Command ./build.ps1 -actions - name: Get Library Name @@ -124,16 +106,16 @@ jobs: cd ./build/ pattern="lib${module_id}*.so" files=( $pattern ) - echo ::set-output name=NAME::"${files[0]}" + echo "NAME=${files[0]}" >> $GITHUB_OUTPUT - name: Package QMOD run: | cd ${GITHUB_WORKSPACE} - pwsh -Command ./buildQMOD.ps1 -package + ./QPM/qpm qmod zip -i ./build/ -i ./extern/libs/ -f ./Cover.jpg -i ./Examples/ ${module_id}_${version}.qmod - name: Upload non-debug artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: ${{ steps.libname.outputs.NAME }} path: ./build/${{ steps.libname.outputs.NAME }} @@ -141,7 +123,7 @@ jobs: - name: Upload debug artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: debug_${{ steps.libname.outputs.NAME }} path: ./build/debug/${{ steps.libname.outputs.NAME }} @@ -149,7 +131,7 @@ jobs: - name: Upload QMOD - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: ${{ env.module_id }}-(UNZIP-for-QMOD).qmod path: ./${{ env.module_id }}_${{ env.version }}.qmod diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index abf0576..e944662 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -9,69 +9,46 @@ on: env: module_id: QuestSounds - BSVersion: 1.28.0_4124311467 - ndkname: android-ndk-r24 jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 name: Checkout with: submodules: true lfs: true - - uses: seanmiddleditch/gha-setup-ninja@v3 - - #- name: Install Powershell - # run: sudo apt-get install -y powershell + - uses: seanmiddleditch/gha-setup-ninja@v5 - name: Get the tag name run: echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV - #- name: Cache Android NDK - # id: cache-ndk - # uses: actions/cache@v2 - # env: - # cache-name: cache-ndk - # with: - # path: ndk - # key: ${{ runner.os }}-${{ env.cache-name }}-${{ env.ndkname }} - # restore-keys: | - # ${{ runner.os }}-${{ env.cache-name }}-${{ env.ndkname }} - - #- name: Install Android NDK - # if: steps.cache-ndk.outputs.cache-hit != 'true' - # run: | - # wget -q -O ndk.zip https://dl.google.com/android/repository/${ndkname}-linux-x86_64.zip - # unzip -q ndk.zip - # mv ${ndkname} ndk - - #- name: Create ndkpath.txt - # run: | - # cd ndk - # pwd > ${GITHUB_WORKSPACE}/ndkpath.txt + - name: Get BSVersion + shell: pwsh + run: | + echo "BSVersion=$((Get-Content ./mod.template.json -Raw | ConvertFrom-Json).packageVersion)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - name: Create ndkpath.txt run: | echo "$ANDROID_NDK_LATEST_HOME" > ${GITHUB_WORKSPACE}/ndkpath.txt - - name: Get QPM - if: steps.cache-qpm.outputs.cache-hit != 'true' - uses: dawidd6/action-download-artifact@v2 - with: - github_token: ${{secrets.GITHUB_TOKEN}} - workflow: cargo-build.yml - name: linux-qpm-rust - path: QPM - repo: RedBrumbler/QuestPackageManager-Rust - + - name: Get QPM + if: steps.cache-qpm.outputs.cache-hit != 'true' + uses: dawidd6/action-download-artifact@v2 + with: + github_token: ${{secrets.GITHUB_TOKEN}} + workflow: cargo-build.yml + name: linux-qpm + path: QPM + repo: QuestPackageManager/QPM.CLI + - name: QPM Collapse run: | - chmod +x ./QPM/qpm-rust - ./QPM/qpm-rust collapse + chmod +x ./QPM/qpm + ./QPM/qpm collapse - name: QPM Dependencies Cache id: cache-qpm-deps @@ -79,15 +56,17 @@ jobs: env: cache-name: cache-qpm-deps with: - path: /home/runner/.local/share/QPM-Rust/cache - key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('qpm.json', '.github/BuildQSounds.yml') }} + path: /home/runner/.local/share/QPM-RS/cache + key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('qpm.shared.json') }} restore-keys: | ${{ runner.os }}-${{ env.cache-name }}- ${{ runner.os }}-${{ env.cache-name }} - - name: QPM Restore + - name: QPM Set Version & Restore run: | - ./QPM/qpm-rust restore + ./QPM/qpm package edit --version ${{ env.version }} + ./QPM/qpm restore + - name: Check dependency Folders run: | @@ -98,14 +77,12 @@ jobs: ls -lh ${GITHUB_WORKSPACE}/extern/libs echo "" echo "Checking QPM-Rust/cache Folder" - ls -lh $HOME/.local/share/QPM-Rust/cache + ls -lh $HOME/.local/share/QPM-RS/cache echo "" - name: Build run: | cd ${GITHUB_WORKSPACE} - ./QPM/qpm-rust package edit --version ${{ env.version }} - ./QPM/qpm-rust qmod build pwsh -Command ./build.ps1 -actions - name: Get Library Name @@ -114,40 +91,18 @@ jobs: cd ./build/ pattern="lib${module_id}*.so" files=( $pattern ) - echo ::set-output name=NAME::"${files[0]}" + echo "NAME=${files[0]}" >> $GITHUB_OUTPUT - name: Package QMOD run: | cd ${GITHUB_WORKSPACE} - pwsh -Command ./buildQMOD.ps1 -package -release + ./QPM/qpm qmod zip -i ./build/ -i ./extern/libs/ -f ./Cover.jpg -i ./Examples/ ${module_id}_${version}.qmod - name: Release uses: softprops/action-gh-release@v1 with: name: ${{ env.module_id }} ${{ env.version }} for Beat Saber ${{ env.BSVersion }} files: | - ./${{ env.module_id }}.qmod + ./${{ env.module_id }}_${{ env.version }}.qmod body_path: ./rl-notes.md draft: true - - #- name: Create Release - # id: create_release - # uses: actions/create-release@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # tag_name: ${{ github.ref }} - # release_name: ${{ env.module_id }} ${{ github.ref }} for Beat Saber ${{ env.BSVersion }} - # body_path: ./rl-notes.md - # draft: true - # prerelease: false - #- name: Upload QMOD Release Asset - # id: upload-release-QMOD - # uses: actions/upload-release-asset@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # upload_url: ${{ steps.create_release.outputs.upload_url }} - # asset_path: ./${{ env.module_id }}.qmod - # asset_name: ${{ env.module_id }}.qmod - # asset_content_type: application/qmod \ No newline at end of file diff --git a/.gitignore b/.gitignore index 59fd1a2..d1133ff 100644 --- a/.gitignore +++ b/.gitignore @@ -52,9 +52,6 @@ ndkpath.txt # Other files extern/ - -qpm.shared.json -extern/ *.backup *.log diff --git a/Android.mk b/Android.mk deleted file mode 100644 index 2a24bc9..0000000 --- a/Android.mk +++ /dev/null @@ -1,71 +0,0 @@ -# Copyright (C) 2009 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -LOCAL_PATH := $(call my-dir) -TARGET_ARCH_ABI := $(APP_ABI) - -rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2)) - -# Build the modloader shared library -include $(CLEAR_VARS) -LOCAL_MODULE := -include $(CLEAR_VARS) -# Creating prebuilt for dependency: beatsaber-hook - version: 1.3.3 -include $(CLEAR_VARS) -LOCAL_MODULE := beatsaber-hook_3_4_4 -LOCAL_EXPORT_C_INCLUDES := extern/beatsaber-hook -LOCAL_SRC_FILES := extern/libbeatsaber-hook_3_4_4.so -include $(PREBUILT_SHARED_LIBRARY) -# Creating prebuilt for dependency: codegen - version: 0.14.0 -include $(CLEAR_VARS) -LOCAL_MODULE := codegen -LOCAL_EXPORT_C_INCLUDES := extern/codegen -LOCAL_SRC_FILES := extern/libcodegen.so -include $(PREBUILT_SHARED_LIBRARY) -# Creating prebuilt for dependency: custom-types - version: 0.8.2 -include $(CLEAR_VARS) -LOCAL_MODULE := custom-types -LOCAL_EXPORT_C_INCLUDES := extern/custom-types -LOCAL_SRC_FILES := extern/libcustom-types.so -include $(PREBUILT_SHARED_LIBRARY) -# Creating prebuilt for dependency: modloader - version: 1.1.0 -include $(CLEAR_VARS) -LOCAL_MODULE := modloader -LOCAL_EXPORT_C_INCLUDES := extern/modloader -LOCAL_SRC_FILES := extern/libmodloader.so -include $(PREBUILT_SHARED_LIBRARY) -# Creating prebuilt for dependency: questui - version: 0.6.5 -include $(CLEAR_VARS) -LOCAL_MODULE := questui -LOCAL_EXPORT_C_INCLUDES := extern/questui -LOCAL_SRC_FILES := extern/libquestui.so -include $(PREBUILT_SHARED_LIBRARY) - -include $(CLEAR_VARS) -LOCAL_MODULE := QuestSounds -LOCAL_SRC_FILES += $(call rwildcard,src/,*.cpp) -LOCAL_SRC_FILES += $(call rwildcard,extern/beatsaber-hook/src/inline-hook,*.cpp) -LOCAL_SRC_FILES += $(call rwildcard,extern/beatsaber-hook/src/inline-hook,*.c) -LOCAL_SHARED_LIBRARIES += modloader -LOCAL_SHARED_LIBRARIES += beatsaber-hook_3_4_4 -LOCAL_SHARED_LIBRARIES += codegen -LOCAL_SHARED_LIBRARIES += custom-types -LOCAL_SHARED_LIBRARIES += questui -LOCAL_LDLIBS += -llog -LOCAL_CFLAGS += -I'extern/libil2cpp/il2cpp/libil2cpp' -DID='"QuestSounds"' -DVERSION='"$(VERSION)"' -DBS__1_16=1 -I'./shared' -I'./extern' -isystem'extern/codegen/include' -Ofast -LOCAL_CPP_FEATURES += rtti exceptions -LOCAL_CPPFLAGS += -std=c++2a -Ofast -LOCAL_C_INCLUDES += ./include ./src -include $(BUILD_SHARED_LIBRARY) diff --git a/Android_Template.mk b/Android_Template.mk deleted file mode 100644 index 4cf731b..0000000 --- a/Android_Template.mk +++ /dev/null @@ -1,71 +0,0 @@ -# Copyright (C) 2009 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -LOCAL_PATH := $(call my-dir) -TARGET_ARCH_ABI := $(APP_ABI) - -rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2)) - -# Build the modloader shared library -include $(CLEAR_VARS) -LOCAL_MODULE := -include $(CLEAR_VARS) -# Creating prebuilt for dependency: beatsaber-hook - version: 1.3.3 -include $(CLEAR_VARS) -LOCAL_MODULE := beatsaber-hook_{BS_Hook} -LOCAL_EXPORT_C_INCLUDES := extern/beatsaber-hook -LOCAL_SRC_FILES := extern/libbeatsaber-hook_{BS_Hook}.so -include $(PREBUILT_SHARED_LIBRARY) -# Creating prebuilt for dependency: codegen - version: 0.14.0 -include $(CLEAR_VARS) -LOCAL_MODULE := codegen -LOCAL_EXPORT_C_INCLUDES := extern/codegen -LOCAL_SRC_FILES := extern/libcodegen.so -include $(PREBUILT_SHARED_LIBRARY) -# Creating prebuilt for dependency: custom-types - version: 0.8.2 -include $(CLEAR_VARS) -LOCAL_MODULE := custom-types -LOCAL_EXPORT_C_INCLUDES := extern/custom-types -LOCAL_SRC_FILES := extern/libcustom-types.so -include $(PREBUILT_SHARED_LIBRARY) -# Creating prebuilt for dependency: modloader - version: 1.1.0 -include $(CLEAR_VARS) -LOCAL_MODULE := modloader -LOCAL_EXPORT_C_INCLUDES := extern/modloader -LOCAL_SRC_FILES := extern/libmodloader.so -include $(PREBUILT_SHARED_LIBRARY) -# Creating prebuilt for dependency: questui - version: 0.6.5 -include $(CLEAR_VARS) -LOCAL_MODULE := questui -LOCAL_EXPORT_C_INCLUDES := extern/questui -LOCAL_SRC_FILES := extern/libquestui.so -include $(PREBUILT_SHARED_LIBRARY) - -include $(CLEAR_VARS) -LOCAL_MODULE := QuestSounds -LOCAL_SRC_FILES += $(call rwildcard,src/,*.cpp) -LOCAL_SRC_FILES += $(call rwildcard,extern/beatsaber-hook/src/inline-hook,*.cpp) -LOCAL_SRC_FILES += $(call rwildcard,extern/beatsaber-hook/src/inline-hook,*.c) -LOCAL_SHARED_LIBRARIES += modloader -LOCAL_SHARED_LIBRARIES += beatsaber-hook_{BS_Hook} -LOCAL_SHARED_LIBRARIES += codegen -LOCAL_SHARED_LIBRARIES += custom-types -LOCAL_SHARED_LIBRARIES += questui -LOCAL_LDLIBS += -llog -LOCAL_CFLAGS += -I'extern/libil2cpp/il2cpp/libil2cpp' -DID='"QuestSounds"' -DVERSION='"$(VERSION)"' -DBS__1_16=1 -I'./shared' -I'./extern' -isystem'extern/codegen/include' -Ofast -LOCAL_CPP_FEATURES += rtti exceptions -LOCAL_CPPFLAGS += -std=c++2a -Ofast -LOCAL_C_INCLUDES += ./include ./src -include $(BUILD_SHARED_LIBRARY) diff --git a/Application.mk b/Application.mk deleted file mode 100644 index d7e70ca..0000000 --- a/Application.mk +++ /dev/null @@ -1,6 +0,0 @@ -APP_ABI := arm64-v8a -# 25 -APP_PLATFORM := android-24 -APP_PIE:= true -APP_STL := c++_static -APP_CPPFLAGS := -std=c++2a \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 0379af1..975d67b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,6 @@ # include some defines automatically made by qpm include(qpm_defines.cmake) -# override mod id -# set(MOD_ID "QuestSounds") # Enable link time optimization # In my experience, this can be highly unstable but it nets a huge size optimization and likely performance @@ -13,6 +11,7 @@ set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) cmake_minimum_required(VERSION 3.21) project(${COMPILE_ID}) +include(${EXTERN_DIR}/includes/kaleb/shared/cmake/assets.cmake) # c++ standard set(CMAKE_CXX_STANDARD 20) @@ -27,7 +26,6 @@ add_compile_options(-frtti -fexceptions) add_compile_options(-Ofast) # compile definitions used add_compile_definitions(VERSION=\"${MOD_VERSION}\") -add_compile_definitions(ID=\"${MOD_ID}\") add_compile_definitions(MOD_ID=\"${MOD_ID}\") # recursively get all src files @@ -42,10 +40,6 @@ add_library( ${c_file_list} ) -target_include_directories(${COMPILE_ID} PRIVATE .) - -target_include_directories(${COMPILE_ID} PRIVATE extern/includes/questui_components) - # add src dir as include dir target_include_directories(${COMPILE_ID} PRIVATE ${SOURCE_DIR}) # add include dir as include dir @@ -55,7 +49,9 @@ target_include_directories(${COMPILE_ID} PUBLIC ${SHARED_DIR}) # codegen includes target_include_directories(${COMPILE_ID} PRIVATE ${EXTERN_DIR}/includes/${CODEGEN_ID}/include) -target_link_libraries(${COMPILE_ID} PRIVATE -llog) +# Kaleb include assets +add_assets(${COMPILE_ID}-assets STATIC ${CMAKE_CURRENT_LIST_DIR}/assets ${INCLUDE_DIR}/assets.hpp) +target_link_libraries(${COMPILE_ID} PRIVATE -llog -lz ${COMPILE_ID}-assets) # add extern stuff like libs and other includes include(extern.cmake) diff --git a/Examples/BombHitExplosion.ogg b/Examples/BombHitExplosion.ogg new file mode 100644 index 0000000..0655b25 Binary files /dev/null and b/Examples/BombHitExplosion.ogg differ diff --git a/assets/ConfigMenuSelectionViewController.bsml b/assets/ConfigMenuSelectionViewController.bsml new file mode 100644 index 0000000..7422bb2 --- /dev/null +++ b/assets/ConfigMenuSelectionViewController.bsml @@ -0,0 +1,25 @@ + + + + +