From d0c8298074c4dcfc089ccb34ed8b8bd7e0b9cedf Mon Sep 17 00:00:00 2001 From: NotAKidoS <37721153+NotAKidoS@users.noreply.github.com> Date: Tue, 29 Oct 2024 23:56:10 -0500 Subject: [PATCH] SearchWithSpacesFix: initial release --- SearchWithSpacesFix/Main.cs | 26 +++++++++++++++ .../Properties/AssemblyInfo.cs | 32 +++++++++++++++++++ SearchWithSpacesFix/README.md | 14 ++++++++ .../SearchWithSpacesFix.csproj | 2 ++ SearchWithSpacesFix/format.json | 23 +++++++++++++ 5 files changed, 97 insertions(+) create mode 100644 SearchWithSpacesFix/Main.cs create mode 100644 SearchWithSpacesFix/Properties/AssemblyInfo.cs create mode 100644 SearchWithSpacesFix/README.md create mode 100644 SearchWithSpacesFix/SearchWithSpacesFix.csproj create mode 100644 SearchWithSpacesFix/format.json diff --git a/SearchWithSpacesFix/Main.cs b/SearchWithSpacesFix/Main.cs new file mode 100644 index 0000000..8de7baa --- /dev/null +++ b/SearchWithSpacesFix/Main.cs @@ -0,0 +1,26 @@ +using System.Reflection; +using ABI_RC.Core.InteractionSystem; +using HarmonyLib; +using MelonLoader; + +namespace NAK.SearchWithSpacesFix; + +public class SearchWithSpacesFixMod : MelonMod +{ + public override void OnInitializeMelon() + { + HarmonyInstance.Patch( + typeof(ViewManager).GetMethod(nameof(ViewManager.GetSearchResults), + BindingFlags.Public | BindingFlags.Instance), + prefix: new HarmonyMethod(typeof(SearchWithSpacesFixMod).GetMethod(nameof(OnPreGetSearchResults), + BindingFlags.NonPublic | BindingFlags.Static)) + ); + } + + // this is so crazy + + private static void OnPreGetSearchResults(ref string searchTerm) + => searchTerm = searchTerm.Replace(" ", "_"); + + // this is so crazy +} \ No newline at end of file diff --git a/SearchWithSpacesFix/Properties/AssemblyInfo.cs b/SearchWithSpacesFix/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..8ba0f9a --- /dev/null +++ b/SearchWithSpacesFix/Properties/AssemblyInfo.cs @@ -0,0 +1,32 @@ +using MelonLoader; +using NAK.SearchWithSpacesFix.Properties; +using System.Reflection; + +[assembly: AssemblyVersion(AssemblyInfoParams.Version)] +[assembly: AssemblyFileVersion(AssemblyInfoParams.Version)] +[assembly: AssemblyInformationalVersion(AssemblyInfoParams.Version)] +[assembly: AssemblyTitle(nameof(NAK.SearchWithSpacesFix))] +[assembly: AssemblyCompany(AssemblyInfoParams.Author)] +[assembly: AssemblyProduct(nameof(NAK.SearchWithSpacesFix))] + +[assembly: MelonInfo( + typeof(NAK.SearchWithSpacesFix.SearchWithSpacesFixMod), + nameof(NAK.SearchWithSpacesFix), + AssemblyInfoParams.Version, + AssemblyInfoParams.Author, + downloadLink: "https://github.com/NotAKidoS/NAK_CVR_Mods/tree/main/SearchWithSpacesFix" +)] + +[assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")] +[assembly: MelonPlatform(MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)] +[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.MONO)] +[assembly: MelonColor(255, 246, 25, 99)] // red-pink +[assembly: MelonAuthorColor(255, 158, 21, 32)] // red +[assembly: HarmonyDontPatchAll] + +namespace NAK.SearchWithSpacesFix.Properties; +internal static class AssemblyInfoParams +{ + public const string Version = "1.0.0"; + public const string Author = "NotAKidoS"; +} \ No newline at end of file diff --git a/SearchWithSpacesFix/README.md b/SearchWithSpacesFix/README.md new file mode 100644 index 0000000..1c4c5bc --- /dev/null +++ b/SearchWithSpacesFix/README.md @@ -0,0 +1,14 @@ +# SearchWithSpacesFix + +Fixes search terms that use spaces. + +--- + +Here is the block of text where I tell you this mod is not affiliated with or endorsed by ABI. +https://documentation.abinteractive.net/official/legal/tos/#7-modding-our-games + +> This mod is an independent creation not affiliated with, supported by, or approved by Alpha Blend Interactive. + +> Use of this mod is done so at the user's own risk and the creator cannot be held responsible for any issues arising from its use. + +> To the best of my knowledge, I have adhered to the Modding Guidelines established by Alpha Blend Interactive. diff --git a/SearchWithSpacesFix/SearchWithSpacesFix.csproj b/SearchWithSpacesFix/SearchWithSpacesFix.csproj new file mode 100644 index 0000000..e94f9dc --- /dev/null +++ b/SearchWithSpacesFix/SearchWithSpacesFix.csproj @@ -0,0 +1,2 @@ + + diff --git a/SearchWithSpacesFix/format.json b/SearchWithSpacesFix/format.json new file mode 100644 index 0000000..f8950ca --- /dev/null +++ b/SearchWithSpacesFix/format.json @@ -0,0 +1,23 @@ +{ + "_id": -1, + "name": "SearchWithSpacesFix", + "modversion": "1.0.0", + "gameversion": "2024r177", + "loaderversion": "0.6.1", + "modtype": "Mod", + "author": "NotAKidoS", + "description": "Fixes search terms that include spaces.", + "searchtags": [ + "search", + "spaces", + "fix", + "meow" + ], + "requirements": [ + "None" + ], + "downloadlink": "https://github.com/NotAKidoS/NAK_CVR_Mods/releases/download/r42/SearchWithSpacesFix.dll", + "sourcelink": "https://github.com/NotAKidoS/NAK_CVR_Mods/tree/main/SearchWithSpacesFix/", + "changelog": "- Initial release", + "embedcolor": "#f61963" +} \ No newline at end of file