Skip to content

Commit 77c8096

Browse files
committed
Update for 1.35
1 parent e3e87e9 commit 77c8096

18 files changed

+276
-238
lines changed

.vscode/c_cpp_properties.json

+18-17
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,35 @@
11
{
2+
"env": {
3+
"ndkPath": "${ANDROID_NDK_HOME}"
4+
},
25
"configurations": [
36
{
47
"defines": [
58
"MOD_ID=\"songchartvisualizer\"",
6-
"VERSION=\"1.0.0\"",
9+
"VERSION=\"0.1.0\"",
710
"__GNUC__",
811
"__aarch64__"
912
],
1013
"includePath": [
14+
"${ndkPath}/toolchains/llvm/prebuilt/*/sysroot/usr/include/aarch64-linux-android",
15+
"${ndkPath}/toolchains/llvm/prebuilt/*/sysroot/usr/include",
16+
"${ndkPath}/toolchains/llvm/prebuilt/*/sysroot/usr/include/*",
17+
"${ndkPath}/sources/cxx-stl/system/include",
18+
1119
"${workspaceFolder}/extern/includes/libil2cpp/il2cpp/libil2cpp",
12-
"${workspaceFolder}/extern/includes/codegen/include",
20+
"${workspaceFolder}/extern/includes/fmt/fmt/include",
21+
"${workspaceFolder}/extern/includes/bs-cordl/include",
1322
"${workspaceFolder}/extern/includes",
14-
"${workspaceFolder}/include",
15-
"${workspaceFolder}/shared",
16-
"${workspaceFolder}",
17-
"${ndkPath}/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/aarch64-linux-android",
18-
"${ndkPath}/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include",
19-
"${ndkPath}/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/*",
20-
"${ndkPath}/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/*/*",
21-
"${ndkPath}/sources/cxx-stl/llvm-libc++abi/include",
22-
"${ndkPath}/sources/cxx-stl/llvm-libc++/include",
23-
"${ndkPath}/"
23+
"${workspaceFolder}/include"
2424
],
25+
"compilerPath": "${ndkPath}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang",
2526
"name": "Quest",
26-
"cStandard": "c11",
2727
"cppStandard": "c++20",
28-
"intelliSenseMode": "clang-x64",
29-
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
30-
"compilerPath": "C:/android-ndk-r25c/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe",
31-
"configurationProvider": "ms-vscode.cmake-tools"
28+
"intelliSenseMode": "linux-clang-x64",
29+
"compilerArgs": [
30+
"-fdeclspec",
31+
"-fms-extensions"
32+
]
3233
}
3334
],
3435
"version": 4

.vscode/settings.json

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"files.associations": {
3+
"*.bsml": "xml",
34
"iosfwd": "cpp",
45
"__config": "cpp",
56
"__nullptr": "cpp",
@@ -112,7 +113,14 @@
112113
"xstddef": "cpp",
113114
"xtr1common": "cpp",
114115
"xtree": "cpp",
115-
"xutility": "cpp"
116+
"xutility": "cpp",
117+
"*.tcc": "cpp",
118+
"__verbose_abort": "cpp",
119+
"numbers": "cpp",
120+
"semaphore": "cpp",
121+
"memory_resource": "cpp",
122+
"ranges": "cpp",
123+
"stop_token": "cpp"
116124
},
117125
"cmake.configureOnOpen": true
118126
}

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ set(SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
2626
set(INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
2727

2828
# compile options used
29-
add_compile_options(-frtti -fexceptions)
29+
add_compile_options(-frtti -fexceptions -fdeclspec -fvisibility=hidden)
3030
add_compile_options(-O3)
3131
# compile definitions used
3232
add_compile_definitions(VERSION=\"${MOD_VERSION}\")

assets_include.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ struct IncludedAsset {
2525
}
2626
2727
operator std::string_view() const {
28-
return { reinterpret_cast<char*>(array->values), array->Length() };
28+
return { reinterpret_cast<char*>(array->_values), array->get_Length() };
2929
}
3030
3131
operator std::span<uint8_t>() const {
32-
return { array->values, array->Length() };
32+
return { array->_values, array->get_Length() };
3333
}
3434
3535
void init() const {

include/Installers/GameInstaller.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
DECLARE_CLASS_CODEGEN(SongChartVisualizer::Installers, GameInstaller, Zenject::Installer,
1111

12-
DECLARE_PRIVATE_FIELD(GlobalNamespace::GameplayCoreSceneSetupData*, _gameplayCoreSceneSetupData);
12+
DECLARE_INSTANCE_FIELD_PRIVATE(GlobalNamespace::GameplayCoreSceneSetupData*, _gameplayCoreSceneSetupData);
1313

14-
DECLARE_OVERRIDE_METHOD(void, InstallBindings, il2cpp_utils::il2cpp_type_check::MetadataGetter<&Zenject::Installer::InstallBindings>::get());
14+
DECLARE_OVERRIDE_METHOD_MATCH(void, InstallBindings, &Zenject::Installer::InstallBindings);
1515

1616
DECLARE_CTOR(ctor, GlobalNamespace::GameplayCoreSceneSetupData* gameplayCoreSceneSetupData);
1717
)

include/Models/NpsInfo.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ struct NpsInfo {
33
float FromTime;
44
float ToTime;
55

6+
NpsInfo();
7+
68
NpsInfo(float nps, float fromTime, float toTime)
79
{
810
Nps = nps;

include/Services/SvcAssetLoader.hpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#include "UnityEngine/Material.hpp"
22
#include "UnityEngine/Sprite.hpp"
33

4-
UnityEngine::Material* get_noGlowMaterial();
5-
UnityEngine::Sprite* get_circleSprite();
4+
UnityW<UnityEngine::Material> get_NoGlowMaterial();
5+
static __declspec(property(get=get_noGlowMaterial)) UnityW<UnityEngine::Material> NoGlowMaterial;
6+
7+
UnityW<UnityEngine::Sprite> get_CircleSprite();
8+
static __declspec(property(get=get_CircleSprite)) UnityW<UnityEngine::Sprite> CircleSprite;;

include/UI/ChartView.hpp

+19-18
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#include "Core/WindowGraph.hpp"
44
#include "Models/NpsInfo.hpp"
5+
#include "System/Object.hpp"
56

67
#include "custom-types/shared/macros.hpp"
78
#include "lapiz/shared/macros.hpp"
@@ -21,24 +22,24 @@
2122
#include "Zenject/IInitializable.hpp"
2223
#include "Zenject/ITickable.hpp"
2324

24-
#define INTERFACES { classof(Zenject::IInitializable*), classof(Zenject::ITickable*) }
25+
#define INTERFACES { classof(Zenject::IInitializable*) }
2526

26-
___DECLARE_TYPE_WRAPPER_INHERITANCE(SongChartVisualizer, ChartView, Il2CppTypeEnum::IL2CPP_TYPE_CLASS, Il2CppObject, "SongChartVisualizer", INTERFACES, 0, nullptr,
27+
DECLARE_CLASS_CODEGEN_INTERFACES_DLL(SongChartVisualizer, ChartView, System::Object, INTERFACES, "SongChartVisualizer",
2728

28-
DECLARE_PRIVATE_FIELD(GlobalNamespace::AudioTimeSyncController*, _audioTimeSyncController);
29-
DECLARE_PRIVATE_FIELD(GlobalNamespace::IReadonlyBeatmapData*, _beatmapData);
30-
DECLARE_PRIVATE_FIELD(GlobalNamespace::ComboUIController*, _comboUIController);
31-
DECLARE_PRIVATE_FIELD(Tweening::TimeTweeningManager*, _timeTweeningManager);
32-
DECLARE_PRIVATE_FIELD(SongChartVisualizer::WindowGraph*, _windowGraph);
33-
DECLARE_PRIVATE_FIELD(BSML::FloatingScreen*, _floatingScreen);
34-
DECLARE_PRIVATE_FIELD(bool, _shouldNotRunTick);
35-
DECLARE_PRIVATE_FIELD(UnityEngine::GameObject*, _selfCursor);
36-
DECLARE_PRIVATE_FIELD(UnityEngine::GameObject*, _peakWarningGo);
37-
DECLARE_PRIVATE_FIELD(HMUI::CurvedTextMeshPro*, _peakWarningText);
38-
39-
DECLARE_PRIVATE_FIELD(int, _currentSectionIdx);
40-
DECLARE_PRIVATE_FIELD(int, _hardestSectionIdx);
41-
DECLARE_PRIVATE_FIELD(float, _timeTillPeak);
29+
DECLARE_INSTANCE_FIELD_PRIVATE(GlobalNamespace::AudioTimeSyncController*, _audioTimeSyncController);
30+
DECLARE_INSTANCE_FIELD_PRIVATE(GlobalNamespace::IReadonlyBeatmapData*, _beatmapData);
31+
DECLARE_INSTANCE_FIELD_PRIVATE(GlobalNamespace::ComboUIController*, _comboUIController);
32+
DECLARE_INSTANCE_FIELD_PRIVATE(Tweening::TimeTweeningManager*, _timeTweeningManager);
33+
DECLARE_INSTANCE_FIELD_PRIVATE(SongChartVisualizer::WindowGraph*, _windowGraph);
34+
DECLARE_INSTANCE_FIELD_PRIVATE(BSML::FloatingScreen*, _floatingScreen);
35+
DECLARE_INSTANCE_FIELD_PRIVATE(bool, _shouldNotRunTick);
36+
DECLARE_INSTANCE_FIELD_PRIVATE(UnityEngine::GameObject*, _selfCursor);
37+
DECLARE_INSTANCE_FIELD_PRIVATE(UnityEngine::GameObject*, _peakWarningGo);
38+
DECLARE_INSTANCE_FIELD_PRIVATE(HMUI::CurvedTextMeshPro*, _peakWarningText);
39+
40+
DECLARE_INSTANCE_FIELD_PRIVATE(int, _currentSectionIdx);
41+
DECLARE_INSTANCE_FIELD_PRIVATE(int, _hardestSectionIdx);
42+
DECLARE_INSTANCE_FIELD_PRIVATE(float, _timeTillPeak);
4243

4344
DECLARE_INSTANCE_METHOD(UnityEngine::GameObject*, CreateSelfCursor, UnityEngine::Color color);
4445
DECLARE_INSTANCE_METHOD(void, PrepareWarningText);
@@ -47,8 +48,8 @@ ___DECLARE_TYPE_WRAPPER_INHERITANCE(SongChartVisualizer, ChartView, Il2CppTypeEn
4748

4849
std::vector<NpsInfo> GetNpsSections(GlobalNamespace::IReadonlyBeatmapData* beatmapData);
4950

50-
DECLARE_OVERRIDE_METHOD(void, Initialize, il2cpp_utils::il2cpp_type_check::MetadataGetter<&::Zenject::IInitializable::Initialize>::get());
51-
DECLARE_OVERRIDE_METHOD(void, Tick, il2cpp_utils::il2cpp_type_check::MetadataGetter<&::Zenject::ITickable::Tick>::get());
51+
DECLARE_OVERRIDE_METHOD_MATCH(void, Initialize, &Zenject::IInitializable::Initialize);
52+
DECLARE_OVERRIDE_METHOD_MATCH(void, Tick, &Zenject::ITickable::Tick);
5253

5354
DECLARE_CTOR(ctor, GlobalNamespace::AudioTimeSyncController* audioTimeSyncController, GlobalNamespace::IReadonlyBeatmapData* readonlyBeatmapData, Tweening::TimeTweeningManager* timeTweeningManager);
5455

include/UI/SettingsViewcontroller.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
DECLARE_CLASS_CODEGEN(SongChartVisualizer, SettingsViewController, HMUI::ViewController,
1414

15-
DECLARE_OVERRIDE_METHOD(void, DidActivate, il2cpp_utils::il2cpp_type_check::MetadataGetter<&HMUI::ViewController::DidActivate>::get(), bool firstActivation, bool addedToHierarchy, bool screenSystemEnabling);
15+
DECLARE_OVERRIDE_METHOD_MATCH(void, DidActivate, &HMUI::ViewController::DidActivate, bool firstActivation, bool addedToHierarchy, bool screenSystemEnabling);
1616

1717
DECLARE_VECTOR_INCREMENT(standardPos);
1818
DECLARE_VECTOR_INCREMENT(standardRot);

include/main.hpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
#pragma once
22

33
// Include the modloader header, which allows us to tell the modloader which mod this is, and the version etc.
4-
#include "modloader/shared/modloader.hpp"
4+
#include "scotland2/shared/modloader.h"
55

66
// beatsaber-hook is a modding framework that lets us call functions and fetch field values from in the game
77
// It also allows creating objects, configuration, and importantly, hooking methods to modify their values
88
#include "beatsaber-hook/shared/utils/logging.hpp"
9-
#include "beatsaber-hook/shared/config/config-utils.hpp"
109
#include "beatsaber-hook/shared/utils/il2cpp-functions.hpp"
1110
#include "beatsaber-hook/shared/utils/hooking.hpp"
1211

13-
// Define these functions here so that we can easily read configuration and log information from other files
14-
Logger& getLogger();
12+
static constexpr auto Logger = Paper::ConstLoggerContext("SongChartVisualizer");
13+
#define INFO(msg, ...) Logger.info(msg, ## __VA_ARGS__)
14+
#define DEBUG(msg, ...) Logger.debug(msg, ## __VA_ARGS__)
15+
16+
#define SCV_EXPORT extern "C" __attribute((visibility("default")))

mod.template.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"modloader": "QuestLoader",
1212
"description": "",
1313
"dependencies": [],
14-
"modFiles": [
14+
"lateModFiles": [
1515
"${binary}"
1616
],
1717
"libraryFiles": [],

qpm.json

+21-16
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"version": "0.1.0",
23
"sharedDir": "shared",
34
"dependenciesDir": "extern",
45
"info": {
@@ -11,47 +12,51 @@
1112
"cmake": true
1213
}
1314
},
15+
"workspace": {
16+
"scripts": {}
17+
},
1418
"dependencies": [
1519
{
1620
"id": "beatsaber-hook",
17-
"versionRange": "^3.14.0",
21+
"versionRange": "^5.1.0",
1822
"additionalData": {}
1923
},
2024
{
21-
"id": "modloader",
22-
"versionRange": "=1.2.3",
25+
"id": "bsml",
26+
"versionRange": "^0.4.21",
2327
"additionalData": {}
2428
},
2529
{
26-
"id": "codegen",
27-
"versionRange": "^0.33.0",
30+
"id": "config-utils",
31+
"versionRange": "^1.4.2",
2832
"additionalData": {}
2933
},
3034
{
3135
"id": "custom-types",
32-
"versionRange": "^0.15.24",
36+
"versionRange": "^0.17.6",
3337
"additionalData": {}
3438
},
3539
{
3640
"id": "lapiz",
37-
"versionRange": "^0.1.11",
41+
"versionRange": "^0.2.6",
3842
"additionalData": {}
3943
},
4044
{
41-
"id": "config-utils",
42-
"versionRange": "^1.0.2",
45+
"id": "bs-cordl",
46+
"versionRange": "^3500.0.0",
4347
"additionalData": {}
4448
},
4549
{
46-
"id": "bsml",
47-
"versionRange": "^0.3.2",
48-
"additionalData": {}
50+
"id": "scotland2",
51+
"versionRange": "^0.1.4",
52+
"additionalData": {
53+
"includeQmod": false
54+
}
4955
},
5056
{
51-
"id": "fmt",
52-
"versionRange": "^9.0.0",
57+
"id": "paper",
58+
"versionRange": "^3.6.3",
5359
"additionalData": {}
5460
}
55-
],
56-
"workspace": null
61+
]
5762
}

0 commit comments

Comments
 (0)