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
2 changes: 1 addition & 1 deletion WorldBoxMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
HarmonyUtils._init();
Harmony.CreateAndPatchAll(typeof(LM), Others.harmony_id);
Harmony.CreateAndPatchAll(typeof(ResourcesPatch), Others.harmony_id);

if (!SmoothLoader.isLoading()) SmoothLoader.prepare();
SmoothLoaderHelper.add(() =>
{
Expand Down Expand Up @@ -371,7 +371,7 @@
LogService.LogInfo($"NeoModLoader.dll is newer than AutoUpdate.dll, " +
$"re-extract AutoUpdate.dll from NeoModLoader.dll");
}
catch (Exception e)

Check warning on line 374 in WorldBoxMod.cs

View workflow job for this annotation

GitHub Actions / Windows

The variable 'e' is declared but never used
{
// ignored
}
Expand Down
45 changes: 45 additions & 0 deletions services/DebugService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using System.Reflection;
using HarmonyLib;
using NeoModLoader.constants;

namespace NeoModLoader.services;

public static class DebugService
{
static void Debugger(MethodBase __originalMethod)
{
LogService.LogInfo(__originalMethod.ToString());
}
static readonly Harmony Patcher = new Harmony(Others.harmony_id);
private static readonly HarmonyMethod Hook = new(AccessTools.Method(typeof(DebugService), nameof(Debugger)));
public static void AttachDebugger(Assembly assembly)
{
foreach (var Type in assembly.GetTypes())
{
foreach (var method in Type.GetMethods(
BindingFlags.Public |
BindingFlags.NonPublic |
BindingFlags.Instance |
BindingFlags.Static |
BindingFlags.DeclaredOnly))
{
Patcher.Patch(method, Hook);
}
}
}
public static void RemoveDebugger(Assembly assembly)
{
foreach (var Type in assembly.GetTypes())
{
foreach (var method in Type.GetMethods(
BindingFlags.Public |
BindingFlags.NonPublic |
BindingFlags.Instance |
BindingFlags.Static |
BindingFlags.DeclaredOnly))
{
Patcher.Unpatch(method, HarmonyPatchType.Prefix);
}
}
}
}
1 change: 1 addition & 0 deletions utils/Sounds/FMODHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ static void ClearAllCustomSounds()
[HarmonyPatch(typeof(RuntimeManager), "Update")]
static void Update()
{

SFXGroup.setVolume(GetVolume(SoundType.Sound));
MusicGroup.setVolume(GetVolume(SoundType.Music));
UIGroup.setVolume(GetVolume(SoundType.UI));
Expand Down
Loading