diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..1ff0c42
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,63 @@
+###############################################################################
+# Set default behavior to automatically normalize line endings.
+###############################################################################
+* text=auto
+
+###############################################################################
+# Set default behavior for command prompt diff.
+#
+# This is need for earlier builds of msysgit that does not have it on by
+# default for csharp files.
+# Note: This is only used by command line
+###############################################################################
+#*.cs diff=csharp
+
+###############################################################################
+# Set the merge driver for project and solution files
+#
+# Merging from the command prompt will add diff markers to the files if there
+# are conflicts (Merging from VS is not affected by the settings below, in VS
+# the diff markers are never inserted). Diff markers may cause the following
+# file extensions to fail to load in VS. An alternative would be to treat
+# these files as binary and thus will always conflict and require user
+# intervention with every merge. To do so, just uncomment the entries below
+###############################################################################
+#*.sln merge=binary
+#*.csproj merge=binary
+#*.vbproj merge=binary
+#*.vcxproj merge=binary
+#*.vcproj merge=binary
+#*.dbproj merge=binary
+#*.fsproj merge=binary
+#*.lsproj merge=binary
+#*.wixproj merge=binary
+#*.modelproj merge=binary
+#*.sqlproj merge=binary
+#*.wwaproj merge=binary
+
+###############################################################################
+# behavior for image files
+#
+# image files are treated as binary by default.
+###############################################################################
+#*.jpg binary
+#*.png binary
+#*.gif binary
+
+###############################################################################
+# diff behavior for common document formats
+#
+# Convert binary document formats to text before diffing them. This feature
+# is only available from the command line. Turn it on by uncommenting the
+# entries below.
+###############################################################################
+#*.doc diff=astextplain
+#*.DOC diff=astextplain
+#*.docx diff=astextplain
+#*.DOCX diff=astextplain
+#*.dot diff=astextplain
+#*.DOT diff=astextplain
+#*.pdf diff=astextplain
+#*.PDF diff=astextplain
+#*.rtf diff=astextplain
+#*.RTF diff=astextplain
diff --git a/.github/workflows/ndk-build.yml b/.github/workflows/ndk-build.yml
index 064f1d6..d9ca253 100644
--- a/.github/workflows/ndk-build.yml
+++ b/.github/workflows/ndk-build.yml
@@ -39,10 +39,9 @@ on:
- '!.gitignore'
env:
- module_id: multiquestensions
- version: 0.1.1-Dev-${{ github.run_number }}
- bs_hook: 2_3_2
- BS_Version: 1.17.1
+ module_id: MultiQuestensions
+ version: 0.2.0-Dev-${{ github.run_number }}
+ BS_Version: 1.21.0
#ndkname: android-ndk-r23
jobs:
diff --git a/.gitignore b/.gitignore
index 7685831..c02ccb5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -347,3 +347,5 @@ ARM64/
ndkbuild.props
/MultiQuestensions/log_timestamp
*.qmod
+*.cmake
+/build/
diff --git a/.vscode/launch.json b/.vscode/launch.json
index 7a9dfa0..f18feed 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -4,12 +4,76 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
+
{
- "type": "pwa-chrome",
+ "name": "Launch Beat Saber",
+ "type": "fb-lldb",
"request": "launch",
- "name": "Launch Chrome against localhost",
- "url": "http://localhost:8080",
- "webRoot": "${workspaceFolder}"
+ "android": {
+ "application": {
+ "package": "com.beatgames.beatsaber",
+ "activity": "com.unity3d.player.UnityPlayerActivity"
+ },
+ "lldbConfig": {
+ "sourceMaps": [
+ "\\home\\runner\\work\\MultiplayerCore.Quest\\MultiplayerCore.Quest\\ ${workspaceFolder}/../",
+ "/home/runner/work/MultiplayerCore.Quest/MultiplayerCore.Quest/ ${workspaceFolder}/../",
+ "\\home\\runner\\work\\MultiQuestensions\\MultiQuestensions\\ ${workspaceFolder}/MultiQuestensions/",
+ "/home/runner/work/MultiQuestensions/ ${workspaceFolder}/MultiQuestensions/",
+ "/home/runner/work/SongDownloader/ ${workspaceFolder}/../",
+ "/home/runner/work/SongDownloader/SongDownloader/shared ${workspaceFolder}/extern/includes/SongDownloader/shared",
+ "/home/runner/work/SongLoader/ ${workspaceFolder}/../",
+ "/home/runner/work/SongLoader/SongLoader/shared ${workspaceFolder}/extern/includes/SongLoader/shared",
+ "/home/runner/work/questui/ ${workspaceFolder}/../",
+ "/home/runner/work/questui/questui/shared ${workspaceFolder}/extern/includes/questui/shared",
+ "/home/runner/work/beatsaber-hook/ ${workspaceFolder}/../",
+ "/home/runner/work/beatsaber-hook/beatsaber-hook/ ${workspaceFolder}/extern/includes/beatsaber-hook/",
+ "/home/runner/work/custom-types/ ${workspaceFolder}/../",
+ "/home/runner/work/Il2CppQuestTypePatching/Il2CppQuestTypePatching/shared ${workspaceFolder}/extern/includes/custom-types/shared"
+ ],
+ "librarySearchPaths": [
+ "${workspaceFolder}/build/debug/",
+ "${workspaceFolder}/extern/libs/",
+ "${workspaceFolder}/../Symbols/",
+ "${workspaceFolder}/../MultiplayerCore.Quest/build/debug/",
+ ]
+ }
+ }
+ },
+ {
+ "name": "Attach to running Beat Saber Instance",
+ "type": "fb-lldb",
+ "request": "attach",
+ "android": {
+ "application": {
+ "package": "com.beatgames.beatsaber",
+ "activity": "com.unity3d.player.UnityPlayerActivity"
+ },
+ "lldbConfig": {
+ "sourceMaps": [
+ "\\home\\runner\\work\\MultiplayerCore.Quest\\MultiplayerCore.Quest\\ ${workspaceFolder}/../",
+ "/home/runner/work/MultiplayerCore.Quest/MultiplayerCore.Quest/ ${workspaceFolder}/../",
+ "\\home\\runner\\work\\MultiQuestensions\\MultiQuestensions\\ ${workspaceFolder}/MultiQuestensions/",
+ "/home/runner/work/MultiQuestensions/ ${workspaceFolder}/MultiQuestensions/",
+ "/home/runner/work/SongDownloader/ ${workspaceFolder}/../",
+ "/home/runner/work/SongDownloader/SongDownloader/shared ${workspaceFolder}/extern/includes/SongDownloader/shared",
+ "/home/runner/work/SongLoader/ ${workspaceFolder}/../",
+ "/home/runner/work/SongLoader/SongLoader/shared ${workspaceFolder}/extern/includes/SongLoader/shared",
+ "/home/runner/work/questui/ ${workspaceFolder}/../",
+ "/home/runner/work/questui/questui/shared ${workspaceFolder}/extern/includes/questui/shared",
+ "/home/runner/work/beatsaber-hook/ ${workspaceFolder}/../",
+ "/home/runner/work/beatsaber-hook/beatsaber-hook/ ${workspaceFolder}/extern/includes/beatsaber-hook/",
+ "/home/runner/work/custom-types/ ${workspaceFolder}/../",
+ "/home/runner/work/Il2CppQuestTypePatching/Il2CppQuestTypePatching/shared ${workspaceFolder}/extern/includes/custom-types/shared"
+ ],
+ "librarySearchPaths": [
+ "${workspaceFolder}/build/debug/",
+ "${workspaceFolder}/extern/libs/",
+ "${workspaceFolder}/../Symbols/",
+ "${workspaceFolder}/../MultiplayerCore.Quest/build/debug/",
+ ]
+ }
+ }
}
]
}
\ No newline at end of file
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 0000000..bd82047
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,4 @@
+{
+ "cmake.sourceDirectory": "${workspaceFolder}/MultiQuestensions",
+ "cmake.configureOnOpen": false
+}
\ No newline at end of file
diff --git a/MultiQuestensions.code-workspace b/MultiQuestensions.code-workspace
new file mode 100644
index 0000000..876a149
--- /dev/null
+++ b/MultiQuestensions.code-workspace
@@ -0,0 +1,8 @@
+{
+ "folders": [
+ {
+ "path": "."
+ }
+ ],
+ "settings": {}
+}
\ No newline at end of file
diff --git a/MultiQuestensions/.gitignore b/MultiQuestensions/.gitignore
index cde7ff9..ed541cf 100644
--- a/MultiQuestensions/.gitignore
+++ b/MultiQuestensions/.gitignore
@@ -48,6 +48,7 @@ out/
[Ll]ibs/
[Oo]bj/
[Oo]bjs/
+[Bb]uild/
*.zip
*.txt
extern/
diff --git a/MultiQuestensions/Android.mk b/MultiQuestensions/Android.mk
index fa98188..98a9790 100644
--- a/MultiQuestensions/Android.mk
+++ b/MultiQuestensions/Android.mk
@@ -18,14 +18,13 @@ TARGET_ARCH_ABI := $(APP_ABI)
rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))
-# Creating prebuilt for dependency: beatsaber-hook - version: 2.3.2
+# Creating prebuilt for dependency: beatsaber-hook - version: 3.6.1
include $(CLEAR_VARS)
-LOCAL_MODULE := beatsaber-hook_2_3_2
+LOCAL_MODULE := beatsaber-hook_3_6_1
LOCAL_EXPORT_C_INCLUDES := extern/beatsaber-hook
-LOCAL_SRC_FILES := extern/libbeatsaber-hook_2_3_2.so
-LOCAL_CPP_FEATURES += exceptions
+LOCAL_SRC_FILES := extern/libbeatsaber-hook_3_6_1.so
include $(PREBUILT_SHARED_LIBRARY)
-# Creating prebuilt for dependency: custom-types - version: 0.12.7
+# Creating prebuilt for dependency: custom-types - version: 0.15.2
include $(CLEAR_VARS)
LOCAL_MODULE := custom-types
LOCAL_EXPORT_C_INCLUDES := extern/custom-types
@@ -37,13 +36,13 @@ LOCAL_MODULE := modloader
LOCAL_EXPORT_C_INCLUDES := extern/modloader
LOCAL_SRC_FILES := extern/libmodloader.so
include $(PREBUILT_SHARED_LIBRARY)
-# Creating prebuilt for dependency: songloader - version: 0.7.2
+# Creating prebuilt for dependency: songloader - version: 0.8.0
include $(CLEAR_VARS)
LOCAL_MODULE := songloader
LOCAL_EXPORT_C_INCLUDES := extern/songloader
LOCAL_SRC_FILES := extern/libsongloader.so
include $(PREBUILT_SHARED_LIBRARY)
-# Creating prebuilt for dependency: questui - version: 0.11.1
+# Creating prebuilt for dependency: questui - version: 0.12.3
include $(CLEAR_VARS)
LOCAL_MODULE := questui
LOCAL_EXPORT_C_INCLUDES := extern/questui
@@ -55,7 +54,7 @@ LOCAL_MODULE := songdownloader
LOCAL_EXPORT_C_INCLUDES := extern/songdownloader
LOCAL_SRC_FILES := extern/libsongdownloader.so
include $(PREBUILT_SHARED_LIBRARY)
-# Creating prebuilt for dependency: codegen - version: 0.14.0
+# Creating prebuilt for dependency: codegen - version: 0.19.0
include $(CLEAR_VARS)
LOCAL_MODULE := codegen
LOCAL_EXPORT_C_INCLUDES := extern/codegen
@@ -68,7 +67,7 @@ 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_2_3_2
+LOCAL_SHARED_LIBRARIES += beatsaber-hook_3_6_1
LOCAL_SHARED_LIBRARIES += custom-types
LOCAL_SHARED_LIBRARIES += songloader
LOCAL_SHARED_LIBRARIES += questui
@@ -78,4 +77,5 @@ LOCAL_LDLIBS += -llog
LOCAL_CFLAGS += -I'extern/libil2cpp/il2cpp/libil2cpp' -DID='"multiquestensions"' -DVERSION='"$(VERSION)"' -DMPEX_PROTOCOL='"$(MPEX_PROTOCOL)"' -I'./shared' -I'./extern' -isystem'extern/codegen/include' -Ofast
LOCAL_CPPFLAGS += -std=c++2a
LOCAL_C_INCLUDES += ./include ./src
+LOCAL_CPP_FEATURES += rtti exceptions
include $(BUILD_SHARED_LIBRARY)
diff --git a/MultiQuestensions/MultiQuestensions.vcxproj b/MultiQuestensions/MultiQuestensions.vcxproj
index 1eee77b..e8ec6ee 100644
--- a/MultiQuestensions/MultiQuestensions.vcxproj
+++ b/MultiQuestensions/MultiQuestensions.vcxproj
@@ -81,6 +81,7 @@
+
@@ -114,12 +115,12 @@
- src;include;extern;extern\libil2cpp\il2cpp\libil2cpp;extern\codegen\include;extern\custom-types\shared
+ src;include;extern\includes;extern\includes\libil2cpp\il2cpp\libil2cpp;extern\includes\codegen\include;extern\includes\custom-types\shared
ID='"Mod ID"';VERSION='"Mod Version"';MPEX_PROTOCOL='"0.6.1"'
"$(NdkPath)\build\ndk-build.cmd" NDK_PROJECT_PATH=$(ProjectDir) APP_BUILD_SCRIPT=$(ProjectDir)Android.mk NDK_APPLICATION_MK=$(ProjectDir)Application.mk
"$(NdkPath)\build\ndk-build.cmd" -B
"$(NdkPath)\build\ndk-build.cmd" clean
- src;include;extern;extern\libil2cpp\il2cpp\libil2cpp;extern\codegen\include;extern\custom-types\shared;..\android-ndk-r23\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\**;..\android-ndk-r23\sources\cxx-stl\system\include;..\android-ndk-r23\sources\cxx-stl\llvm-libc++\include;..\android-ndk-r23\sources\cxx-stl\llvm-libc++abi\include
+ src;include;extern\includes;extern\includes\libil2cpp\il2cpp\libil2cpp;extern\includes\codegen\include;extern\includes\custom-types\shared;..\android-ndk-r23\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\**;..\android-ndk-r23\sources\cxx-stl\system\include;..\android-ndk-r23\sources\cxx-stl\llvm-libc++\include;..\android-ndk-r23\sources\cxx-stl\llvm-libc++abi\include
src;include;extern;extern\libil2cpp\il2cpp\libil2cpp;extern\codegen\include;extern\custom-types\shared
diff --git a/MultiQuestensions/MultiQuestensions.vcxproj.filters b/MultiQuestensions/MultiQuestensions.vcxproj.filters
index ba30a51..8d605c3 100644
--- a/MultiQuestensions/MultiQuestensions.vcxproj.filters
+++ b/MultiQuestensions/MultiQuestensions.vcxproj.filters
@@ -229,5 +229,6 @@
+
\ No newline at end of file
diff --git a/MultiQuestensions/build.ps1 b/MultiQuestensions/build.ps1
index be252ad..31ba03b 100644
--- a/MultiQuestensions/build.ps1
+++ b/MultiQuestensions/build.ps1
@@ -1,41 +1,56 @@
Param (
+[Parameter(Mandatory=$false)][Switch]$clean,
[Parameter(HelpMessage="The version the mod should be compiled with")][string]$Version,
[Parameter(HelpMessage="The MpEx protocol version the mod should be compiled with")][Alias("MpEx-Protocol")][string]$MpEx_Protocol
)
Write-Host $Version
-$NDKPath = Get-Content $PSScriptRoot/ndkpath.txt -First 1
if ($env:VERSION) {
$Version = $env:VERSION
}
if (!($Version)) {
-$Version = "0.1.1"
+$Version = "1.0.0"
}
if ($env:MPEX_PROTOCOL) {
$MpEx_Protocol = $env:MPEX_PROTOCOL
}
if (!($MpEx_Protocol)) {
-$MpEx_Protocol = "0.7.1"
+$MpEx_Protocol = "1.0.0"
}
-if ((Test-Path "./extern/beatsaber-hook/src/inline-hook/And64InlineHook.cpp", "./extern/beatsaber-hook/src/inline-hook/inlineHook.c", "./extern/beatsaber-hook/src/inline-hook/relocate.c") -contains $false) {
+if ((Test-Path "./extern/includes/beatsaber-hook/src/inline-hook/And64InlineHook.cpp", "./extern/includes/beatsaber-hook/src/inline-hook/inlineHook.c", "./extern/includes/beatsaber-hook/src/inline-hook/relocate.c") -contains $false) {
Write-Host "Critical: Missing inline-hook"
- if (!(Test-Path "./extern/beatsaber-hook/src/inline-hook/And64InlineHook.cpp")) {
- Write-Host "./extern/beatsaber-hook/src/inline-hook/And64InlineHook.cpp"
+ if (!(Test-Path "./extern/includes/beatsaber-hook/src/inline-hook/And64InlineHook.cpp")) {
+ Write-Host "./extern/includes/beatsaber-hook/src/inline-hook/And64InlineHook.cpp"
}
- if (!(Test-Path "./extern/beatsaber-hook/src/inline-hook/inlineHook.c")) {
- Write-Host "./extern/beatsaber-hook/src/inline-hook/inlineHook.c"
+ if (!(Test-Path "./extern/includes/beatsaber-hook/src/inline-hook/inlineHook.c")) {
+ Write-Host "./extern/includes/beatsaber-hook/src/inline-hook/inlineHook.c"
}
- if (!(Test-Path "./extern/beatsaber-hook/inline-hook/src/relocate.c")) {
- Write-Host "./extern/beatsaber-hook/src/inline-hook/relocate.c"
+ if (!(Test-Path "./extern/includes/beatsaber-hook/inline-hook/src/relocate.c")) {
+ Write-Host "./extern/includes/beatsaber-hook/src/inline-hook/relocate.c"
}
Write-Host "Task Failed"
exit 1;
}
-echo "Building MultiQuestensions Version: $Version with MpEx Protocol Version: $MpEx_Protocol"
+Write-Output "Building MultiQuestensions Version: $Version with MpEx Protocol Version: $MpEx_Protocol"
-$buildScript = "$NDKPath/build/ndk-build"
-if (-not ($PSVersionTable.PSEdition -eq "Core")) {
- $buildScript += ".cmd"
+if ($clean.IsPresent)
+{
+ if (Test-Path -Path "build")
+ {
+ remove-item build -R
+ }
+}
+
+if (($clean.IsPresent) -or (-not (Test-Path -Path "build")))
+{
+ (new-item -Path build -ItemType Directory) | Out-Null
}
-& $buildScript NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=./Android.mk NDK_APPLICATION_MK=./Application.mk VERSION=$Version MPEX_PROTOCOL=$MpEx_Protocol
\ No newline at end of file
+& qpm-rust package edit --version $Version
+
+Set-Location build
+& cmake -G "Ninja" -DCMAKE_BUILD_TYPE="RelWithDebInfo" -DMPEX_PROTOCOL="$MpEx_Protocol" ../
+& cmake --build . -j 6
+$ExitCode = $LastExitCode
+Set-Location ..
+exit $ExitCode
\ No newline at end of file
diff --git a/MultiQuestensions/buildQMOD.ps1 b/MultiQuestensions/buildQMOD.ps1
index 67b8620..8c22e7a 100644
--- a/MultiQuestensions/buildQMOD.ps1
+++ b/MultiQuestensions/buildQMOD.ps1
@@ -1,66 +1,104 @@
-# Builds a .qmod file for loading with QP
-if ($args.Count -eq 0) {
-$ModID = "multiquestensions"
-$BSHook = "2_3_2"
-$VERSION = "0.1.0"
-$BS_Version = "1.17.1"
-$new_VERSION = Read-Host -Prompt "Input desired mod version (leave empty for default: '$VERSION')"
-$bs_hook_version = $BSHook.Replace("_", ".")
-$new_BSHook = Read-Host -Prompt "Input current bs-hook version (leave empty for default: '$bs_hook_version')"
-if ($new_VERSION -ne "") {
- $VERSION = $new_VERSION
+Param(
+ [Parameter(Mandatory=$false, HelpMessage="The name the output qmod file should have")][String] $qmodname="MultiQuestensions",
+
+ [Parameter(Mandatory=$false, HelpMessage="The version of the mod")][String] $version,
+
+ [Parameter(Mandatory=$false, HelpMessage="Switch to create a clean compilation")]
+ [Alias("rebuild")]
+ [Switch] $clean,
+
+ [Parameter(Mandatory=$false, HelpMessage="Prints the help instructions")]
+ [Switch] $help,
+
+ [Parameter(Mandatory=$false, HelpMessage="Tells the script to not compile and only package the existing files")]
+ [Alias("actions", "pack")]
+ [Switch] $package
+)
+
+# Builds a .qmod file for loading with QP or BMBF
+
+
+if ($help -eq $true) {
+ Write-Output "`"BuildQmod `" - Copiles your mod into a `".so`" or a `".a`" library"
+ Write-Output "`n-- Parameters --`n"
+ Write-Output "qmodName `t The file name of your qmod"
+
+ Write-Output "`n-- Arguments --`n"
+
+ Write-Output "-clean `t`t Performs a clean build on both your library and the qmod"
+ Write-Output "-help `t`t Prints this"
+ Write-Output "-package `t Only packages existing files, without recompiling`n"
+
+ exit
}
-if ($new_BSHook -ne "") {
- $BSHook = $new_BSHook.Replace(".", "_")
+
+if ($qmodName -eq "")
+{
+ Write-Output "Give a proper qmod name and try again"
+ exit
}
-Write-Host "Compiling Mod"
-& $PSScriptRoot/build.ps1 -Version $VERSION
-& Copy-Item "./obj/local/arm64-v8a/lib$ModID.so" -Destination "./debug-builds/libmultiquestensions_$VERSION.so"
+
+if ($package -eq $true) {
+ $qmodName = "$($env:module_id)_$($env:version)"
+ Write-Output "Actions: Packaging QMod $qmodName"
}
+if (($args.Count -eq 0) -And $package -eq $false) {
+ Write-Output "Creating QMod $qmodName"
+ & $PSScriptRoot/build.ps1 -clean:$clean -version:$version
+
+ if ($LASTEXITCODE -ne 0) {
+ Write-Output "Failed to build, exiting..."
+ exit $LASTEXITCODE
+ }
-# TODO: Get the below working with Github Actions variables.
-if ($args[0] -eq "--package") {
- $ModID = $env:module_id
- $BSHook = $env:bs_hook
- $VERSION = $env:version
- $BS_Version = $env:BSVersion
- Write-Host "Github Actions Package started"
+ qpm-rust qmod build
}
-# Checks if the build was successful
-if ($?) {
- # Checks if any needed files are missing
- if ((Test-Path "./libs/arm64-v8a/libbeatsaber-hook_$BSHook.so", "./libs/arm64-v8a/lib$ModID.so", "./mod.json") -contains $false) {
- Write-Host "The following files are missing"
- if (!(Test-Path "./libs/arm64-v8a/libbeatsaber-hook_$BSHook.so")) {
- Write-Host "./libs/arm64-v8a/libbeatsaber-hook_$BSHook.so"
- }
- if (!(Test-Path "./libs/arm64-v8a/lib$ModID.so")) {
- Write-Host "./libs/arm64-v8a/lib$ModID.so"
- }
- if (!(Test-Path ".\mod.json")) {
- Write-Host ".\mod.json"
- }
- Write-Host "Task Failed"
- exit 1;
+
+Write-Output "Creating qmod from mod.json"
+
+$mod = "./mod.json"
+$modJson = Get-Content $mod -Raw | ConvertFrom-Json
+
+$filelist = @($mod)
+
+$cover = "./" + $modJson.coverImage
+if ((-not ($cover -eq "./")) -and (Test-Path $cover))
+{
+ $filelist += ,$cover
+} else {
+ Write-Output "No cover Image found"
+}
+
+foreach ($mod in $modJson.modFiles)
+{
+ $path = "./build/" + $mod
+ if (-not (Test-Path $path))
+ {
+ $path = "./extern/libs/" + $mod
}
- else {
- # If we have all files needed, go ahead and packe into qmod
- if ($args.Count -eq 0 -or $args[0] -eq "--package") {
- Write-Host "Upating mod.json"
- $json = Get-Content $PSScriptRoot/mod.json -raw | ConvertFrom-Json
- $json.packageVersion = "$BS_Version"
- $json.version="$VERSION"
- $json.libraryFiles=@("libbeatsaber-hook_$BSHook.so")
- $json | ConvertTo-Json -depth 32| Set-Content $PSScriptRoot/mod.json
-
- Write-Host "Packaging QMod with ModID: $ModID Version: $VERSION and BS-Hook version: $BSHook"
- $packagename = $ModID + "_v" + $VERSION
- Compress-Archive -Path "./libs/arm64-v8a/lib$ModID.so", "./libs/arm64-v8a/libbeatsaber-hook_$BSHook.so", ".\mod.json" -DestinationPath "./Temp$packagename.zip" -Update
- Move-Item "./Temp$packagename.zip" "./$packagename.qmod" -Force
- }
- Write-Host "Task Completed"
+ $filelist += $path
+}
+
+foreach ($lib in $modJson.libraryFiles)
+{
+ $path = "./extern/libs/" + $lib
+ if (-not (Test-Path $path))
+ {
+ $path = "./build/" + $lib
}
+ $filelist += $path
+}
+
+$zip = $qmodName + ".zip"
+$qmod = $qmodName + ".qmod"
+
+if ((-not ($clean.IsPresent)) -and (Test-Path $qmod))
+{
+ Write-Output "Making Clean Qmod"
+ Move-Item $qmod $zip -Force
}
-else {
- Write-Host "Build failed, see output"
-}
\ No newline at end of file
+
+Compress-Archive -Path $filelist -DestinationPath $zip -Update
+Move-Item $zip $qmod -Force
+
+Write-Output "Task Completed"
\ No newline at end of file
diff --git a/MultiQuestensions/include/Assets/Sprites.hpp b/MultiQuestensions/include/Assets/Sprites.hpp
index 23337aa..8a2f60b 100644
--- a/MultiQuestensions/include/Assets/Sprites.hpp
+++ b/MultiQuestensions/include/Assets/Sprites.hpp
@@ -5,9 +5,11 @@ namespace MultiQuestensions {
class Sprites {
static std::string Oculus64;
static std::string Steam64;
+ static std::string Meta64;
public:
static UnityEngine::Sprite* IconOculus64();
static UnityEngine::Sprite* IconSteam64();
+ static UnityEngine::Sprite* IconMeta64();
};
}
\ No newline at end of file
diff --git a/MultiQuestensions/include/Beatmaps/PreviewBeatmapPacket.hpp b/MultiQuestensions/include/Beatmaps/PreviewBeatmapPacket.hpp
deleted file mode 100644
index b8953a6..0000000
--- a/MultiQuestensions/include/Beatmaps/PreviewBeatmapPacket.hpp
+++ /dev/null
@@ -1,40 +0,0 @@
-#pragma once
-#include "main.hpp"
-#include "custom-types/shared/types.hpp"
-#include "custom-types/shared/macros.hpp"
-
-#include "LiteNetLib/Utils/NetDataReader.hpp"
-#include "LiteNetLib/Utils/NetDataWriter.hpp"
-#include "LiteNetLib/Utils/INetSerializable.hpp"
-#include "GlobalNamespace/ThreadStaticPacketPool_1.hpp"
-#include "GlobalNamespace/PacketPool_1.hpp"
-#include "GlobalNamespace/IPoolablePacket.hpp"
-
-#define PBPInterfaces { classof(LiteNetLib::Utils::INetSerializable*), classof(GlobalNamespace::IPoolablePacket*) }
-
-___DECLARE_TYPE_WRAPPER_INHERITANCE(MultiQuestensions::Beatmaps, PreviewBeatmapPacket, Il2CppTypeEnum::IL2CPP_TYPE_CLASS,
- Il2CppObject, "MultiQuestensions::Beatmaps",
- PBPInterfaces, 0, nullptr,
- DECLARE_CTOR(New);
-
- // Basic Song Info/Metadata
- DECLARE_INSTANCE_FIELD(Il2CppString*, levelId);
- DECLARE_INSTANCE_FIELD(Il2CppString*, levelHash);
- DECLARE_INSTANCE_FIELD(Il2CppString*, songName);
- DECLARE_INSTANCE_FIELD(Il2CppString*, songSubName);
- DECLARE_INSTANCE_FIELD(Il2CppString*, songAuthorName);
- DECLARE_INSTANCE_FIELD(Il2CppString*, levelAuthorName);
- DECLARE_INSTANCE_FIELD(float, beatsPerMinute);
- DECLARE_INSTANCE_FIELD(float, songDuration);
-
- // Selection Info
- DECLARE_INSTANCE_FIELD(Il2CppString*, characteristic);
- DECLARE_INSTANCE_FIELD(uint, difficulty);
-
- DECLARE_OVERRIDE_METHOD(void, Serialize, il2cpp_utils::FindMethodUnsafe(classof(LiteNetLib::Utils::INetSerializable*), "Serialize", 1), LiteNetLib::Utils::NetDataWriter* writer);
- DECLARE_OVERRIDE_METHOD(void, Deserialize, il2cpp_utils::FindMethodUnsafe(classof(LiteNetLib::Utils::INetSerializable*), "Deserialize", 1), LiteNetLib::Utils::NetDataReader* reader);
- DECLARE_OVERRIDE_METHOD(void, Release, il2cpp_utils::FindMethodUnsafe(classof(GlobalNamespace::IPoolablePacket*), "Release", 0));
- public:
- LiteNetLib::Utils::INetSerializable* ToINetSerializable() noexcept { return reinterpret_cast(this); }
-)
-#undef PBPInterfaces
\ No newline at end of file
diff --git a/MultiQuestensions/include/Beatmaps/PreviewBeatmapStub.hpp b/MultiQuestensions/include/Beatmaps/PreviewBeatmapStub.hpp
deleted file mode 100644
index 539f947..0000000
--- a/MultiQuestensions/include/Beatmaps/PreviewBeatmapStub.hpp
+++ /dev/null
@@ -1,81 +0,0 @@
-#pragma once
-#include "main.hpp"
-#include "custom-types/shared/types.hpp"
-#include "custom-types/shared/macros.hpp"
-
-#include "PreviewBeatmapPacket.hpp"
-#include "System/Threading/CancellationToken.hpp"
-#include "System/Threading/Tasks/Task_1.hpp"
-#include "System/Func_2.hpp"
-#include "UnityEngine/Sprite.hpp"
-#include "UnityEngine/AudioClip.hpp"
-#include "UnityEngine/Texture2D.hpp"
-#include "UnityEngine/Rect.hpp"
-#include "UnityEngine/Vector2.hpp"
-#include "UnityEngine/Vector4.hpp"
-#include "UnityEngine/SpriteMeshType.hpp"
-
-#include "GlobalNamespace/EnvironmentInfoSO.hpp"
-#include "GlobalNamespace/PreviewDifficultyBeatmapSet.hpp"
-
-namespace MultiQuestensions::Beatmaps {
- enum class DownloadableState { True, False, Unchecked };
-}
-
-DECLARE_CLASS_INTERFACES(MultiQuestensions::Beatmaps, PreviewBeatmapStub, "System", "Object", sizeof(Il2CppObject),
- { classof(GlobalNamespace::IPreviewBeatmapLevel*) },
-
- DECLARE_CTOR(FromPreviewPacket, Il2CppString* levelhash, GlobalNamespace::IPreviewBeatmapLevel* level, PreviewBeatmapPacket* lvl = nullptr);
- //DECLARE_CTOR(FromPreview, Il2CppString* levelHash, GlobalNamespace::IPreviewBeatmapLevel*);
- //DECLARE_CTOR(FromPacket, MultiQuestensions::Beatmaps::PreviewBeatmapPacket*);
-
- DECLARE_INSTANCE_METHOD(MultiQuestensions::Beatmaps::PreviewBeatmapPacket*, GetPacket, Il2CppString*, GlobalNamespace::BeatmapDifficulty);
-
- DECLARE_INSTANCE_FIELD(GlobalNamespace::IPreviewBeatmapLevel*, _preview);
- DECLARE_INSTANCE_FIELD(UnityEngine::Sprite*, coverImage);
- DECLARE_INSTANCE_FIELD(bool, isDownloaded);
- DECLARE_INSTANCE_FIELD(bool, isDownloadable);
-
-
- DECLARE_INSTANCE_FIELD(Il2CppString*, levelID);
- DECLARE_INSTANCE_FIELD(Il2CppString*, levelHash);
-
- DECLARE_INSTANCE_FIELD(Il2CppString*, songName);
- DECLARE_INSTANCE_FIELD(Il2CppString*, songSubName);
- DECLARE_INSTANCE_FIELD(Il2CppString*, songAuthorName);
- DECLARE_INSTANCE_FIELD(Il2CppString*, levelAuthorName);
- DECLARE_INSTANCE_FIELD(float, beatsPerMinute);
- DECLARE_INSTANCE_FIELD(float, songDuration);
-
- DECLARE_INSTANCE_FIELD(float, songTimeOffset);
- DECLARE_INSTANCE_FIELD(float, previewDuration);
- DECLARE_INSTANCE_FIELD(float, previewStartTime);
- DECLARE_INSTANCE_FIELD(float, shuffle);
- DECLARE_INSTANCE_FIELD(float, shufflePeriod);
- DECLARE_INSTANCE_FIELD(GlobalNamespace::EnvironmentInfoSO*, allDirectionsEnvironmentInfo);
- DECLARE_INSTANCE_FIELD(GlobalNamespace::EnvironmentInfoSO*, environmentInfo);
- DECLARE_INSTANCE_FIELD(Array*, previewDifficultyBeatmapSets);
-
- DECLARE_OVERRIDE_METHOD(Il2CppString*, get_levelID, il2cpp_utils::FindMethodUnsafe(classof(GlobalNamespace::IPreviewBeatmapLevel*), "get_levelID", 0));
- DECLARE_OVERRIDE_METHOD(Il2CppString*, get_songName, il2cpp_utils::FindMethodUnsafe(classof(GlobalNamespace::IPreviewBeatmapLevel*), "get_songName", 0));
- DECLARE_OVERRIDE_METHOD(Il2CppString*, get_songSubName, il2cpp_utils::FindMethodUnsafe(classof(GlobalNamespace::IPreviewBeatmapLevel*), "get_songSubName", 0));
- DECLARE_OVERRIDE_METHOD(Il2CppString*, get_songAuthorName, il2cpp_utils::FindMethodUnsafe(classof(GlobalNamespace::IPreviewBeatmapLevel*), "get_songAuthorName", 0));
- DECLARE_OVERRIDE_METHOD(Il2CppString*, get_levelAuthorName, il2cpp_utils::FindMethodUnsafe(classof(GlobalNamespace::IPreviewBeatmapLevel*), "get_levelAuthorName", 0));
- DECLARE_OVERRIDE_METHOD(float, get_beatsPerMinute, il2cpp_utils::FindMethodUnsafe(classof(GlobalNamespace::IPreviewBeatmapLevel*), "get_beatsPerMinute", 0));
- DECLARE_OVERRIDE_METHOD(float, get_songDuration, il2cpp_utils::FindMethodUnsafe(classof(GlobalNamespace::IPreviewBeatmapLevel*), "get_songDuration", 0));
- DECLARE_OVERRIDE_METHOD(float, get_songTimeOffset, il2cpp_utils::FindMethodUnsafe(classof(GlobalNamespace::IPreviewBeatmapLevel*), "get_songTimeOffset", 0));
- DECLARE_OVERRIDE_METHOD(float, get_previewDuration, il2cpp_utils::FindMethodUnsafe(classof(GlobalNamespace::IPreviewBeatmapLevel*), "get_previewDuration", 0));
- DECLARE_OVERRIDE_METHOD(float, get_previewStartTime, il2cpp_utils::FindMethodUnsafe(classof(GlobalNamespace::IPreviewBeatmapLevel*), "get_previewStartTime", 0));
- DECLARE_OVERRIDE_METHOD(float, get_shuffle, il2cpp_utils::FindMethodUnsafe(classof(GlobalNamespace::IPreviewBeatmapLevel*), "get_shuffle", 0));
- DECLARE_OVERRIDE_METHOD(float, get_shufflePeriod, il2cpp_utils::FindMethodUnsafe(classof(GlobalNamespace::IPreviewBeatmapLevel*), "get_shufflePeriod", 0));
- DECLARE_OVERRIDE_METHOD(GlobalNamespace::EnvironmentInfoSO*, get_allDirectionsEnvironmentInfo, il2cpp_utils::FindMethodUnsafe(classof(GlobalNamespace::IPreviewBeatmapLevel*), "get_allDirectionsEnvironmentInfo", 0));
- DECLARE_OVERRIDE_METHOD(GlobalNamespace::EnvironmentInfoSO*, get_environmentInfo, il2cpp_utils::FindMethodUnsafe(classof(GlobalNamespace::IPreviewBeatmapLevel*), "get_environmentInfo", 0));
- DECLARE_OVERRIDE_METHOD(Array*, get_previewDifficultyBeatmapSets, il2cpp_utils::FindMethodUnsafe(classof(GlobalNamespace::IPreviewBeatmapLevel*), "get_previewDifficultyBeatmapSets", 0));
-
- DECLARE_OVERRIDE_METHOD(System::Threading::Tasks::Task_1*, GetCoverImageAsync, il2cpp_utils::FindMethodUnsafe(classof(GlobalNamespace::IPreviewBeatmapLevel*), "GetCoverImageAsync", 1), System::Threading::CancellationToken cancellationToken);
- DECLARE_OVERRIDE_METHOD(System::Threading::Tasks::Task_1*, GetPreviewAudioClipAsync, il2cpp_utils::FindMethodUnsafe(classof(GlobalNamespace::IPreviewBeatmapLevel*), "GetPreviewAudioClipAsync", 1), System::Threading::CancellationToken cancellationToken);
-
- // C++ Definitions
- private:
- DownloadableState _downloadable;
-)
\ No newline at end of file
diff --git a/MultiQuestensions/include/CS_DataStore.hpp b/MultiQuestensions/include/CS_DataStore.hpp
deleted file mode 100644
index 5f9034a..0000000
--- a/MultiQuestensions/include/CS_DataStore.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-#pragma once
-#include "custom-types/shared/macros.hpp"
-#include
-#include "GlobalNamespace/IPreviewBeatmapLevel.hpp"
-#include "GlobalNamespace/BeatmapDifficulty.hpp"
-#include "GlobalNamespace/BeatmapCharacteristicSO.hpp"
-#include "GlobalNamespace/IDifficultyBeatmap.hpp"
-#include "GlobalNamespace/GameplayModifiers.hpp"
-
-DECLARE_CLASS_CODEGEN(MultiQuestensions, DataStore, Il2CppObject,
-
- DECLARE_CTOR(New, GlobalNamespace::IPreviewBeatmapLevel*, GlobalNamespace::BeatmapCharacteristicSO*, GlobalNamespace::IDifficultyBeatmap*, GlobalNamespace::GameplayModifiers*);
-
- DECLARE_INSTANCE_FIELD(GlobalNamespace::IPreviewBeatmapLevel*, loadingPreviewBeatmapLevel);
- DECLARE_INSTANCE_FIELD(GlobalNamespace::BeatmapCharacteristicSO*, loadingBeatmapCharacteristic);
- DECLARE_INSTANCE_FIELD(GlobalNamespace::IDifficultyBeatmap*, loadingDifficultyBeatmap);
- DECLARE_INSTANCE_FIELD(GlobalNamespace::GameplayModifiers*, loadingGameplayModifiers);
-
- static DataStore* instance;
-
-public:
- std::optional loadingBeatmapDifficulty;
-
- static DataStore* get_Instance();
- static DataStore* CS_Ctor(GlobalNamespace::IPreviewBeatmapLevel* previewBeatmap, GlobalNamespace::BeatmapCharacteristicSO* beatmapCharacteristic, GlobalNamespace::IDifficultyBeatmap* difficultyBeatmap, GlobalNamespace::GameplayModifiers* gameplayModifiers, GlobalNamespace::BeatmapDifficulty beatmapDifficulty);
- static void Clear();
-)
\ No newline at end of file
diff --git a/MultiQuestensions/include/Config.hpp b/MultiQuestensions/include/Config.hpp
new file mode 100644
index 0000000..34c027e
--- /dev/null
+++ b/MultiQuestensions/include/Config.hpp
@@ -0,0 +1,142 @@
+#pragma once
+#include "main.hpp"
+#include "UnityEngine/Color.hpp"
+#include "CodegenExtensions/ColorUtility.hpp"
+
+namespace MultiQuestensions {
+ Configuration& getConfig();
+ Configuration& getLegacyConfig();
+
+ struct Config {
+ static constexpr UnityEngine::Color DefaultPlayerColor = UnityEngine::Color(0.031f, 0.752f, 1.0f, 1.0f);
+
+ protected:
+ bool Hologram = true;
+ bool LagReducer = false;
+ bool MissLighting = true;
+ bool NoMetaZone = false;
+ UnityEngine::Color PlayerColor = DefaultPlayerColor;
+ UnityEngine::Color MissColor = UnityEngine::Color(1, 0, 0, 1);
+
+ public:
+ bool getHologram() const { return Hologram; }
+
+ void setHologram(bool value) {
+ Hologram = value;
+ getConfig().config["Hologram"].SetBool(Hologram);
+ getConfig().Write();
+ }
+
+ bool getLagReducer() const { return LagReducer; }
+
+ void setLagReducer(bool value) {
+ LagReducer = value;
+ getConfig().config["LagReducer"].SetBool(LagReducer);
+ getConfig().Write();
+ }
+
+ bool getMissLighting() const { return MissLighting; }
+
+ void setMissLighting(bool value) {
+ MissLighting = value;
+ getConfig().config["MissLighting"].SetBool(MissLighting);
+ getConfig().Write();
+ }
+
+ bool getNoMetaZone() const { return NoMetaZone; }
+
+ void setNoMetaZone(bool value) {
+ NoMetaZone = value;
+ getConfig().config["NoMetaZone"].SetBool(NoMetaZone);
+ getConfig().Write();
+ }
+
+ UnityEngine::Color getPlayerColor() const {
+ return PlayerColor;
+ }
+
+ void setPlayerColor(const UnityEngine::Color& value) {
+ PlayerColor = value;
+ ConfigDocument& configDoc = getConfig().config;
+ auto& allocator = configDoc.GetAllocator();
+ configDoc["PlayerColor"].SetString(UnityEngine::ColorUtility::ToHtmlStringRGB_CPP(PlayerColor), allocator);
+ getConfig().Write();
+ }
+
+ UnityEngine::Color getMissColor() const {
+ return MissColor;
+ }
+
+ void setMissColor(const UnityEngine::Color& value) {
+ MissColor = value;
+ ConfigDocument& configDoc = getConfig().config;
+ auto& allocator = configDoc.GetAllocator();
+ configDoc["MissColor"].SetString(UnityEngine::ColorUtility::ToHtmlStringRGB_CPP(MissColor), allocator);
+ getConfig().Write();
+ }
+
+ void Initialize() {
+ getLogger().info("Checking for legacy config file...");
+ // Checking legacy config file
+ ConfigDocument& legacyConfig = getLegacyConfig().config;
+ if (legacyConfig.IsObject() && !legacyConfig.HasMember("Converted")) {
+ // Legacy Conversion
+ getLogger().info("Legacy config file found. Converting...");
+ if (legacyConfig.HasMember("LagReducer") && legacyConfig["LagReducer"].IsBool()) {
+ LagReducer = legacyConfig["LagReducer"].GetBool();
+ }
+ if (legacyConfig.HasMember("color") && legacyConfig["color"].IsString()) {
+ UnityEngine::ColorUtility::TryParseHtmlString(legacyConfig["color"].GetString(), PlayerColor);
+ }
+ legacyConfig.AddMember("Converted", true, legacyConfig.GetAllocator());
+ }
+ // TODO: Delete config on a later version
+ /*
+ else if (legacyConfig.IsObject() && legacyConfig.HasMember("Converted")) {
+ remove(Configuration::getConfigFilePath({"multiquestensions", modInfo.version}).c_str());
+ }
+ */
+
+ getLogger().info("Reading config file...");
+ ConfigDocument& configDoc = getConfig().config;
+ bool parseError = false;
+ if (configDoc.IsObject()) {
+ (configDoc.HasMember("Hologram") && configDoc["Hologram"].IsBool()) ? (Hologram = configDoc["Hologram"].GetBool()) : parseError = true;
+ (configDoc.HasMember("LagReducer") && configDoc["LagReducer"].IsBool()) ? (LagReducer = configDoc["LagReducer"].GetBool()) : parseError = true;
+ (configDoc.HasMember("MissLighting") && configDoc["MissLighting"].IsBool()) ? (MissLighting = configDoc["MissLighting"].GetBool()) : parseError = true;
+ (configDoc.HasMember("NoMetaZone") && configDoc["NoMetaZone"].IsBool()) ? (NoMetaZone = configDoc["NoMetaZone"].GetBool()) : parseError = true;
+ if (!(configDoc.HasMember("PlayerColor") && configDoc["PlayerColor"].IsString() &&
+ UnityEngine::ColorUtility::TryParseHtmlString(configDoc["PlayerColor"].GetString(), PlayerColor))) {
+ parseError = true;
+ }
+ if (!(configDoc.HasMember("MissColor") && configDoc["MissColor"].IsString() &&
+ UnityEngine::ColorUtility::TryParseHtmlString(configDoc["MissColor"].GetString(), MissColor))) {
+ parseError = true;
+ }
+ } else parseError = true;
+
+ if (parseError) SaveDefaultConfig();
+ }
+
+ void SaveDefaultConfig() {
+ getLogger().info("Creating config file...");
+ ConfigDocument& configDoc = getConfig().config;
+ configDoc.RemoveAllMembers();
+ if (!configDoc.IsObject())
+ configDoc.SetObject();
+ auto& allocator = configDoc.GetAllocator();
+
+ configDoc.AddMember("Hologram", Hologram, allocator);
+ configDoc.AddMember("LagReducer", LagReducer, allocator);
+ configDoc.AddMember("MissLighting", MissLighting, allocator);
+ configDoc.AddMember("NoMetaZone", NoMetaZone, allocator);
+ configDoc.AddMember("PlayerColor", UnityEngine::ColorUtility::ToHtmlStringRGB_CPP(PlayerColor), allocator);
+ configDoc.AddMember("MissColor", UnityEngine::ColorUtility::ToHtmlStringRGB_CPP(MissColor), allocator);
+
+ getConfig().Write();
+ getLogger().info("Config file created.");
+ }
+ };
+
+ extern MultiQuestensions::Config config;
+}
\ No newline at end of file
diff --git a/MultiQuestensions/include/Environments/LobbyAvatarNameTag.hpp b/MultiQuestensions/include/Environments/MQEAvatarNameTag.hpp
similarity index 51%
rename from MultiQuestensions/include/Environments/LobbyAvatarNameTag.hpp
rename to MultiQuestensions/include/Environments/MQEAvatarNameTag.hpp
index c67a53b..85fbd34 100644
--- a/MultiQuestensions/include/Environments/LobbyAvatarNameTag.hpp
+++ b/MultiQuestensions/include/Environments/MQEAvatarNameTag.hpp
@@ -1,6 +1,8 @@
#pragma once
#include "custom-types/shared/macros.hpp"
-#include "Extensions/ExtendedPlayer.hpp"
+#include "Players/MpexPlayerData.hpp"
+#include "multiplayer-core/shared/Players/MpPlayerData.hpp"
+#include "Players/MpexPlayerManager.hpp"
#include "UnityEngine/MonoBehaviour.hpp"
#include "HMUI/ImageView.hpp"
#include "HMUI/CurvedTextMeshPro.hpp"
@@ -8,7 +10,7 @@
#include "UnityEngine/Sprite.hpp"
#include