Skip to content

Commit

Permalink
Merge pull request #10 from kodenamekrak/1.25.1
Browse files Browse the repository at this point in the history
0.9.1 - fix crashes for 1.25.1
  • Loading branch information
ComputerElite authored Dec 19, 2022
2 parents 5f92d4c + 2a8beef commit 965ab62
Show file tree
Hide file tree
Showing 8 changed files with 120 additions and 74 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ Android.mk.backup
*.qmod
mod.json
qpm.shared.json
qpm_defines.cmake
![Cc][Mm]ake[Ll]ists.txt

# CMake stuff
Expand All @@ -65,4 +64,5 @@ cmake-build-*/
extern.cmake

# QMOD Schema
mod.json.schema
mod.json.schema
ndkpath.txt
21 changes: 0 additions & 21 deletions include/ModConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,4 @@ DECLARE_CONFIG(ModConfig,
CONFIG_VALUE(ZRot, float, "Z Rot", 0);
CONFIG_VALUE(MoveMultiplier, float, "Change movement multipler", 5.0f);
CONFIG_VALUE(MoveController, int, "Controls for moving the camera", 0);

CONFIG_INIT_FUNCTION(
CONFIG_INIT_VALUE(Active);
CONFIG_INIT_VALUE(Fixed);
CONFIG_INIT_VALUE(LeftSaber);
CONFIG_INIT_VALUE(SwapSaber);
CONFIG_INIT_VALUE(ApplyOffsets);
CONFIG_INIT_VALUE(OnlyPos);
CONFIG_INIT_VALUE(MoveWhilePlaying);
CONFIG_INIT_VALUE(DisableWhileReplay);
CONFIG_INIT_VALUE(WashingMachine);
CONFIG_INIT_VALUE(WashingMachineSpeed);
CONFIG_INIT_VALUE(XOffset);
CONFIG_INIT_VALUE(YOffset);
CONFIG_INIT_VALUE(ZOffset);
CONFIG_INIT_VALUE(XRot);
CONFIG_INIT_VALUE(YRot);
CONFIG_INIT_VALUE(ZRot);
CONFIG_INIT_VALUE(MoveMultiplier);
CONFIG_INIT_VALUE(MoveController);
)
)
6 changes: 3 additions & 3 deletions mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Third Person mod",
"id": "Play3rdPer",
"author": "ComputerElite",
"version": "0.9.0",
"version": "0.9.1",
"packageId": "com.beatgames.beatsaber",
"packageVersion": "1.25.1",
"coverImage": "cover.png",
Expand All @@ -19,9 +19,9 @@
"downloadIfMissing": "/~https://github.com/sc2ad/BeatSaber-Quest-Codegen/releases/download/v0.28.0/Codegen.qmod"
},
{
"version": "^0.17.4",
"version": "^0.17.5",
"id": "questui",
"downloadIfMissing": "/~https://github.com/darknight1050/QuestUI/releases/download/v0.17.4/QuestUI.qmod"
"downloadIfMissing": "/~https://github.com/darknight1050/QuestUI/releases/download/v0.17.5/QuestUI.qmod"
}
],
"modFiles": [
Expand Down
2 changes: 1 addition & 1 deletion mod.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"_QPVersion": "0.1.1",
"id": "Play3rdPer",
"name": "Third Person mod",
"version": "0.9.0",
"version": "0.9.1",
"coverImage": "cover.png",
"author": "ComputerElite",
"packageId": "com.beatgames.beatsaber",
Expand Down
22 changes: 11 additions & 11 deletions qpm.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"info": {
"name": "Third Person Mod",
"id": "Play3rdPer",
"version": "0.5.0",
"version": "0.9.1",
"url": null,
"additionalData": {
"overrideSoName": "libPlay3rdPer.so"
Expand All @@ -17,28 +17,28 @@
"additionalData": {}
},
{
"id": "config-utils",
"versionRange": "*",
"id": "beatsaber-hook",
"versionRange": "^3.14.0",
"additionalData": {}
},
{
"id": "beatsaber-hook",
"versionRange": "^3.14.0",
"id": "codegen",
"versionRange": "^0.28.0",
"additionalData": {}
},
{
"id": "custom-types",
"versionRange": "^0.15.21",
"id": "questui",
"versionRange": "^0.17.5",
"additionalData": {}
},
{
"id": "codegen",
"versionRange": "^0.28.0",
"id": "custom-types",
"versionRange": "^0.15.21",
"additionalData": {}
},
{
"id": "questui",
"versionRange": "^0.17.4",
"id": "config-utils",
"versionRange": "^1.0.1",
"additionalData": {}
}
],
Expand Down
76 changes: 43 additions & 33 deletions qpm.shared.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"info": {
"name": "Third Person Mod",
"id": "Play3rdPer",
"version": "0.5.0",
"version": "0.9.1",
"url": null,
"additionalData": {
"overrideSoName": "libPlay3rdPer.so"
Expand All @@ -18,32 +18,31 @@
"additionalData": {}
},
{
"id": "config-utils",
"versionRange": "*",
"id": "beatsaber-hook",
"versionRange": "^3.14.0",
"additionalData": {}
},
{
"id": "beatsaber-hook",
"versionRange": "^3.14.0",
"id": "codegen",
"versionRange": "^0.28.0",
"additionalData": {}
},
{
"id": "custom-types",
"versionRange": "^0.15.21",
"id": "questui",
"versionRange": "^0.17.5",
"additionalData": {}
},
{
"id": "codegen",
"versionRange": "^0.28.0",
"id": "custom-types",
"versionRange": "^0.15.21",
"additionalData": {}
},
{
"id": "questui",
"versionRange": "^0.17.4",
"id": "config-utils",
"versionRange": "^1.0.1",
"additionalData": {}
}
],
"additionalData": {}
]
},
"restoredDependencies": [
{
Expand All @@ -61,7 +60,7 @@
{
"dependency": {
"id": "libil2cpp",
"versionRange": "^0.2.3",
"versionRange": "=0.2.3",
"additionalData": {
"headersOnly": true
}
Expand All @@ -71,35 +70,46 @@
{
"dependency": {
"id": "config-utils",
"versionRange": "*",
"versionRange": "=1.0.1",
"additionalData": {
"headersOnly": true,
"soLink": "/~https://github.com/darknight1050/config-utils/releases/download/v0.8.0/libconfig-utils_test.so",
"debugSoLink": "/~https://github.com/darknight1050/config-utils/releases/download/v0.8.0/debug_libconfig-utils_test.so",
"soLink": "/~https://github.com/darknight1050/config-utils/releases/download/v1.0.1/libconfig-utils_test.so",
"debugSoLink": "/~https://github.com/darknight1050/config-utils/releases/download/v1.0.1/debug_libconfig-utils_test.so",
"overrideSoName": "libconfig-utils_test.so",
"branchName": "version-v0.8.0"
"branchName": "version-v1.0.1"
}
},
"version": "0.8.0"
"version": "1.0.1"
},
{
"dependency": {
"id": "custom-types",
"versionRange": "^0.15.21",
"versionRange": "=0.15.22",
"additionalData": {
"soLink": "/~https://github.com/sc2ad/Il2CppQuestTypePatching/releases/download/v0.15.21/libcustom-types.so",
"debugSoLink": "/~https://github.com/sc2ad/Il2CppQuestTypePatching/releases/download/v0.15.21/debug_libcustom-types.so",
"soLink": "/~https://github.com/sc2ad/Il2CppQuestTypePatching/releases/download/v0.15.22/libcustom-types.so",
"debugSoLink": "/~https://github.com/sc2ad/Il2CppQuestTypePatching/releases/download/v0.15.22/debug_libcustom-types.so",
"overrideSoName": "libcustom-types.so",
"modLink": "/~https://github.com/sc2ad/Il2CppQuestTypePatching/releases/download/v0.15.21/CustomTypes.qmod",
"branchName": "version-v0.15.21"
"modLink": "/~https://github.com/sc2ad/Il2CppQuestTypePatching/releases/download/v0.15.22/CustomTypes.qmod",
"branchName": "version-v0.15.22"
}
},
"version": "0.15.21"
"version": "0.15.22"
},
{
"dependency": {
"id": "rapidjson-macros",
"versionRange": "=0.4.4",
"additionalData": {
"headersOnly": true,
"branchName": "version-v0.4.4"
}
},
"version": "0.4.4"
},
{
"dependency": {
"id": "beatsaber-hook",
"versionRange": "^3.14.0",
"versionRange": "=3.14.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",
Expand All @@ -111,7 +121,7 @@
{
"dependency": {
"id": "codegen",
"versionRange": "^0.28.0",
"versionRange": "=0.28.0",
"additionalData": {
"soLink": "/~https://github.com/sc2ad/BeatSaber-Quest-Codegen/releases/download/v0.28.0/libcodegen.so",
"overrideSoName": "libcodegen.so",
Expand All @@ -124,21 +134,21 @@
{
"dependency": {
"id": "questui",
"versionRange": "^0.17.4",
"versionRange": "=0.17.5",
"additionalData": {
"soLink": "/~https://github.com/darknight1050/QuestUI/releases/download/v0.17.4/libquestui.so",
"debugSoLink": "/~https://github.com/darknight1050/QuestUI/releases/download/v0.17.4/debug_libquestui.so",
"soLink": "/~https://github.com/darknight1050/QuestUI/releases/download/v0.17.5/libquestui.so",
"debugSoLink": "/~https://github.com/darknight1050/QuestUI/releases/download/v0.17.5/debug_libquestui.so",
"overrideSoName": "libquestui.so",
"modLink": "/~https://github.com/darknight1050/QuestUI/releases/download/v0.17.4/QuestUI.qmod",
"branchName": "version-v0.17.4",
"modLink": "/~https://github.com/darknight1050/QuestUI/releases/download/v0.17.5/QuestUI.qmod",
"branchName": "version-v0.17.5",
"compileOptions": {
"systemIncludes": [
"shared/cppcodec"
]
}
}
},
"version": "0.17.4"
"version": "0.17.5"
}
]
}
57 changes: 57 additions & 0 deletions qpm_defines.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# YOU SHOULD NOT MANUALLY EDIT THIS FILE, QPM WILL VOID ALL CHANGES
# Version defines, pretty useful
set(MOD_VERSION "0.9.1")
# take the mod name and just remove spaces, that will be MOD_ID, if you don't like it change it after the include of this file
set(MOD_ID "ThirdPersonMod")

# derived from override .so name or just id_version
set(COMPILE_ID "Play3rdPer")
# derived from whichever codegen package is installed, will default to just codegen
set(CODEGEN_ID "codegen")

# given from qpm, automatically updated from qpm.json
set(EXTERN_DIR_NAME "extern")
set(SHARED_DIR_NAME "shared")

# if no target given, use Debug
if (NOT DEFINED CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Debug")
endif()

# defines used in ninja / cmake ndk builds
if (NOT DEFINED CMAKE_ANDROID_NDK)
if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/ndkpath.txt")
file (STRINGS "ndkpath.txt" CMAKE_ANDROID_NDK)
else()
if(EXISTS $ENV{ANDROID_NDK_HOME})
set(CMAKE_ANDROID_NDK $ENV{ANDROID_NDK_HOME})
elseif(EXISTS $ENV{ANDROID_NDK_LATEST_HOME})
set(CMAKE_ANDROID_NDK $ENV{ANDROID_NDK_LATEST_HOME})
endif()
endif()
endif()
if (NOT DEFINED CMAKE_ANDROID_NDK)
message(Big time error buddy, no NDK)
endif()
message(Using NDK ${CMAKE_ANDROID_NDK})
string(REPLACE "\\" "/" CMAKE_ANDROID_NDK ${CMAKE_ANDROID_NDK})

set(ANDROID_PLATFORM 24)
set(ANDROID_ABI arm64-v8a)
set(ANDROID_STL c++_static)
set(ANDROID_USE_LEGACY_TOOLCHAIN_FILE OFF)

set(CMAKE_TOOLCHAIN_FILE ${CMAKE_ANDROID_NDK}/build/cmake/android.toolchain.cmake)
# define used for external data, mostly just the qpm dependencies
set(EXTERN_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${EXTERN_DIR_NAME})
set(SHARED_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${SHARED_DIR_NAME})
# get files by filter recursively
MACRO(RECURSE_FILES return_list filter)
FILE(GLOB_RECURSE new_list ${filter})
SET(file_list "")
FOREACH(file_path ${new_list})
SET(file_list ${file_list} ${file_path})
ENDFOREACH()
LIST(REMOVE_DUPLICATES file_list)
SET(${return_list} ${file_list})
ENDMACRO()
6 changes: 3 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
using namespace GlobalNamespace;

static ModInfo modInfo;
DEFINE_CONFIG(ModConfig);

Logger& getLogger() {
static Logger* logger = new Logger(modInfo, LoggerOptions(false, true));
Expand Down Expand Up @@ -68,8 +67,8 @@ UnityEngine::Matrix4x4 TranslateMatrix(UnityEngine::Vector3 vector)

VRController* rightController = nullptr;
VRController* leftController = nullptr;
UnityEngine::Vector3 saberRot = UnityEngine::Vector3(getModConfig().XRot.GetValue(), getModConfig().YRot.GetValue(), getModConfig().ZRot.GetValue());
UnityEngine::Vector3 saberPos = UnityEngine::Vector3(getModConfig().XOffset.GetValue(), getModConfig().YOffset.GetValue(), getModConfig().ZOffset.GetValue());
UnityEngine::Vector3 saberRot;
UnityEngine::Vector3 saberPos;

UnityEngine::Vector3 prevPos = UnityEngine::Vector3(0.0f, 0.0f, 0.0f);

Expand Down Expand Up @@ -100,6 +99,7 @@ if(shouldGetControllers) {
}

UnityEngine::Camera* c = UnityEngine::Camera::get_main();
if(!c) return;
UnityEngine::Vector3 rot = c->get_transform()->get_eulerAngles();
UnityEngine::Vector3 pos = c->get_transform()->get_position();

Expand Down

0 comments on commit 965ab62

Please sign in to comment.