Skip to content

Commit

Permalink
Release 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Kidev committed Mar 24, 2023
1 parent 1c15188 commit 86c76da
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 19 deletions.
19 changes: 3 additions & 16 deletions Logless.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.Linq;
using System.Reflection;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;

namespace Logless
Expand All @@ -15,18 +14,10 @@ namespace Logless
[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
public class Plugin : BaseUnityPlugin
{
// Using GUID for the Harmony instance, so that we can unpatch just this plugin if needed
private readonly Assembly _assembly = Assembly.GetExecutingAssembly();
private readonly Harmony _harmony = new(PluginInfo.PLUGIN_GUID);

internal new static ManualLogSource Logger;

// When the plugin is loaded

public void Awake() {
// Create masking Logger as internal to use more easily in code
Logger = base.Logger;

// Inject custom js and patch c#
try {
Patch();
}
Expand All @@ -35,12 +26,9 @@ public void Awake() {
throw;
}

// All done!
Logger.LogInfo($"Plugin {PluginInfo.PLUGIN_GUID} is loaded!");
}

// Unpatch if plugin is destroyed to handle in-game plugin reloads
// Remove files we created
public void OnDestroy() {
UnPatch();
}
Expand All @@ -49,7 +37,6 @@ private void Patch() {
_harmony.PatchAll(_assembly);
}

// Undoes what Patch() did
private void UnPatch() {
_harmony.UnpatchSelf();
}
Expand All @@ -76,7 +63,7 @@ private static IEnumerable<MethodBase> TargetMethods()
}

[HarmonyPrefix]
private static bool Prefix(MethodBase __originalMethod) {
private static bool Prefix() {
return false;
}
}
Expand All @@ -102,7 +89,7 @@ private static IEnumerable<MethodBase> TargetMethods()
}

[HarmonyPrefix]
private static bool Prefix(MethodBase __originalMethod) {
private static bool Prefix() {
return false;
}
}
Expand Down
4 changes: 2 additions & 2 deletions Logless.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>Logless</AssemblyName>
<Description>This Logless mod</Description>
<Version>1.0.0</Version>
<Description>Removes all logs from the game</Description>
<Version>1.0.1</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
<PackageId>ltd2.mods.Kidev.Logless</PackageId>
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Logless

Bye bye logs
Removes all logs from the game

0 comments on commit 86c76da

Please sign in to comment.