Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mod.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"author": "Raine",
"version": "${version}",
"packageId": "com.beatgames.beatsaber",
"packageVersion": "1.40.8_7379",
"packageVersion": "1.41.0_11623",
"description": "Lapiz makes modders' lives easier by exposing utilities to them cleanly. This mod does nothing on its own.",
"dependencies": [],
"modFiles": [
Expand Down
17 changes: 12 additions & 5 deletions qpm.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"$schema": "https://raw.githubusercontent.com/QuestPackageManager/QPM.Package/refs/heads/main/qpm.schema.json",
"version": "0.1.0",
"sharedDir": "shared",
"dependenciesDir": "extern",
"info": {
"name": "Lapiz",
"id": "lapiz",
"version": "0.2.20",
"version": "0.3.0",
"url": "https://github.com/raineio/Lapiz",
"additionalData": {
"overrideSoName": "liblapiz.so",
Expand All @@ -21,6 +22,7 @@
"qpm qmod zip"
]
},
"ndk": "^27.3.13750724",
"qmodIncludeDirs": [
"./build",
"./extern/libs"
Expand All @@ -31,7 +33,7 @@
"dependencies": [
{
"id": "beatsaber-hook",
"versionRange": "^6.4.1",
"versionRange": "^7.4.0",
"additionalData": {}
},
{
Expand All @@ -43,12 +45,12 @@
},
{
"id": "bs-cordl",
"versionRange": "^4008.0.0",
"versionRange": "^4100.0.0",
"additionalData": {}
},
{
"id": "custom-types",
"versionRange": "^0.18.2",
"versionRange": "^0.19.0",
"additionalData": {}
},
{
Expand All @@ -60,6 +62,11 @@
"id": "paper2_scotland2",
"versionRange": "^4.6.1",
"additionalData": {}
},
{
"id": "flamingo",
"versionRange": "^1.1.2",
"additionalData": {}
}
]
}
}
96 changes: 58 additions & 38 deletions qpm.shared.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"info": {
"name": "Lapiz",
"id": "lapiz",
"version": "0.2.20",
"version": "0.3.0",
"url": "https://github.com/raineio/Lapiz",
"additionalData": {
"overrideSoName": "liblapiz.so",
Expand All @@ -23,6 +23,7 @@
"qpm qmod zip"
]
},
"ndk": "^27.3.13750724",
"qmodIncludeDirs": [
"./build",
"./extern/libs"
Expand All @@ -33,7 +34,7 @@
"dependencies": [
{
"id": "beatsaber-hook",
"versionRange": "^6.4.1",
"versionRange": "^7.4.0",
"additionalData": {}
},
{
Expand All @@ -45,12 +46,12 @@
},
{
"id": "bs-cordl",
"versionRange": "^4008.0.0",
"versionRange": "^4100.0.0",
"additionalData": {}
},
{
"id": "custom-types",
"versionRange": "^0.18.2",
"versionRange": "^0.19.0",
"additionalData": {}
},
{
Expand All @@ -62,31 +63,25 @@
"id": "paper2_scotland2",
"versionRange": "^4.6.1",
"additionalData": {}
},
{
"id": "flamingo",
"versionRange": "^1.1.2",
"additionalData": {}
}
]
},
"restoredDependencies": [
{
"dependency": {
"id": "sombrero",
"versionRange": "=0.1.43",
"additionalData": {
"headersOnly": true,
"branchName": "version/v0_1_43"
}
},
"version": "0.1.43"
},
{
"dependency": {
"id": "custom-types",
"versionRange": "=0.18.3",
"versionRange": "=0.19.0",
"additionalData": {
"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",
"soLink": "https://github.com/QuestPackageManager/Il2CppQuestTypePatching/releases/download/v0.19.0/libcustom-types.so",
"debugSoLink": "https://github.com/QuestPackageManager/Il2CppQuestTypePatching/releases/download/v0.19.0/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",
"modLink": "https://github.com/QuestPackageManager/Il2CppQuestTypePatching/releases/download/v0.19.0/CustomTypes.qmod",
"branchName": "version/v0_19_0",
"compileOptions": {
"cppFlags": [
"-Wno-invalid-offsetof"
Expand All @@ -95,15 +90,26 @@
"cmake": true
}
},
"version": "0.18.3"
"version": "0.19.0"
},
{
"dependency": {
"id": "sombrero",
"versionRange": "=0.1.43",
"additionalData": {
"headersOnly": true,
"branchName": "version/v0_1_43"
}
},
"version": "0.1.43"
},
{
"dependency": {
"id": "bs-cordl",
"versionRange": "=4008.0.0",
"versionRange": "=4100.0.1",
"additionalData": {
"headersOnly": true,
"branchName": "version/v4008_0_0",
"branchName": "version/v4100_0_1",
"compileOptions": {
"includePaths": [
"include"
Expand All @@ -112,24 +118,24 @@
"cppFlags": [
"-DNEED_UNSAFE_CSHARP",
"-fdeclspec",
"-DUNITY_2021",
"-DUNITY_6",
"-DHAS_CODEGEN",
"-Wno-invalid-offsetof"
]
}
}
},
"version": "4008.0.0"
"version": "4100.0.1"
},
{
"dependency": {
"id": "paper2_scotland2",
"versionRange": "=4.6.4",
"versionRange": "=4.7.0",
"additionalData": {
"soLink": "https://github.com/Fernthedev/paperlog/releases/download/v4.6.4/libpaper2_scotland2.so",
"soLink": "https://github.com/Fernthedev/paperlog/releases/download/v4.7.0/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",
"modLink": "https://github.com/Fernthedev/paperlog/releases/download/v4.7.0/paper2_scotland2.qmod",
"branchName": "version/v4_7_0",
"compileOptions": {
"systemIncludes": [
"shared/utfcpp/source"
Expand All @@ -138,7 +144,7 @@
"cmake": false
}
},
"version": "4.6.4"
"version": "4.7.0"
},
{
"dependency": {
Expand All @@ -162,13 +168,13 @@
{
"dependency": {
"id": "beatsaber-hook",
"versionRange": "=6.4.2",
"versionRange": "=7.4.1",
"additionalData": {
"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",
"soLink": "https://github.com/QuestPackageManager/beatsaber-hook/releases/download/v7.4.1/libbeatsaber-hook.so",
"debugSoLink": "https://github.com/QuestPackageManager/beatsaber-hook/releases/download/v7.4.1/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",
"modLink": "https://github.com/QuestPackageManager/beatsaber-hook/releases/download/v7.4.1/beatsaber-hook.qmod",
"branchName": "version/v7_4_1",
"compileOptions": {
"cppFlags": [
"-Wno-extra-qualification"
Expand All @@ -177,7 +183,7 @@
"cmake": true
}
},
"version": "6.4.2"
"version": "7.4.1"
},
{
"dependency": {
Expand All @@ -192,10 +198,24 @@
},
"version": "0.1.6"
},
{
"dependency": {
"id": "flamingo",
"versionRange": "=1.1.2",
"additionalData": {
"soLink": "https://github.com/sc2ad/Flamingo/releases/download/v1.1.2/libflamingo.so",
"debugSoLink": "https://github.com/sc2ad/Flamingo/releases/download/v1.1.2/debug_libflamingo.so",
"overrideSoName": "libflamingo.so",
"modLink": "https://github.com/sc2ad/Flamingo/releases/download/v1.1.2/flamingo.qmod",
"branchName": "version/v1_1_2"
}
},
"version": "1.1.2"
},
{
"dependency": {
"id": "libil2cpp",
"versionRange": "=0.4.0",
"versionRange": "=0.5.0",
"additionalData": {
"headersOnly": true,
"compileOptions": {
Expand All @@ -206,7 +226,7 @@
}
}
},
"version": "0.4.0"
"version": "0.5.0"
}
]
}
4 changes: 2 additions & 2 deletions shared/zenject/Location.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "../_config.h"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"

#include "GlobalNamespace/QuestAppInit.hpp"
#include "GlobalNamespace/BeatSaberInit.hpp"
#include "GlobalNamespace/MainSettingsMenuViewControllersInstaller.hpp"
#include "GlobalNamespace/StandardGameplayInstaller.hpp"
#include "GlobalNamespace/MissionGameplayInstaller.hpp"
Expand Down Expand Up @@ -83,7 +83,7 @@ namespace Lapiz::Zenject {
std::unordered_set < Il2CppClass * > installerTypes;

if (HasFlag(location, Location::App))
installerTypes.emplace(classof(GlobalNamespace::QuestAppInit* ));
installerTypes.emplace(classof(GlobalNamespace::BeatSaberInit* ));
if (HasFlag(location, Location::Menu))
installerTypes.emplace(classof(GlobalNamespace::MainSettingsMenuViewControllersInstaller* ));
if (HasFlag(location, Location::StandardPlayer))
Expand Down
20 changes: 10 additions & 10 deletions src/Hooks/sabers/SaberBurnMarkArea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ static inline UnityEngine::Vector3 operator-(UnityEngine::Vector3 a, UnityEngine
return { a.x - b.x, a.y - b.y, a.z - b.z };
}

MAKE_AUTO_HOOK_MATCH(SaberBurnMarkArea_Start, &GlobalNamespace::SaberBurnMarkArea::Start, void, GlobalNamespace::SaberBurnMarkArea* self) {
/*MAKE_AUTO_HOOK_MATCH(SaberBurnMarkArea_Start, &GlobalNamespace::SaberBurnMarkArea::Start, void, GlobalNamespace::SaberBurnMarkArea* self) {
SaberBurnMarkArea_Start(self);
auto instance = Lapiz::Sabers::Effects::SaberBurnMarkAreaLatch::get_instance();
if (instance) {
Expand All @@ -45,20 +45,20 @@ MAKE_AUTO_HOOK_ORIG_MATCH(SaberBurnMarkArea_LateUpdate, &GlobalNamespace::SaberB
{
UnityEngine::Vector3 zero{0, 0, 0};
auto saber = self->_sabers[i];
auto lineRenderer = self->_lineRenderers[i];
auto lineRenderer = self->____lineRenderers[i];

bool flag = saber->isActiveAndEnabled && self->GetBurnMarkPos(saber->saberBladeBottomPos, saber->saberBladeTopPos, byref(zero));
if (flag && self->_prevBurnMarkPosValid[i]) {
UnityEngine::Vector3 vector = zero - self->_prevBurnMarkPos[i];
float magnitude = vector.magnitude;
float magnitude = vector.get_magnitude();
float num = 0.01f;
int num2 = (int)(magnitude / num);
int num3 = (num2 > 0) ? num2 : 1;
UnityEngine::Vector3 normalized = UnityEngine::Vector3(vector.z, 0.0f, -vector.x).normalized;
int num4 = 0;
while (num4 <= num3 && num4 < self->_linePoints.size()) {
UnityEngine::Vector3 vector2 = self->_prevBurnMarkPos[i] + vector * (float)num4 / (float)num3;
vector2 = vector2 + normalized * UnityEngine::Random::Range(-self->_blackMarkLineRandomOffset, self->_blackMarkLineRandomOffset);
vector2 = vector2 + normalized * UnityEngine::Random::Range(-self->____blackMarkLineRandomOffset, self->____blackMarkLineRandomOffset);
self->_linePoints[num4] = self->WorldToCameraBurnMarkPos(vector2);
num4++;
}
Expand Down Expand Up @@ -116,24 +116,24 @@ MAKE_AUTO_HOOK_MATCH(SaberBurnMarkArea_OnDisable, &GlobalNamespace::SaberBurnMar

// DOESN'T CALL ORIG ON PURPOSE
MAKE_AUTO_HOOK_ORIG_MATCH(SaberBurnMarkArea_OnDestroy, &GlobalNamespace::SaberBurnMarkArea::OnDestroy, void, GlobalNamespace::SaberBurnMarkArea* self) {
if (self->_camera && self->_camera->m_CachedPtr.m_value) {
if (self->____Cam && self->_camera->m_CachedPtr.m_value) {
UnityEngine::Object::Destroy(self->_camera->get_gameObject());
}
// destroy all line renderers as per DynamicDestroy
if (self->_lineRenderers) {
for (auto line : self->_lineRenderers) {
if (self->____lineRenderers) {
for (auto line : self->____lineRenderers) {
if (line && line->m_CachedPtr.m_value) {
UnityEngine::Object::Destroy(line);
}
}
}
GlobalNamespace::EssentialHelpers::SafeDestroy(self->_fadeOutMaterial);
if (self->_renderTextures) {
for (auto renderTexture : self->_renderTextures) {
if (self->____renderTextures) {
for (auto renderTexture : self->____renderTextures) {
if (renderTexture && renderTexture->m_CachedPtr.m_value) {
renderTexture->Release();
GlobalNamespace::EssentialHelpers::SafeDestroy(renderTexture);
}
}
}
}
}*/
2 changes: 1 addition & 1 deletion src/sabers/LapizSaber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace Lapiz::Sabers {
auto bottomPosition = bottomTransform->position;
_saber->_saberBladeBottomPos = bottomPosition;

auto time = GlobalNamespace::TimeHelper::get_time();
auto time = _saber->_timeHelper->get_Time();
_trailSaberMovementData->AddNewData(topPosition, bottomPosition, time);

if (_saber->enabled) {
Expand Down
2 changes: 1 addition & 1 deletion src/sabers/effects/SaberBurnMarkAreaLatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ namespace Lapiz::Sabers::Effects {

UnityEngine::LineRenderer* SaberBurnMarkAreaLatch::CreateNewLineRenderer(UnityEngine::Color initialColor) {
static auto identity = UnityEngine::Quaternion::get_identity();
auto newLine = UnityEngine::Object::Instantiate(_saberBurnMarkArea->_saberBurnMarkLinePrefab, {0, 0, 0}, identity, nullptr);
UnityW<UnityEngine::LineRenderer> newLine = UnityEngine::Object::Instantiate(_saberBurnMarkArea->_saberBurnMarkLinePrefab, {0, 0, 0}, identity, nullptr);
newLine->set_name(fmt::format("Lapiz | {}", newLine->get_name()));
newLine->set_startColor(initialColor);
newLine->set_endColor(initialColor);
Expand Down