From bd7a098d00220d2152e2c6f5b5e525c58a6a09e1 Mon Sep 17 00:00:00 2001 From: Delta Date: Mon, 13 Mar 2023 07:10:01 -0700 Subject: [PATCH] Initial commit --- Properties/AssemblyInfo.cs | 35 ++++++++++++++++++ README.md | 10 ++++- ScalableWorldOrbs.cs | 31 ++++++++++++++++ ScalableWorldOrbs.csproj | 75 ++++++++++++++++++++++++++++++++++++++ ScalableWorldOrbs.sln | 25 +++++++++++++ packages.config | 4 ++ 6 files changed, 178 insertions(+), 2 deletions(-) create mode 100644 Properties/AssemblyInfo.cs create mode 100644 ScalableWorldOrbs.cs create mode 100644 ScalableWorldOrbs.csproj create mode 100644 ScalableWorldOrbs.sln create mode 100644 packages.config diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..10bf805 --- /dev/null +++ b/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("ScalableWorldOrbs")] +[assembly: AssemblyDescription("Makes World Orbs you spawn scalable by default")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("XDelta")] +[assembly: AssemblyProduct("ScalableWorldOrbs")] +[assembly: AssemblyCopyright("Copyright © XDelta 2023")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("914e6c38-0ac4-4de4-82b3-e0edea2f756a")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0")] +[assembly: AssemblyFileVersion("1.0.0")] diff --git a/README.md b/README.md index bccc7b2..222af86 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,8 @@ -# ScalableWorldOrbs -Makes World Orbs you spawn scalable by default +# ScalableWorldOrbs + +A [NeosModLoader](https://github.com/neos-modding-group/NeosModLoader) mod for [Neos VR](https://neos.com/). Makes World Orbs you spawn scalable by default. + +## Installation +1. Install [NeosModLoader](https://github.com/neos-modding-group/NeosModLoader). +1. Place [ScalableWorldOrbs.dll](https://github.com/XDelta/ScalableWorldOrbs/releases/latest/download/ScalableWorldOrbs.dll) into your `nml_mods` folder. This folder should be at `C:\Program Files (x86)\Steam\steamapps\common\NeosVR\nml_mods` for a default install. You can create it if it's missing, or if you launch the game once with NeosModLoader installed it will create the folder for you. +1. Start the game. If you want to verify that the mod is working you can check your Neos logs. \ No newline at end of file diff --git a/ScalableWorldOrbs.cs b/ScalableWorldOrbs.cs new file mode 100644 index 0000000..3492e6e --- /dev/null +++ b/ScalableWorldOrbs.cs @@ -0,0 +1,31 @@ +using FrooxEngine; +using HarmonyLib; +using NeosModLoader; + +namespace ScalableWorldOrbs { + public class ScalableWorldOrbs : NeosMod { + public override string Name => "ScalableWorldOrbs"; + public override string Author => "Delta"; + public override string Version => "1.0.0"; + public override string Link => "https://github.com/XDelta/ScalableWorldOrbs"; + + [AutoRegisterConfigKey] + private static readonly ModConfigurationKey modEnabled = new ModConfigurationKey("modEnabled", "Mod Enabled", () => true); + + private static ModConfiguration Config; + public override void OnEngineInit() { + Config = GetConfiguration(); + Config.Save(true); + Harmony harmony = new Harmony("net.deltawolf.ScalableWorldOrbs"); + harmony.PatchAll(); + } + + [HarmonyPatch(typeof(WorldOrb), "SetupOrb")] + class WorldOrb_SetupOrb_Patch { + public static void Postfix(WorldOrb __instance) { + if (!Config.GetValue(modEnabled)) { return; } + __instance.Slot.GetComponent().Scalable.Value = true; + } + } + } +} \ No newline at end of file diff --git a/ScalableWorldOrbs.csproj b/ScalableWorldOrbs.csproj new file mode 100644 index 0000000..14fc659 --- /dev/null +++ b/ScalableWorldOrbs.csproj @@ -0,0 +1,75 @@ + + + + + Debug + AnyCPU + Library + Properties + ScalableWorldOrbs + ScalableWorldOrbs + v4.7.2 + latestMajor + 512 + true + + {914E6C38-0AC4-4DE4-82B3-E0EDEA2F756A} + + + + + + C:\Program Files (x86)\Steam\steamapps\common\NeosVR\ + + C:\Neos\app\ + + $(HOME)/.steam/steam/steamapps/common/NeosVR/ + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + false + + + + + $(NeosPath)\nml_libs\0Harmony.dll + + + $(NeosPath)\Neos_Data\Managed\FrooxEngine.dll + + + $(NeosPath)\Libraries\NeosModLoader.dll + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ScalableWorldOrbs.sln b/ScalableWorldOrbs.sln new file mode 100644 index 0000000..a2c700c --- /dev/null +++ b/ScalableWorldOrbs.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.32228.343 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ScalableWorldOrbs", "ScalableWorldOrbs.csproj", "{914E6C38-0AC4-4DE4-82B3-E0EDEA2F756A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {914E6C38-0AC4-4DE4-82B3-E0EDEA2F756A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {914E6C38-0AC4-4DE4-82B3-E0EDEA2F756A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {914E6C38-0AC4-4DE4-82B3-E0EDEA2F756A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {914E6C38-0AC4-4DE4-82B3-E0EDEA2F756A}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {E1228749-6991-40A5-A534-22669CBDF5AD} + EndGlobalSection +EndGlobal diff --git a/packages.config b/packages.config new file mode 100644 index 0000000..6fa11be --- /dev/null +++ b/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file