mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-01 13:59:22 +00:00
init
This commit is contained in:
parent
304efd4302
commit
8c780bb72b
6 changed files with 189 additions and 0 deletions
44
ClearHudNotifications/ClearHudNotifications.csproj
Normal file
44
ClearHudNotifications/ClearHudNotifications.csproj
Normal file
|
@ -0,0 +1,44 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net472</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="0Harmony">
|
||||
<HintPath>C:\Users\krist\Documents\GitHub\_ChilloutVR Modding\_ManagedLibs\0Harmony.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Assembly-CSharp">
|
||||
<HintPath>C:\Users\krist\Documents\GitHub\_ChilloutVR Modding\_ManagedLibs\Assembly-CSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Assembly-CSharp-firstpass">
|
||||
<HintPath>C:\Users\krist\Documents\GitHub\_ChilloutVR Modding\_ManagedLibs\Assembly-CSharp-firstpass.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="cohtml.Net">
|
||||
<HintPath>..\..\..\_ManagedLibs\cohtml.Net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Cohtml.Runtime">
|
||||
<HintPath>..\..\..\_ManagedLibs\Cohtml.Runtime.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MelonLoader">
|
||||
<HintPath>C:\Users\krist\Documents\GitHub\_ChilloutVR Modding\_ManagedLibs\MelonLoader.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.CoreModule">
|
||||
<HintPath>C:\Users\krist\Documents\GitHub\_ChilloutVR Modding\_ManagedLibs\UnityEngine.CoreModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.InputLegacyModule">
|
||||
<HintPath>C:\Users\krist\Documents\GitHub\_ChilloutVR Modding\_ManagedLibs\UnityEngine.InputLegacyModule.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="Deploy" AfterTargets="Build">
|
||||
<Copy SourceFiles="$(TargetPath)" DestinationFolder="C:\Program Files (x86)\Steam\steamapps\common\ChilloutVR\Mods\" />
|
||||
<Message Text="Copied $(TargetPath) to C:\Program Files (x86)\Steam\steamapps\common\ChilloutVR\Mods\" Importance="high" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
25
ClearHudNotifications/ClearHudNotifications.sln
Normal file
25
ClearHudNotifications/ClearHudNotifications.sln
Normal file
|
@ -0,0 +1,25 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.2.32630.192
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClearHudNotifications", "ClearHudNotifications.csproj", "{753B581A-1D5F-413C-93D8-ADE3193E825C}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{753B581A-1D5F-413C-93D8-ADE3193E825C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{753B581A-1D5F-413C-93D8-ADE3193E825C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{753B581A-1D5F-413C-93D8-ADE3193E825C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{753B581A-1D5F-413C-93D8-ADE3193E825C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {B69DA489-5322-4E63-9795-EEA831017CC8}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
26
ClearHudNotifications/HarmonyPatches.cs
Normal file
26
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.Melons.ClearHudNoficiations.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))
|
||||
{
|
||||
ClearHudNoficiations.ClearHudNotifications();
|
||||
return false;
|
||||
}
|
||||
|
||||
// clears buffer
|
||||
if (__instance._isReady) __instance.hudView.View.TriggerEvent("DisplayHudMessageImmediately", cat, headline, small, 3);
|
||||
return false;
|
||||
}
|
||||
}
|
40
ClearHudNotifications/Main.cs
Normal file
40
ClearHudNotifications/Main.cs
Normal file
|
@ -0,0 +1,40 @@
|
|||
using ABI_RC.Core.UI;
|
||||
using MelonLoader;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NAK.Melons.ClearHudNoficiations;
|
||||
|
||||
public class ClearHudNoficiations : MelonMod
|
||||
{
|
||||
public override void OnInitializeMelon()
|
||||
{
|
||||
ApplyPatches(typeof(HarmonyPatches.CohtmlHudPatches));
|
||||
}
|
||||
|
||||
public override void OnUpdate()
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.F4))
|
||||
{
|
||||
ClearHudNotifications();
|
||||
}
|
||||
}
|
||||
|
||||
public static void ClearHudNotifications()
|
||||
{
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
}
|
31
ClearHudNotifications/Properties/AssemblyInfo.cs
Normal file
31
ClearHudNotifications/Properties/AssemblyInfo.cs
Normal file
|
@ -0,0 +1,31 @@
|
|||
using NAK.Melons.ClearHudNoficiations.Properties;
|
||||
using MelonLoader;
|
||||
using System.Reflection;
|
||||
|
||||
|
||||
[assembly: AssemblyVersion(AssemblyInfoParams.Version)]
|
||||
[assembly: AssemblyFileVersion(AssemblyInfoParams.Version)]
|
||||
[assembly: AssemblyInformationalVersion(AssemblyInfoParams.Version)]
|
||||
[assembly: AssemblyTitle(nameof(NAK.Melons.ClearHudNoficiations))]
|
||||
[assembly: AssemblyCompany(AssemblyInfoParams.Author)]
|
||||
[assembly: AssemblyProduct(nameof(NAK.Melons.ClearHudNoficiations))]
|
||||
|
||||
[assembly: MelonInfo(
|
||||
typeof(NAK.Melons.ClearHudNoficiations.ClearHudNoficiations),
|
||||
nameof(NAK.Melons.ClearHudNoficiations),
|
||||
AssemblyInfoParams.Version,
|
||||
AssemblyInfoParams.Author,
|
||||
downloadLink: "https://github.com/NotAKidOnSteam/UndoPropButton"
|
||||
)]
|
||||
|
||||
[assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")]
|
||||
[assembly: MelonPlatform(MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]
|
||||
[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.MONO)]
|
||||
[assembly: HarmonyDontPatchAll]
|
||||
|
||||
namespace NAK.Melons.ClearHudNoficiations.Properties;
|
||||
internal static class AssemblyInfoParams
|
||||
{
|
||||
public const string Version = "1.0.0";
|
||||
public const string Author = "NotAKidoS";
|
||||
}
|
23
ClearHudNotifications/format.json
Normal file
23
ClearHudNotifications/format.json
Normal file
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"_id": -1,
|
||||
"name": "ClearHudNotifications",
|
||||
"modversion": "1.0.0",
|
||||
"gameversion": "2022r170",
|
||||
"loaderversion": "0.5.7",
|
||||
"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/ClearHudNotifications/releases/download/v1.0.0/ClearHudNotifications.dll",
|
||||
"sourcelink": "https://github.com/NotAKidOnSteam/ClearHudNotifications/",
|
||||
"changelog": "- Initial Release",
|
||||
"embedcolor": "#6495ED"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue