mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 06:19:22 +00:00
26 lines
No EOL
777 B
C#
26 lines
No EOL
777 B
C#
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
|
|
} |