Skip to content

Commit e28782b

Browse files
Fixed crash if you didn't have Replay installed
aka I disabled it
1 parent 43faf62 commit e28782b

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

Android.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ LOCAL_SHARED_LIBRARIES += codegen_0_4_0
6464
LOCAL_SHARED_LIBRARIES += questui
6565
LOCAL_SHARED_LIBRARIES += custom-types
6666
LOCAL_LDLIBS += -llog
67-
LOCAL_CFLAGS += -I'extern/libil2cpp/il2cpp/libil2cpp' -DID='"Play3rdPer"' -DVERSION='"0.1.2"' -I'./shared' -I'./extern' -isystem'extern/codegen/include'
67+
LOCAL_CFLAGS += -I'extern/libil2cpp/il2cpp/libil2cpp' -DID='"Play3rdPer"' -DVERSION='"0.1.3"' -I'./shared' -I'./extern' -isystem'extern/codegen/include'
6868
LOCAL_CPPFLAGS += -std=c++2a
6969
LOCAL_C_INCLUDES += ./include ./src
7070
include $(BUILD_SHARED_LIBRARY)

bmbfmod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "Play3rdPer",
33
"name": "Third Person Mod",
4-
"version": "0.1.2",
4+
"version": "0.1.3",
55
"author": "ComputerElite",
66
"description": [
77
"Allows you to play in third Person"

buildBMBF.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ if (-not ($PSVersionTable.PSEdition -eq "Core")) {
88

99
& $buildScript NDK_PROJECT_PATH=$PSScriptRoot APP_BUILD_SCRIPT=$PSScriptRoot/Android.mk NDK_APPLICATION_MK=$PSScriptRoot/Application.mk
1010

11-
Compress-Archive -Path "./libs/arm64-v8a/libPlay3rdPer.so", "./bmbfmod.json" -DestinationPath "./Play3rdPer_v0.1.2.zip" -Update
11+
Compress-Archive -Path "./libs/arm64-v8a/libPlay3rdPer.so", "./bmbfmod.json" -DestinationPath "./Play3rdPer_v0.1.3.zip" -Update

src/Play3rdPerViewController.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,14 @@ void Play3rdPerViewController::DidActivate(bool firstActivation, bool addedToHie
137137
QuestUI::IncrementSetting* MoveMultiplierObject = QuestUI::BeatSaberUI::CreateIncrementSetting(container->get_transform(), "Change movement multipler", 1, 0.1, getConfig().config["MoveMultiplier"].GetFloat(), 0, 100, MoveMultiplierChange);
138138
QuestUI::BeatSaberUI::AddHoverHint(MoveMultiplierObject->get_gameObject(), "If you hold the Y button while moving your head, you can adjust the camera position while playing. This multiplier decides how fast you move the camera.");
139139

140+
/*
141+
Enable later once replay is out
140142
// DisableWhileReplay
141143
auto DisableWhileReplayPress = il2cpp_utils::MakeDelegate<UnityEngine::Events::UnityAction_1<bool>*>(
142144
classof(UnityEngine::Events::UnityAction_1<bool>*), this, SetDisableWhileReplay);
143145
UnityEngine::UI::Toggle* DisableWhileReplayObject = QuestUI::BeatSaberUI::CreateToggle(container->get_transform(), "Disable while viewing Replays", getConfig().config["DisableWhileReplay"].GetBool(), DisableWhileReplayPress);
144146
QuestUI::BeatSaberUI::AddHoverHint(DisableWhileReplayObject->get_gameObject(), "While viewing a replay, the Replay mod has it's own camera control system! Enabling this setting will result in Third person mod being disabled while you view a replay.");
147+
*/
145148

146149
// X
147150
auto XChange = il2cpp_utils::MakeDelegate<UnityEngine::Events::UnityAction_1<float>*>(

src/main.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ bool replay = false;
7373
MAKE_HOOK_OFFSETLESS(LightManager_OnWillRenderObject, void, LightManager* self, UnityEngine::Camera* camera) {
7474
// Do stuff when this function is called
7575
LightManager_OnWillRenderObject(self, camera);
76-
if(!(getConfig().config["Active"].GetBool()) || replay) return;
76+
//if(!(getConfig().config["Active"].GetBool()) || replay) return;
77+
if(!(getConfig().config["Active"].GetBool())) return;
7778
UnityEngine::Camera* c = UnityEngine::Camera::get_main();
7879
UnityEngine::Vector3 rot = c->get_transform()->get_eulerAngles();
7980
UnityEngine::Vector3 pos = c->get_transform()->get_position();
@@ -276,7 +277,7 @@ extern "C" void load() {
276277
INSTALL_HOOK_OFFSETLESS(logger, LightManager_OnWillRenderObject, il2cpp_utils::FindMethodUnsafe("", "LightManager", "OnWillRenderObject", 0));
277278
//INSTALL_HOOK_OFFSETLESS(logger, VRController_Update, il2cpp_utils::FindMethodUnsafe("", "VRController", "Update", 0));
278279
INSTALL_HOOK_OFFSETLESS(logger, SceneManager_ActiveSceneChanged, il2cpp_utils::FindMethodUnsafe("UnityEngine.SceneManagement", "SceneManager", "Internal_ActiveSceneChanged", 2));
279-
INSTALL_HOOK_OFFSETLESS(logger, AudioTimeSyncController_Start, il2cpp_utils::FindMethodUnsafe("", "AudioTimeSyncController", "Start", 0));
280+
//INSTALL_HOOK_OFFSETLESS(logger, AudioTimeSyncController_Start, il2cpp_utils::FindMethodUnsafe("", "AudioTimeSyncController", "Start", 0));
280281

281282
getLogger().info("Installed all hooks!");
282-
}
283+
}

0 commit comments

Comments
 (0)