From 317aa17aee6310df61de6ef327716a2342931e2a Mon Sep 17 00:00:00 2001 From: Arne Kiesewetter Date: Fri, 5 Dec 2025 18:00:28 +0100 Subject: [PATCH] Adjust contents for RML 4.2.0 --- .../ExecutionHook.cs | 61 +++++++++++-------- .../ModLoader.cs | 2 +- ...yLoader.GamePacks.ResoniteModLoader.csproj | 2 +- .../ResoniteMod.cs | 4 ++ .../Settings/ModLoaderSettings.cs | 16 +++++ .../Settings/ModSettings.cs | 18 ++++++ 6 files changed, 74 insertions(+), 29 deletions(-) create mode 100644 MonkeyLoader.GamePacks.ResoniteModLoader/Settings/ModLoaderSettings.cs create mode 100644 MonkeyLoader.GamePacks.ResoniteModLoader/Settings/ModSettings.cs diff --git a/MonkeyLoader.GamePacks.ResoniteModLoader/ExecutionHook.cs b/MonkeyLoader.GamePacks.ResoniteModLoader/ExecutionHook.cs index 98ce326..5cc0caf 100644 --- a/MonkeyLoader.GamePacks.ResoniteModLoader/ExecutionHook.cs +++ b/MonkeyLoader.GamePacks.ResoniteModLoader/ExecutionHook.cs @@ -1,6 +1,4 @@ using FrooxEngine; -using MonkeyLoader.Logging; -using MonkeyLoader.Meta; using System; using System.Collections.Generic; using System.Linq; @@ -10,43 +8,52 @@ namespace ResoniteModLoader { - // Why is this public + /// + /// Dummy execution hook class for compatibility. + /// + /// + /// Why is this public now? :C + /// public class ExecutionHook : IPlatformConnector { - #pragma warning disable CS1591 - public PlatformInterface Platform { get; private set; } + public PlatformInterface Platform { get; private set; } = null!; public int Priority => -10; public string PlatformName => "ResoniteModLoader"; - public string Username => null; - public string PlatformUserId => null; + public string Username => null!; + public string PlatformUserId => null!; public bool IsPlatformNameUnique => false; - public void SetCurrentStatus(World world, bool isPrivate, int totalWorldCount) { } - public void ClearCurrentStatus() { } - public void Update() { } + + public void SetCurrentStatus(World world, bool isPrivate, int totalWorldCount) + { } + + public void ClearCurrentStatus() + { } + + public void Update() + { } + public void Dispose() - { - GC.SuppressFinalize(this); - } - public void NotifyOfLocalUser(User user) { } - public void NotifyOfFile(string file, string name) { } - public void NotifyOfScreenshot(World world, string file, ScreenshotType type, DateTime time) { } + => GC.SuppressFinalize(this); - public async Task Initialize(PlatformInterface platformInterface) + public void NotifyOfLocalUser(User user) + { } + + public void NotifyOfFile(string file, string name) + { } + + public void NotifyOfScreenshot(World world, string file, ScreenshotType type, DateTime time) + { } + + public Task Initialize(PlatformInterface platformInterface) { ModLoader.Logger.Debug(() => "Initialize() from platformInterface"); Platform = platformInterface; - return true; + return Task.FromResult(true); } -#pragma warning restore CS1591 -#pragma warning disable CA2255 - [ModuleInitializer] + // [ModuleInitializer] public static void Init() - { - //ModLoader.Logger.Debug(() => "Init() from ModuleInitializer"); // throws for some reason - } -#pragma warning restore CA2255 - + { } } -} +} \ No newline at end of file diff --git a/MonkeyLoader.GamePacks.ResoniteModLoader/ModLoader.cs b/MonkeyLoader.GamePacks.ResoniteModLoader/ModLoader.cs index fc5c7a1..fe20514 100644 --- a/MonkeyLoader.GamePacks.ResoniteModLoader/ModLoader.cs +++ b/MonkeyLoader.GamePacks.ResoniteModLoader/ModLoader.cs @@ -30,7 +30,7 @@ public sealed class ModLoader : ResoniteMonkey /// public static readonly string VERSION = VERSION_CONSTANT; - internal const string VERSION_CONSTANT = "4.0.0"; + internal const string VERSION_CONSTANT = "4.2.0"; private static readonly Lazy _isHeadless = new(() => AppDomain.CurrentDomain.GetAssemblies() diff --git a/MonkeyLoader.GamePacks.ResoniteModLoader/MonkeyLoader.GamePacks.ResoniteModLoader.csproj b/MonkeyLoader.GamePacks.ResoniteModLoader/MonkeyLoader.GamePacks.ResoniteModLoader.csproj index 4aeff19..cffc1a6 100644 --- a/MonkeyLoader.GamePacks.ResoniteModLoader/MonkeyLoader.GamePacks.ResoniteModLoader.csproj +++ b/MonkeyLoader.GamePacks.ResoniteModLoader/MonkeyLoader.GamePacks.ResoniteModLoader.csproj @@ -11,7 +11,7 @@ MonkeyLoader.GamePacks.ResoniteModLoader ResoniteModLoader Banane9, Nytra - 4.0.0 + 4.2.0 This MonkeyLoader Game Pack for Resonite enables loading ResoniteModLoader mods as MonkeyLoader mods. README.md LGPL-3.0-or-later diff --git a/MonkeyLoader.GamePacks.ResoniteModLoader/ResoniteMod.cs b/MonkeyLoader.GamePacks.ResoniteModLoader/ResoniteMod.cs index c25f59d..85256f3 100644 --- a/MonkeyLoader.GamePacks.ResoniteModLoader/ResoniteMod.cs +++ b/MonkeyLoader.GamePacks.ResoniteModLoader/ResoniteMod.cs @@ -13,8 +13,12 @@ namespace ResoniteModLoader { /// + /// Base class for all mods.
/// Contains members that only the or the Mod itself are intended to access. ///
+ /// + /// Inherit from this class when creating a new mod. + /// public abstract class ResoniteMod : ResoniteModBase { private readonly Lazy _configuration; diff --git a/MonkeyLoader.GamePacks.ResoniteModLoader/Settings/ModLoaderSettings.cs b/MonkeyLoader.GamePacks.ResoniteModLoader/Settings/ModLoaderSettings.cs new file mode 100644 index 0000000..b74a584 --- /dev/null +++ b/MonkeyLoader.GamePacks.ResoniteModLoader/Settings/ModLoaderSettings.cs @@ -0,0 +1,16 @@ +/* +Not implemented because it involves creating FrooxEngine components +and the ML Resonite Integration already has a Settings Category anyways. + +using FrooxEngine; +using System; +using System.Collections.Generic; +using System.Text; + +namespace ResoniteModLoader +{ + public sealed class ModLoaderSettings : SettingComponent + { + } +} +*/ \ No newline at end of file diff --git a/MonkeyLoader.GamePacks.ResoniteModLoader/Settings/ModSettings.cs b/MonkeyLoader.GamePacks.ResoniteModLoader/Settings/ModSettings.cs new file mode 100644 index 0000000..6517400 --- /dev/null +++ b/MonkeyLoader.GamePacks.ResoniteModLoader/Settings/ModSettings.cs @@ -0,0 +1,18 @@ +/* +Not implemented because it involves creating FrooxEngine components +and the ML Resonite Integration already has a Settings Category anyways. + +using System; +using System.Collections.Generic; +using System.Text; + +namespace ResoniteModLoader +{ + [AutoRegisterSetting] + [SettingCategory("ResoniteModLoader")] + public sealed class ModSettings : SettingComponent + { + public override bool UserspaceOnly => true; + } +} +*/ \ No newline at end of file