mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-03 06:49:22 +00:00
[FuckCohtmlResourceHandler] fucking annoying
stop
This commit is contained in:
parent
b5b7ccfe20
commit
b1d8c5b81a
6 changed files with 170 additions and 0 deletions
46
FuckCohtmlResourceHandler/Main.cs
Normal file
46
FuckCohtmlResourceHandler/Main.cs
Normal file
|
@ -0,0 +1,46 @@
|
|||
using MelonLoader;
|
||||
|
||||
namespace NAK.FuckCohtmlResourceHandler;
|
||||
|
||||
public class FuckCohtmlResourceHandler : MelonMod
|
||||
{
|
||||
internal static MelonLogger.Instance Logger;
|
||||
|
||||
public static readonly MelonPreferences_Category Category =
|
||||
MelonPreferences.CreateCategory(nameof(FuckCohtmlResourceHandler));
|
||||
|
||||
public static readonly MelonPreferences_Entry<bool> EntryEnabled =
|
||||
Category.CreateEntry("Enabled", true, description: "Toggle FuckCohtmlResourceHandler entirely.");
|
||||
|
||||
public static readonly MelonPreferences_Entry<bool> EntryBlockBadgesUrl =
|
||||
Category.CreateEntry("BlockBadgesUrl", true, description: "Toggle whether to block Badges URL.");
|
||||
|
||||
public static readonly MelonPreferences_Entry<bool> EntryBlockUserImagesUrl =
|
||||
Category.CreateEntry("BlockUserImagesUrl", false, description: "Toggle whether to block User Images URL.");
|
||||
|
||||
public static readonly MelonPreferences_Entry<bool> EntryBlockWorldImagesUrl =
|
||||
Category.CreateEntry("BlockWorldImagesUrl", false, description: "Toggle whether to block World Images URL.");
|
||||
|
||||
public static readonly MelonPreferences_Entry<bool> EntryBlockAllUrl =
|
||||
Category.CreateEntry("BlockAllUrl", false, description: "Toggle whether to block All content URL.");
|
||||
|
||||
public override void OnInitializeMelon()
|
||||
{
|
||||
Logger = LoggerInstance;
|
||||
HarmonyPatches.DefaultResourceHandlerPatches.Initialize();
|
||||
ApplyPatches(typeof(HarmonyPatches.DefaultResourceHandlerPatches));
|
||||
}
|
||||
|
||||
void ApplyPatches(Type type)
|
||||
{
|
||||
try
|
||||
{
|
||||
HarmonyInstance.PatchAll(type);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LoggerInstance.Msg($"Failed while patching {type.Name}!");
|
||||
LoggerInstance.Error(e);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue