Skip to content
This repository was archived by the owner on Jan 24, 2023. It is now read-only.

Commit 3f66b68

Browse files
committed
Fixed CloseQuickMenu xrefs not matching, switched parameter on invoke to true to set cursors correctly
1 parent 0aee9df commit 3f66b68

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

VRChat/QuickMenuExtensions.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
22
using System.Linq;
33
using System.Reflection;
4-
using UnhollowerRuntimeLib.XrefScans;
4+
using UnityEngine;
55
using VRC.UI;
66
using VRC.UI.Elements;
77

@@ -113,14 +113,11 @@ public static void CloseQuickMenu(this UIManagerImpl uiManager)
113113
{
114114
if (_closeQuickMenuMethod == null)
115115
{
116-
var closeMenuMethod = typeof(UIManagerImpl).GetMethods()
117-
.First(method => method.Name.StartsWith("Method_Public_Virtual_Final_New_Void_") && XrefScanner.XrefScan(method).Count() == 2);
116+
var goSetActive = typeof(GameObject).GetMethod(nameof(GameObject.SetActive));
118117
_closeQuickMenuMethod = typeof(UIManagerImpl).GetMethods()
119-
.First(method => method.Name.StartsWith("Method_Public_Void_Boolean_") && XrefUtils.CheckUsedBy(method, closeMenuMethod.Name));
118+
.First(method => method.Name.StartsWith("Method_Public_Void_Boolean_") && XrefUtils.CheckUsing(method, goSetActive?.Name));
120119
}
121-
_closeQuickMenuMethod.Invoke(uiManager, new object[1] { false });
122-
VRCUiCursorManager.field_Private_Static_VRCUiCursorManager_0.field_Private_Boolean_6 = false;
123-
VRCUiCursorManager.field_Private_Static_VRCUiCursorManager_0.field_Private_Boolean_0 = true;
120+
_closeQuickMenuMethod.Invoke(uiManager, new object[1] { true });
124121
}
125122
}
126123
}

0 commit comments

Comments
 (0)