diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..be428ef --- /dev/null +++ b/.gitignore @@ -0,0 +1,344 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- Backup*.rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# VS Makefile Logs +ARM/ +ARM64/ \ No newline at end of file diff --git a/MultiQuestensions.sln b/MultiQuestensions.sln new file mode 100644 index 0000000..54919dd --- /dev/null +++ b/MultiQuestensions.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30621.155 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MultiQuestensions", "MultiQuestensions\MultiQuestensions.vcxproj", "{1C603531-CD52-4BE0-A840-BA695BB7E0C7}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|arm64-v8a = Debug|arm64-v8a + Release|arm64-v8a = Release|arm64-v8a + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1C603531-CD52-4BE0-A840-BA695BB7E0C7}.Debug|arm64-v8a.ActiveCfg = Debug|ARM64 + {1C603531-CD52-4BE0-A840-BA695BB7E0C7}.Debug|arm64-v8a.Build.0 = Debug|ARM64 + {1C603531-CD52-4BE0-A840-BA695BB7E0C7}.Release|arm64-v8a.ActiveCfg = Release|ARM64 + {1C603531-CD52-4BE0-A840-BA695BB7E0C7}.Release|arm64-v8a.Build.0 = Release|ARM64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {502D074E-D134-43E3-96F1-66C962AC0872} + EndGlobalSection +EndGlobal diff --git a/MultiQuestensions/.gitignore b/MultiQuestensions/.gitignore new file mode 100644 index 0000000..b2198ff --- /dev/null +++ b/MultiQuestensions/.gitignore @@ -0,0 +1,55 @@ +# Prerequisites +*.d + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app +*.ps1 +*.bat + +# VSCode config stuff +!.vscode/c_cpp_properties.json +!.vscode/tasks.json + +# VS stuff +ARM64/ +ARM/ +*.vcxproj.user + +# NDK stuff +out/ +[Ll]ib/ +[Ll]ibs/ +[Oo]bj/ +[Oo]bjs/ +*.zip +*.txt +extern/ +Android.mk.backup +qpm.shared.json diff --git a/MultiQuestensions/.vscode/c_cpp_properties.json b/MultiQuestensions/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..0c97583 --- /dev/null +++ b/MultiQuestensions/.vscode/c_cpp_properties.json @@ -0,0 +1,24 @@ +{ + "configurations": [ + { + "defines": [ + "VERSION=\"0.1.0\"", + "__GNUC__", + "__aarch64__" + ], + "includePath": [ + "${workspaceFolder}/**", + "${workspaceFolder}/shared", + "${workspaceFolder}/include", + "${workspaceFolder}/extern/**", + "${workspaceFolder}/extern/libil2cpp/il2cpp/libil2cpp", + "#{ndkpath}/**" + ], + "name": "Quest", + "cStandard": "c11", + "cppStandard": "c++20", + "intelliSenseMode": "clang-x64" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/MultiQuestensions/.vscode/settings.json b/MultiQuestensions/.vscode/settings.json new file mode 100644 index 0000000..ce816bc --- /dev/null +++ b/MultiQuestensions/.vscode/settings.json @@ -0,0 +1,117 @@ +{ + "files.associations": { + "iosfwd": "cpp", + "__config": "cpp", + "__nullptr": "cpp", + "thread": "cpp", + "any": "cpp", + "deque": "cpp", + "list": "cpp", + "map": "cpp", + "optional": "cpp", + "queue": "cpp", + "set": "cpp", + "stack": "cpp", + "unordered_map": "cpp", + "unordered_set": "cpp", + "variant": "cpp", + "vector": "cpp", + "__bit_reference": "cpp", + "__debug": "cpp", + "__errc": "cpp", + "__functional_base": "cpp", + "__hash_table": "cpp", + "__locale": "cpp", + "__mutex_base": "cpp", + "__node_handle": "cpp", + "__split_buffer": "cpp", + "__string": "cpp", + "__threading_support": "cpp", + "__tree": "cpp", + "__tuple": "cpp", + "algorithm": "cpp", + "array": "cpp", + "atomic": "cpp", + "bit": "cpp", + "bitset": "cpp", + "cctype": "cpp", + "cfenv": "cpp", + "charconv": "cpp", + "chrono": "cpp", + "cinttypes": "cpp", + "clocale": "cpp", + "cmath": "cpp", + "codecvt": "cpp", + "compare": "cpp", + "complex": "cpp", + "condition_variable": "cpp", + "csetjmp": "cpp", + "csignal": "cpp", + "cstdarg": "cpp", + "cstddef": "cpp", + "cstdint": "cpp", + "cstdio": "cpp", + "cstdlib": "cpp", + "cstring": "cpp", + "ctime": "cpp", + "cwchar": "cpp", + "cwctype": "cpp", + "exception": "cpp", + "coroutine": "cpp", + "propagate_const": "cpp", + "forward_list": "cpp", + "fstream": "cpp", + "functional": "cpp", + "future": "cpp", + "initializer_list": "cpp", + "iomanip": "cpp", + "ios": "cpp", + "iostream": "cpp", + "istream": "cpp", + "iterator": "cpp", + "limits": "cpp", + "locale": "cpp", + "memory": "cpp", + "mutex": "cpp", + "new": "cpp", + "numeric": "cpp", + "ostream": "cpp", + "random": "cpp", + "ratio": "cpp", + "regex": "cpp", + "scoped_allocator": "cpp", + "span": "cpp", + "sstream": "cpp", + "stdexcept": "cpp", + "streambuf": "cpp", + "string": "cpp", + "string_view": "cpp", + "strstream": "cpp", + "system_error": "cpp", + "tuple": "cpp", + "type_traits": "cpp", + "typeindex": "cpp", + "typeinfo": "cpp", + "utility": "cpp", + "valarray": "cpp", + "xstring": "cpp", + "xlocale": "cpp", + "xlocbuf": "cpp", + "concepts": "cpp", + "filesystem": "cpp", + "shared_mutex": "cpp", + "xfacet": "cpp", + "xhash": "cpp", + "xiosbase": "cpp", + "xlocinfo": "cpp", + "xlocmes": "cpp", + "xlocmon": "cpp", + "xlocnum": "cpp", + "xloctime": "cpp", + "xmemory": "cpp", + "xstddef": "cpp", + "xtr1common": "cpp", + "xtree": "cpp", + "xutility": "cpp" + } +} \ No newline at end of file diff --git a/MultiQuestensions/.vscode/tasks.json b/MultiQuestensions/.vscode/tasks.json new file mode 100644 index 0000000..d2bde51 --- /dev/null +++ b/MultiQuestensions/.vscode/tasks.json @@ -0,0 +1,68 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "NDK Build", + "detail": "Builds the library using ndk-build.cmd", + "type": "shell", + "command": "ndk-build", + "windows": { + "command": "ndk-build.cmd" + }, + "args": ["NDK_PROJECT_PATH=.", "APP_BUILD_SCRIPT=./Android.mk", "NDK_APPLICATION_MK=./Application.mk"], + "group": "build", + "options": { + "env": {} + } + }, + { + "label": "Powershell Build", + "detail": "Builds the library using Powershell (recommended)", + "type": "shell", + "command": "./build.ps1", + "windows": { + "command": "./build.ps1" + }, + "group": { + "kind": "build", + "isDefault": true + }, + "options": { + "env": {} + } + }, + { + "label": "Powershell Build and Copy", + "detail": "Builds and copies the library to the Quest using adb and force-quits Beat Saber", + "type": "shell", + "command": "./copy.ps1", + "windows": { + "command": "./copy.ps1" + }, + "group": "build", + "options": { + "env": {} + } + }, + { + "label": "BMBF Build", + "detail": "Builds a .zip to be uploaded into BMBF", + "type": "shell", + "command": "./buildBMBF.ps1", + "windows": { + "command": "./buildBMBF.ps1" + }, + "args": [], + "group": "build", + "options": { + "env": {} + } + }, + { + "label": "Start logging", + "detail": "Records a log to log.txt using adb logcat", + "type": "shell", + "command": "./startlogging.bat" + } + ] +} diff --git a/MultiQuestensions/Android.mk b/MultiQuestensions/Android.mk new file mode 100644 index 0000000..39742c1 --- /dev/null +++ b/MultiQuestensions/Android.mk @@ -0,0 +1,48 @@ +#Copyright (C) 2009 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +LOCAL_PATH := $(call my-dir) +TARGET_ARCH_ABI := $(APP_ABI) + +rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2)) + +# Build the modloader shared library +include $(CLEAR_VARS) +# Creating prebuilt for dependency: modloader - version: 1.0.4 +include $(CLEAR_VARS) +LOCAL_MODULE := modloader +LOCAL_EXPORT_C_INCLUDES := extern/modloader +LOCAL_SRC_FILES := extern/libmodloader.so +include $(PREBUILT_SHARED_LIBRARY) +# Creating prebuilt for dependency: beatsaber-hook - version: 0.8.4 +include $(CLEAR_VARS) +LOCAL_MODULE := beatsaber-hook_0_8_4 +LOCAL_EXPORT_C_INCLUDES := extern/beatsaber-hook +LOCAL_SRC_FILES := extern/libbeatsaber-hook_0_8_4.so +LOCAL_CPP_FEATURES += exceptions +include $(PREBUILT_SHARED_LIBRARY) + +include $(CLEAR_VARS) +LOCAL_MODULE := multiquestensions +LOCAL_SRC_FILES += $(call rwildcard,src/,*.cpp) +LOCAL_SRC_FILES += $(call rwildcard,extern/beatsaber-hook/src/inline-hook,*.cpp) +LOCAL_SRC_FILES += $(call rwildcard,extern/beatsaber-hook/src/inline-hook,*.c) +LOCAL_SHARED_LIBRARIES += modloader +LOCAL_SHARED_LIBRARIES += beatsaber-hook_0_8_4 +LOCAL_LDLIBS += -llog +LOCAL_CFLAGS += -I'extern/libil2cpp/il2cpp/libil2cpp' -DID='"multiquestensions"' -DVERSION='"0.1.0"' -I'./shared' -I'./extern' -isystem'extern/codegen/include' +LOCAL_CPPFLAGS += -std=c++2a +LOCAL_C_INCLUDES += ./include ./src +include $(BUILD_SHARED_LIBRARY) diff --git a/MultiQuestensions/Application.mk b/MultiQuestensions/Application.mk new file mode 100644 index 0000000..e7e447f --- /dev/null +++ b/MultiQuestensions/Application.mk @@ -0,0 +1,5 @@ +APP_ABI := arm64-v8a +APP_PLATFORM := 25 +APP_PIE:= true +APP_STL := c++_static +APP_CPPFLAGS := -std=gnu++2a diff --git a/MultiQuestensions/LICENSE.md b/MultiQuestensions/LICENSE.md new file mode 100644 index 0000000..d78b647 --- /dev/null +++ b/MultiQuestensions/LICENSE.md @@ -0,0 +1,22 @@ + +The MIT License (MIT) + +Copyright (c) 2020 Goobwabber + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/MultiQuestensions/MultiQuestensions.vcxproj b/MultiQuestensions/MultiQuestensions.vcxproj new file mode 100644 index 0000000..e1d45ef --- /dev/null +++ b/MultiQuestensions/MultiQuestensions.vcxproj @@ -0,0 +1,74 @@ + + + + + Debug + ARM64 + + + Release + ARM64 + + + + + + + + + + + + + + + + + + + + {1c603531-cd52-4be0-a840-ba695bb7e0c7} + Android + 14.0 + Android + 3.0 + + + + Makefile + true + Clang_5_0 + + + Makefile + false + Clang_5_0 + + + + + + + + + + src;include;extern;extern\libil2cpp\il2cpp\libil2cpp + ID='"Mod ID"';VERSION='"Mod Version"' + "$(NdkPath)\build\ndk-build.cmd" NDK_PROJECT_PATH=$(ProjectDir) APP_BUILD_SCRIPT=$(ProjectDir)Android.mk NDK_APPLICATION_MK=$(ProjectDir)Application.mk + "$(NdkPath)\build\ndk-build.cmd" -B + "$(NdkPath)\build\ndk-build.cmd" clean + + + src;include;extern;extern\libil2cpp\il2cpp\libil2cpp + ID='"Mod ID"';VERSION='"Mod Version"' + "$(NdkPath)\build\ndk-build.cmd" NDK_PROJECT_PATH=$(ProjectDir) APP_BUILD_SCRIPT=$(ProjectDir)Android.mk NDK_APPLICATION_MK=$(ProjectDir)Application.mk + "$(NdkPath)\build\ndk-build.cmd" -B + "$(NdkPath)\build\ndk-build.cmd" clean + + + + + + + + \ No newline at end of file diff --git a/MultiQuestensions/MultiQuestensions.vcxproj.filters b/MultiQuestensions/MultiQuestensions.vcxproj.filters new file mode 100644 index 0000000..6ab7764 --- /dev/null +++ b/MultiQuestensions/MultiQuestensions.vcxproj.filters @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + {26aa2093-dfac-466e-b80f-f369a2dd2bea} + + + {8fdd278c-c854-40e0-a614-f3d62ad57a72} + + + + + src + + + + + include + + + \ No newline at end of file diff --git a/MultiQuestensions/bmbfmod.json b/MultiQuestensions/bmbfmod.json new file mode 100644 index 0000000..a217f92 --- /dev/null +++ b/MultiQuestensions/bmbfmod.json @@ -0,0 +1,29 @@ +{ + "id": "multiquestensions", + "name": "MultiQuestensions", + "version": "0.1.0", + "author": "Goobie", + "description": [ + "Lightweight port of MultiplayerExtensions, the PC mod that adds features to official Multiplayer." + ], + "category": "Gameplay", + "gameVersion": "1.13.0", + "platform": "Quest", + "components": [ + { + "type": "HookMod", + "installAction": { + "installLibraryFile": "libmultiquestensions.so" + }, + "uninstallAction": { + "removeLibraryFile": "libmultiquestensions.so" + } + }, + { + "type": "HookModLibrary", + "installAction": { + "installLibraryFile": "libbeatsaber-hook_0_8_4.so" + } + } + ] +} diff --git a/MultiQuestensions/include/main.hpp b/MultiQuestensions/include/main.hpp new file mode 100644 index 0000000..db7ebec --- /dev/null +++ b/MultiQuestensions/include/main.hpp @@ -0,0 +1,14 @@ +#pragma once + +// Include the modloader header, which allows us to tell the modloader which mod this is, and the version etc. +#include "modloader/shared/modloader.hpp" + +// beatsaber-hook is a modding framework that lets us call functions and fetch field values from in the game +// It also allows creating objects, configuration, and importantly, hooking methods to modify their values +#include "beatsaber-hook/shared/utils/logging.hpp" +#include "beatsaber-hook/shared/config/config-utils.hpp" +#include "beatsaber-hook/shared/utils/il2cpp-functions.hpp" + +// Define these functions here so that we can easily read configuration and log information from other files +Configuration& getConfig(); +const Logger& getLogger(); \ No newline at end of file diff --git a/MultiQuestensions/qpm.json b/MultiQuestensions/qpm.json new file mode 100644 index 0000000..1cde5dd --- /dev/null +++ b/MultiQuestensions/qpm.json @@ -0,0 +1,23 @@ +{ + "sharedDir": "shared", + "dependenciesDir": "extern", + "info": { + "name": "MultiQuestensions", + "id": "multiquestensions", + "version": "0.1.0", + "url": "", + "additionalData": {} + }, + "dependencies": [ + { + "id": "beatsaber-hook", + "versionRange": "^0.8.4", + "additionalData": { + "extraFiles": [ + "src/inline-hook" + ] + } + } + ], + "additionalData": {} +} \ No newline at end of file diff --git a/MultiQuestensions/src/main.cpp b/MultiQuestensions/src/main.cpp new file mode 100644 index 0000000..ad2a96a --- /dev/null +++ b/MultiQuestensions/src/main.cpp @@ -0,0 +1,35 @@ +#include "main.hpp" + +static ModInfo modInfo; // Stores the ID and version of our mod, and is sent to the modloader upon startup + +// Loads the config from disk using our modInfo, then returns it for use +Configuration& getConfig() { + static Configuration config(modInfo); + config.Load(); + return config; +} + +// Returns a logger, useful for printing debug messages +const Logger& getLogger() { + static const Logger logger(modInfo); + return logger; +} + +// Called at the early stages of game loading +extern "C" void setup(ModInfo& info) { + info.id = ID; + info.version = VERSION; + modInfo = info; + + getConfig().Load(); // Load the config file + getLogger().info("Completed setup!"); +} + +// Called later on in the game loading - a good time to install function hooks +extern "C" void load() { + il2cpp_functions::Init(); + + getLogger().info("Installing hooks..."); + // Install our hooks (none defined yet) + getLogger().info("Installed all hooks!"); +} \ No newline at end of file diff --git a/README.md b/README.md index dfffdb2..8bdb21d 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,2 @@ -# #{name} - -#{description} - -## Credits - -* [zoller27osu](https://github.com/zoller27osu), [Sc2ad](https://github.com/Sc2ad) and [jakibaki](https://github.com/jakibaki) - [beatsaber-hook](https://github.com/sc2ad/beatsaber-hook) -* [raftario](https://github.com/raftario) -* [Lauriethefish](https://github.com/Lauriethefish) and [danrouse](https://github.com/danrouse) for [this template](https://github.com/Lauriethefish/quest-mod-template) \ No newline at end of file +# MultiQuestensions +There's nothing here. Go away. \ No newline at end of file