Skip to content
Open
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 @@ -6,7 +6,7 @@
"author": "StackDoubleFlow, Fernthedev",
"version": "${version}",
"packageId": "com.beatgames.beatsaber",
"packageVersion": "1.40.7_7060",
"packageVersion": "1.40.8_7379",
"description": "Funny maps go brrr",
"dependencies": [],
"modFiles": [],
Expand Down
10 changes: 5 additions & 5 deletions qpm.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"info": {
"name": "CustomJSONData",
"id": "custom-json-data",
"version": "0.24.3",
"version": "0.24.4",
"url": "https://github.com/StackDoubleFlow/CustomJSONData",
"additionalData": {
"overrideSoName": "libcustom-json-data.so",
Expand Down Expand Up @@ -36,7 +36,7 @@
"pwsh ./scripts/ndk-stack.ps1"
]
},
"ndk": "^27.2.12479018",
"ndk": "^27.3.13750724",
"qmodIncludeDirs": [
"./build",
"./extern/libs"
Expand All @@ -52,19 +52,19 @@
},
{
"id": "bs-cordl",
"versionRange": "4007.*",
"versionRange": "4008.*",
"additionalData": {}
},
{
"id": "custom-types",
"versionRange": "^0.18.3",
"versionRange": "^0.18.4",
"additionalData": {
"includeQmod": true
}
},
{
"id": "songcore",
"versionRange": "^1.1.23",
"versionRange": "^1.1.25",
"additionalData": {
"includeQmod": true,
"private": true
Expand Down
130 changes: 65 additions & 65 deletions qpm.shared.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
{
"$schema": "https://raw.githubusercontent.com/QuestPackageManager/QPM.Package/refs/heads/main/qpm.shared.schema.json",
"config": {
"version": "0.4.0",
"sharedDir": "shared",
"dependenciesDir": "extern",
"info": {
"name": "CustomJSONData",
"id": "custom-json-data",
"version": "0.24.3",
"version": "0.24.4",
"url": "https://github.com/StackDoubleFlow/CustomJSONData",
"additionalData": {
"overrideSoName": "libcustom-json-data.so",
Expand Down Expand Up @@ -37,6 +36,7 @@
"pwsh ./scripts/ndk-stack.ps1"
]
},
"ndk": "^27.3.13750724",
"qmodIncludeDirs": [
"./build",
"./extern/libs"
Expand All @@ -52,7 +52,7 @@
},
{
"id": "bs-cordl",
"versionRange": "4007.*",
"versionRange": "4008.*",
"additionalData": {}
},
{
Expand All @@ -64,7 +64,7 @@
},
{
"id": "songcore",
"versionRange": "^1.1.23",
"versionRange": "^1.1.25",
"additionalData": {
"includeQmod": true,
"private": true
Expand Down Expand Up @@ -99,16 +99,51 @@
]
},
"restoredDependencies": [
{
"dependency": {
"id": "paper2_scotland2",
"versionRange": "=4.7.0",
"additionalData": {
"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.7.0/paper2_scotland2.qmod",
"branchName": "version/v4_7_0",
"compileOptions": {
"systemIncludes": [
"shared/utfcpp/source"
]
},
"cmake": false
}
},
"version": "4.7.0"
},
{
"dependency": {
"id": "libil2cpp",
"versionRange": "=0.4.0",
"additionalData": {
"headersOnly": true,
"compileOptions": {
"systemIncludes": [
"il2cpp/external/baselib/Include",
"il2cpp/external/baselib/Platforms/Android/Include"
]
}
}
},
"version": "0.4.0"
},
{
"dependency": {
"id": "custom-types",
"versionRange": "=0.18.3",
"versionRange": "=0.18.4",
"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.18.4/libcustom-types.so",
"debugSoLink": "https://github.com/QuestPackageManager/Il2CppQuestTypePatching/releases/download/v0.18.4/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.18.4/CustomTypes.qmod",
"branchName": "version/v0_18_4",
"compileOptions": {
"cppFlags": [
"-Wno-invalid-offsetof"
Expand All @@ -117,7 +152,7 @@
"cmake": true
}
},
"version": "0.18.3"
"version": "0.18.4"
},
{
"dependency": {
Expand All @@ -133,10 +168,10 @@
{
"dependency": {
"id": "bs-cordl",
"versionRange": "=4007.0.0",
"versionRange": "=4008.0.0",
"additionalData": {
"headersOnly": true,
"branchName": "version/v4007_0_0",
"branchName": "version/v4008_0_0",
"compileOptions": {
"includePaths": [
"include"
Expand All @@ -152,26 +187,7 @@
}
}
},
"version": "4007.0.0"
},
{
"dependency": {
"id": "paper2_scotland2",
"versionRange": "=4.6.4",
"additionalData": {
"soLink": "https://github.com/Fernthedev/paperlog/releases/download/v4.6.4/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",
"compileOptions": {
"systemIncludes": [
"shared/utfcpp/source"
]
},
"cmake": false
}
},
"version": "4.6.4"
"version": "4008.0.0"
},
{
"dependency": {
Expand All @@ -186,22 +202,18 @@
},
{
"dependency": {
"id": "fmt",
"versionRange": "=11.0.2",
"id": "songcore",
"versionRange": "=1.1.25",
"additionalData": {
"headersOnly": true,
"branchName": "version/v11_0_2",
"compileOptions": {
"systemIncludes": [
"fmt/include/"
],
"cppFlags": [
"-DFMT_HEADER_ONLY"
]
}
"soLink": "https://github.com/raineaeternal/Quest-SongCore/releases/download/v1.1.25/libsongcore.so",
"debugSoLink": "https://github.com/raineaeternal/Quest-SongCore/releases/download/v1.1.25/debug_libsongcore.so",
"overrideSoName": "libsongcore.so",
"modLink": "https://github.com/raineaeternal/Quest-SongCore/releases/download/v1.1.25/SongCore.qmod",
"branchName": "version/v1_1_25",
"cmake": true
}
},
"version": "11.0.2"
"version": "1.1.25"
},
{
"dependency": {
Expand All @@ -223,21 +235,6 @@
},
"version": "6.4.2"
},
{
"dependency": {
"id": "songcore",
"versionRange": "=1.1.23",
"additionalData": {
"soLink": "https://github.com/raineaeternal/Quest-SongCore/releases/download/v1.1.23/libsongcore.so",
"debugSoLink": "https://github.com/raineaeternal/Quest-SongCore/releases/download/v1.1.23/debug_libsongcore.so",
"overrideSoName": "libsongcore.so",
"modLink": "https://github.com/raineaeternal/Quest-SongCore/releases/download/v1.1.23/SongCore.qmod",
"branchName": "version/v1_1_23",
"cmake": true
}
},
"version": "1.1.23"
},
{
"dependency": {
"id": "scotland2",
Expand All @@ -253,19 +250,22 @@
},
{
"dependency": {
"id": "libil2cpp",
"versionRange": "=0.4.0",
"id": "fmt",
"versionRange": "=11.0.2",
"additionalData": {
"headersOnly": true,
"branchName": "version/v11_0_2",
"compileOptions": {
"systemIncludes": [
"il2cpp/external/baselib/Include",
"il2cpp/external/baselib/Platforms/Android/Include"
"fmt/include/"
],
"cppFlags": [
"-DFMT_HEADER_ONLY"
]
}
}
},
"version": "0.4.0"
"version": "11.0.2"
}
]
}
6 changes: 4 additions & 2 deletions shared/CustomBeatmapSaveDatav3.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ static inline auto const customData = "customData";
} // namespace CustomJSONData::v3::Constants

namespace CustomJSONData::v3 {
using CustomDataOpt = std::optional<std::reference_wrapper<rapidjson::Value const>>;
using CustomDataOptUTF16 = std::optional<std::reference_wrapper<SongCore::CustomJSONData::ValueUTF16 const>>;
using CustomData = rapidjson::Value const;
using CustomDataUTF16 = SongCore::CustomJSONData::ValueUTF16 const;
using CustomDataOpt = std::optional<std::reference_wrapper<CustomData>>;
using CustomDataOptUTF16 = std::optional<std::reference_wrapper<CustomDataUTF16>>;

} // namespace CustomJSONData::v3

Expand Down
5 changes: 3 additions & 2 deletions shared/CustomEventData.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once

#include "JSONWrapper.h"
#include "_config.hpp"

#include "custom-types/shared/macros.hpp"
Expand Down Expand Up @@ -30,14 +31,14 @@ DECLARE_CLASS_CODEGEN(CustomJSONData, CustomEventData, GlobalNamespace::BeatmapD
DECLARE_FASTER_CTOR(ctor, float time);

public:
static CustomEventData* New(float time, std::string_view type, size_t typeHash, rapidjson::Value const* data);
static CustomEventData* New(float time, std::string_view type, size_t typeHash, JSONWrapper* customData);

DECLARE_OVERRIDE_METHOD(CustomEventData*, GetCopy, il2cpp_utils::FindMethod("", "BeatmapDataItem", "GetCopy"));

public:
std::string_view type;
size_t typeHash;
rapidjson::Value const* data;
DECLARE_INSTANCE_FIELD(JSONWrapper*, customData);
};

DECLARE_CLASS_CODEGEN(CustomJSONData, CustomBeatmapDataCallbackWrapper, GlobalNamespace::BeatmapDataCallbackWrapper) {
Expand Down
12 changes: 7 additions & 5 deletions shared/JsonUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,16 @@ static OptPair ReadOptionalPair(rapidjson::Value const& object, std::string_view
auto itr = object.FindMember(key.data());

if (itr != object.MemberEnd() && itr->value.Size() >= 1) {
float x = itr->value[0].GetFloat();
float y = 0;
const auto& val = itr->value[0];
std::optional<float> x = val.IsNull() ? std::nullopt : std::optional{ val.GetFloat() };
std::optional<float> y = 0;

if (itr->value.Size() >= 2) {
y = itr->value[1].GetFloat();
return { std::optional<float>(x), std::optional<float>(y) };
const auto& val2 = itr->value[1];
y = val2.IsNull() ? std::nullopt : std::optional{ val2.GetFloat() };
return { x, y };
}
return { std::optional<float>(x), std::nullopt };
return { x, std::nullopt };
}
return { std::nullopt, std::nullopt };
}
Expand Down
11 changes: 11 additions & 0 deletions shared/misc/BeatmapFieldUtils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ static JSONWrapper* JSONWrapperOrNull(v3::CustomDataOpt const& val) {

return wrapper;
}
static JSONWrapper* JSONWrapperOrNull(v3::CustomData* val) {
auto* wrapper = JSONWrapper::New_ctor();

if (!val || !val->IsObject()) {
return wrapper;
}

wrapper->value = *val;

return wrapper;
}

static v3::CustomDataOptUTF16 JSONObjectOrNull(v3::CustomDataOptUTF16 const& val) {
if (!val || !val->get().IsObject()) {
Expand Down
Loading
Loading