mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 14:29:25 +00:00
Move mods to Depricated folder.
This commit is contained in:
parent
e61f119f32
commit
5d1cb2ebec
70 changed files with 44 additions and 119 deletions
|
@ -0,0 +1,2 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project Sdk="Microsoft.NET.Sdk"/>
|
26
.DepricatedMods/ClearHudNotifications/HarmonyPatches.cs
Normal file
26
.DepricatedMods/ClearHudNotifications/HarmonyPatches.cs
Normal file
|
@ -0,0 +1,26 @@
|
|||
using ABI_RC.Core.Savior;
|
||||
using ABI_RC.Core.UI;
|
||||
using cohtml;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace NAK.ClearHudNotifications.HarmonyPatches;
|
||||
|
||||
internal static class CohtmlHudPatches
|
||||
{
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(CohtmlHud), nameof(CohtmlHud.ViewDropText), new Type[] { typeof(string), typeof(string), typeof(string) })]
|
||||
private static bool Prefix_CohtmlHud_ViewDropText(string cat, string headline, string small, ref CohtmlHud __instance)
|
||||
{
|
||||
if (!headline.Contains(MetaPort.Instance.username)) return true; // we only want our username notification
|
||||
|
||||
if (small == "A user has joined your Instance." && !MetaPort.Instance.settings.GetSettingsBool("HUDCustomizationPlayerJoins", false))
|
||||
{
|
||||
ClearHudNotifications.ClearNotifications();
|
||||
return false;
|
||||
}
|
||||
|
||||
// clears buffer
|
||||
if (__instance._isReady) __instance.hudView.View.TriggerEvent("DisplayHudMessageImmediately", cat, headline, small, 3);
|
||||
return false;
|
||||
}
|
||||
}
|
40
.DepricatedMods/ClearHudNotifications/Main.cs
Normal file
40
.DepricatedMods/ClearHudNotifications/Main.cs
Normal file
|
@ -0,0 +1,40 @@
|
|||
using ABI_RC.Core.UI;
|
||||
using MelonLoader;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NAK.ClearHudNotifications;
|
||||
|
||||
public class ClearHudNotifications : MelonMod
|
||||
{
|
||||
public override void OnInitializeMelon()
|
||||
{
|
||||
ApplyPatches(typeof(HarmonyPatches.CohtmlHudPatches));
|
||||
}
|
||||
|
||||
public override void OnUpdate()
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.F4))
|
||||
{
|
||||
ClearNotifications();
|
||||
}
|
||||
}
|
||||
|
||||
public static void ClearNotifications()
|
||||
{
|
||||
// sending an immediate notification clears buffer
|
||||
CohtmlHud.Instance?.ViewDropTextImmediate("(Local) Client", "Notifications Cleared!", "Cleared Hud Notifications!");
|
||||
}
|
||||
|
||||
void ApplyPatches(Type type)
|
||||
{
|
||||
try
|
||||
{
|
||||
HarmonyInstance.PatchAll(type);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LoggerInstance.Msg($"Failed while patching {type.Name}!");
|
||||
LoggerInstance.Error(e);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
using MelonLoader;
|
||||
using NAK.ClearHudNotifications.Properties;
|
||||
using System.Reflection;
|
||||
|
||||
|
||||
[assembly: AssemblyVersion(AssemblyInfoParams.Version)]
|
||||
[assembly: AssemblyFileVersion(AssemblyInfoParams.Version)]
|
||||
[assembly: AssemblyInformationalVersion(AssemblyInfoParams.Version)]
|
||||
[assembly: AssemblyTitle(nameof(NAK.ClearHudNotifications))]
|
||||
[assembly: AssemblyCompany(AssemblyInfoParams.Author)]
|
||||
[assembly: AssemblyProduct(nameof(NAK.ClearHudNotifications))]
|
||||
|
||||
[assembly: MelonInfo(
|
||||
typeof(NAK.ClearHudNotifications.ClearHudNotifications),
|
||||
nameof(NAK.ClearHudNotifications),
|
||||
AssemblyInfoParams.Version,
|
||||
AssemblyInfoParams.Author,
|
||||
downloadLink: "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/UndoPropButton"
|
||||
)]
|
||||
|
||||
[assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")]
|
||||
[assembly: MelonPlatform(MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]
|
||||
[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.MONO)]
|
||||
[assembly: HarmonyDontPatchAll]
|
||||
|
||||
namespace NAK.ClearHudNotifications.Properties;
|
||||
internal static class AssemblyInfoParams
|
||||
{
|
||||
public const string Version = "1.0.0";
|
||||
public const string Author = "NotAKidoS";
|
||||
}
|
23
.DepricatedMods/ClearHudNotifications/format.json
Normal file
23
.DepricatedMods/ClearHudNotifications/format.json
Normal file
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"_id": -1,
|
||||
"name": "ClearHudNotifications",
|
||||
"modversion": "1.0.0",
|
||||
"gameversion": "2022r170p1",
|
||||
"loaderversion": "0.6.1",
|
||||
"modtype": "Mod",
|
||||
"author": "NotAKidoS",
|
||||
"description": "Clears queued hud notifications when joining a new online instance. Can also press F4 to manually clear notifications.",
|
||||
"searchtags": [
|
||||
"hud",
|
||||
"queue",
|
||||
"notifications",
|
||||
"clear"
|
||||
],
|
||||
"requirements": [
|
||||
"None"
|
||||
],
|
||||
"downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r3/ClearHudNotifications.dll",
|
||||
"sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/ClearHudNotifications/",
|
||||
"changelog": "- Initial Release",
|
||||
"embedcolor": "#6495ED"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue