Skip to content
Merged
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
61 changes: 34 additions & 27 deletions MonkeyLoader.GamePacks.ResoniteModLoader/ExecutionHook.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using FrooxEngine;
using MonkeyLoader.Logging;
using MonkeyLoader.Meta;
using System;
using System.Collections.Generic;
using System.Linq;
Expand All @@ -10,43 +8,52 @@

namespace ResoniteModLoader
{
// Why is this public
/// <summary>
/// Dummy execution hook class for compatibility.
/// </summary>
/// <remarks>
/// Why is this public now? :C
/// </remarks>
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<bool> 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<bool> 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

{ }
}
}
}
2 changes: 1 addition & 1 deletion MonkeyLoader.GamePacks.ResoniteModLoader/ModLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public sealed class ModLoader : ResoniteMonkey<ModLoader>
/// </summary>
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<bool> _isHeadless = new(()
=> AppDomain.CurrentDomain.GetAssemblies()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<PackageId>MonkeyLoader.GamePacks.ResoniteModLoader</PackageId>
<Title>ResoniteModLoader</Title>
<Authors>Banane9, Nytra</Authors>
<Version>4.0.0</Version> <!-- We use the last digit for updates since RML uses the first three -->
<Version>4.2.0</Version> <!-- We use the last digit for updates since RML uses the first three -->
<Description>This MonkeyLoader Game Pack for Resonite enables loading ResoniteModLoader mods as MonkeyLoader mods.</Description>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseExpression>LGPL-3.0-or-later</PackageLicenseExpression>
Expand Down
4 changes: 4 additions & 0 deletions MonkeyLoader.GamePacks.ResoniteModLoader/ResoniteMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@
namespace ResoniteModLoader
{
/// <summary>
/// Base class for all mods.<br/>
/// Contains members that only the <see cref="ModLoader"/> or the Mod itself are intended to access.
/// </summary>
/// <remarks>
/// Inherit from this class when creating a new mod.
/// </remarks>
public abstract class ResoniteMod : ResoniteModBase
{
private readonly Lazy<ModConfiguration?> _configuration;
Expand Down
Original file line number Diff line number Diff line change
@@ -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<ModLoaderSettings>
{
}
}
*/
18 changes: 18 additions & 0 deletions MonkeyLoader.GamePacks.ResoniteModLoader/Settings/ModSettings.cs
Original file line number Diff line number Diff line change
@@ -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<ModSettings>
{
public override bool UserspaceOnly => true;
}
}
*/
Loading