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

Commit aca784d

Browse files
committed
Update mods for VRC Build 1004
1 parent cc890ef commit aca784d

13 files changed

+34
-35
lines changed

AdvancedSafety/AdvancedSafety.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<VrcReferences>true</VrcReferences>
66
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
77
<LangVersion>latest</LangVersion>
8-
<Version>1.2.1.0</Version>
8+
<Version>1.2.2.0</Version>
99
</PropertyGroup>
1010

1111
<ItemGroup>

AdvancedSafety/AdvancedSafetyMod.cs

+5-9
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@
1818
using AMEnumC = VRCAvatarManager.ObjectNPrivateSealedIEnumerator1ObjectIEnumeratorIDisposableInObVRAc1GaApAcObObUnique;
1919
using Object = UnityEngine.Object;
2020

21+
using ModerationManager = ObjectPublicObLi1ApSiLi1ApBoSiUnique;
22+
2123
[assembly:MelonGame("VRChat", "VRChat")]
22-
[assembly:MelonInfo(typeof(AdvancedSafetyMod), "Advanced Safety", "1.2.1", "knah", "https://github.com/knah/VRCMods")]
24+
[assembly:MelonInfo(typeof(AdvancedSafetyMod), "Advanced Safety", "1.2.2", "knah", "https://github.com/knah/VRCMods")]
2325
[assembly:MelonOptionalDependencies("UIExpansionKit")]
2426

2527
namespace AdvancedSafety
@@ -143,7 +145,7 @@ private static void CleanAvatar(VRCAvatarManager avatarManager, GameObject go)
143145
return;
144146

145147
if (AdvancedSafetySettings.AvatarFilteringOnlyInPublic &&
146-
RoomManagerBase.field_Internal_Static_ApiWorldInstance_0?.InstanceType != ApiWorldInstance.AccessType.Public)
148+
RoomManager.field_Internal_Static_ApiWorldInstance_0?.InstanceType != ApiWorldInstance.AccessType.Public)
147149
return;
148150

149151
var vrcPlayer = avatarManager.field_Private_VRCPlayer_0;
@@ -335,13 +337,7 @@ private static IntPtr ObjectInstantiatePatch(IntPtr assetPtr, Vector3 pos, Quate
335337

336338
internal static bool IsAvatarExplicitlyShown(string userId)
337339
{
338-
foreach (var playerModeration in ModerationManager.prop_ModerationManager_0.field_Private_List_1_ApiPlayerModeration_0)
339-
{
340-
if (playerModeration.moderationType == ApiPlayerModeration.ModerationType.ShowAvatar && playerModeration.targetUserId == userId)
341-
return true;
342-
}
343-
344-
foreach (var playerModeration in ModerationManager.prop_ModerationManager_0.field_Private_List_1_ApiPlayerModeration_1)
340+
foreach (var playerModeration in ModerationManager.prop_ObjectPublicObLi1ApSiLi1ApBoSiUnique_0.field_Private_List_1_ApiPlayerModeration_0)
345341
{
346342
if (playerModeration.moderationType == ApiPlayerModeration.ModerationType.ShowAvatar && playerModeration.targetUserId == userId)
347343
return true;

AdvancedSafety/AvatarHiding.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public static void OnApplicationStart()
6060
{
6161
var originalMethodPointer = *(IntPtr*) (IntPtr) UnhollowerUtils
6262
.GetIl2CppMethodInfoPointerFieldForGeneratedMethod(typeof(FeaturePermissionManager).GetMethod(
63-
nameof(FeaturePermissionManager.Method_Public_Boolean_String_byref_EnumPublicSealedva5vUnique_0)))
63+
nameof(FeaturePermissionManager.Method_Public_Boolean_APIUser_byref_EnumPublicSealedva5vUnique_0)))
6464
.GetValue(null);
6565

6666
Imports.Hook((IntPtr)(&originalMethodPointer), typeof(AvatarHiding).GetMethod(nameof(CanUseCustomAvatarPatch), BindingFlags.Static | BindingFlags.NonPublic)!.MethodHandle.GetFunctionPointer());
@@ -84,9 +84,9 @@ private static bool SwitchAvatarPatch(IntPtr thisPtr, IntPtr apiAvatarPtr, IntPt
8484
return ourSwitchAvatar(thisPtr, apiAvatarPtr, someString, someFloat, someDelegate);
8585
}
8686

87-
private static bool CanUseCustomAvatarPatch(IntPtr thisPtr, IntPtr userIdPtr, ref int denyReason)
87+
private static bool CanUseCustomAvatarPatch(IntPtr thisPtr, IntPtr apiUserPtr, ref int denyReason)
8888
{
89-
var result = ourCanUseCustomAvatarDelegate(thisPtr, userIdPtr, ref denyReason);
89+
var result = ourCanUseCustomAvatarDelegate(thisPtr, apiUserPtr, ref denyReason);
9090
try
9191
{
9292
if (!SwitchAvatarCookie.ourInSwitch || SwitchAvatarCookie.ourApiAvatar == null)

AdvancedSafety/PortalHiding.cs

+4-7
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
using VRC;
99
using VRC.Core;
1010

11+
using ModerationManager = ObjectPublicObLi1ApSiLi1ApBoSiUnique;
12+
1113
namespace AdvancedSafety
1214
{
1315
public static class PortalHiding
@@ -50,7 +52,7 @@ private static void InstantiateObjectPatch(IntPtr thisPtr, IntPtr objectNamePtr,
5052
if (objectName != "Portals/PortalInternalDynamic") return;
5153
var apiUser = player.prop_APIUser_0;
5254
if (apiUser == null) return;
53-
if (APIUser._currentUser?.id == apiUser.id) return;
55+
if (APIUser.CurrentUser?.id == apiUser.id) return;
5456

5557
if (Imports.IsDebugMode())
5658
MelonLogger.Log($"User {apiUser.displayName} dropped a portal");
@@ -92,7 +94,7 @@ private static bool IsBlockedEitherWay(string userId)
9294
{
9395
if (userId == null) return false;
9496

95-
var moderationManager = ModerationManager.prop_ModerationManager_0;
97+
var moderationManager = ModerationManager.prop_ObjectPublicObLi1ApSiLi1ApBoSiUnique_0;
9698
if (moderationManager == null) return false;
9799
if (APIUser.CurrentUser?.id == userId)
98100
return false;
@@ -103,11 +105,6 @@ private static bool IsBlockedEitherWay(string userId)
103105
return true;
104106
}
105107

106-
foreach (var playerModeration in moderationManager.field_Private_List_1_ApiPlayerModeration_1)
107-
{
108-
if (playerModeration != null && playerModeration.moderationType == ApiPlayerModeration.ModerationType.Block && playerModeration.targetUserId == userId)
109-
return true;
110-
}
111108
return false;
112109

113110
}

AdvancedSafety/QuickMenuHideAvatarButtonHandler.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ private void Update()
2424

2525
myTimeAccumulator = 0;
2626

27-
var player = myQuickMenu.field_Private_VRCPlayer_0;
27+
var player = myQuickMenu.field_Private_Player_0.prop_VRCPlayer_0;
2828
if (player == null) return;
2929

3030
UiExpansionKitSupport.QuickMenuUpdateTick(player);

AdvancedSafety/UiExpansionKitSupport.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public static void OnApplicationStart()
2929

3030
private static void OnHideAvatarClick()
3131
{
32-
var apiAvatar = QuickMenu.prop_QuickMenu_0.field_Private_VRCPlayer_0?.prop_VRCAvatarManager_0?.prop_ApiAvatar_0;
32+
var apiAvatar = QuickMenu.prop_QuickMenu_0.field_Private_Player_0?.prop_VRCPlayer_0?.prop_VRCAvatarManager_0?.prop_ApiAvatar_0;
3333
if (apiAvatar == null) return;
3434

3535
if (AvatarHiding.ourBlockedAvatars.ContainsKey(apiAvatar.id))
@@ -71,7 +71,7 @@ private static IEnumerator InitThings()
7171
while (VRCUiManager.prop_VRCUiManager_0 == null || QuickMenu.prop_QuickMenu_0 == null)
7272
yield return null;
7373

74-
VRCUiManager.field_Protected_Static_VRCUiManager_0.Method_Public_add_Void_Action_1_VRCUiPage_0(new Action<VRCUiPage>(OnPageShown));
74+
VRCUiManager.prop_VRCUiManager_0.Method_Internal_add_Void_Action_1_VRCUiPage_0(new Action<VRCUiPage>(OnPageShown));
7575
}
7676

7777
private static void OnPageShown(VRCUiPage obj)

Finitizer/Finitizer.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<TargetFramework>net472</TargetFramework>
55
<VrcReferences>true</VrcReferences>
6-
<Version>1.0.0.0</Version>
6+
<Version>1.0.1.0</Version>
77
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
88
<LangVersion>latest</LangVersion>
99
</PropertyGroup>

Finitizer/FinitizerMod.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
using UnityEngine;
1010
using PhotonSerializers = ObjectPublicAbstractSealedSiDiSi2ObSiObSiSiSiUnique;
1111

12-
[assembly:MelonInfo(typeof(FinitizerMod), "Finitizer", "1.0.0", "knah", "https://github.com/knah/VRCMods")]
12+
[assembly:MelonInfo(typeof(FinitizerMod), "Finitizer", "1.0.1", "knah", "https://github.com/knah/VRCMods")]
1313
[assembly:MelonGame("VRChat", "VRChat")]
1414

1515
namespace Finitizer
@@ -23,7 +23,7 @@ public override void OnApplicationStart()
2323

2424
public IEnumerator InitThings()
2525
{
26-
while (VRCUiManager.field_Protected_Static_VRCUiManager_0 == null)
26+
while (VRCUiManager.prop_VRCUiManager_0 == null)
2727
yield return null;
2828

2929
ApplyPatches();

JoinNotifier/JoinNotifier.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
55
<VrcReferences>true</VrcReferences>
66
<UseAltLibs>true</UseAltLibs>
7-
<AssemblyVersion>0.2.6.0</AssemblyVersion>
7+
<AssemblyVersion>0.2.7.0</AssemblyVersion>
88
</PropertyGroup>
99
<ItemGroup>
1010
<EmbeddedResource Include="joinnotifier.assetbundle" />

JoinNotifier/JoinNotifierMod.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace JoinNotifier
1919
{
2020
public class JoinNotifierMod : MelonMod
2121
{
22-
public const string VersionConst = "0.2.6";
22+
public const string VersionConst = "0.2.7";
2323

2424
private readonly List<string> myJoinNames = new List<string>();
2525
private readonly List<string> myLeaveNames = new List<string>();
@@ -54,7 +54,7 @@ public IEnumerator InitThings()
5454

5555
while (ReferenceEquals(NetworkManager.field_Internal_Static_NetworkManager_0, null)) yield return null;
5656
while (ReferenceEquals(VRCAudioManager.field_Private_Static_VRCAudioManager_0, null)) yield return null;
57-
while (ReferenceEquals(VRCUiManager.field_Protected_Static_VRCUiManager_0, null)) yield return null;
57+
while (ReferenceEquals(VRCUiManager.prop_VRCUiManager_0, null)) yield return null;
5858

5959
MelonLogger.Log("Start init");
6060

JoinNotifier/JoinNotifierSettings.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public static void RegisterSettings()
5858

5959
public static bool ShouldNotifyInCurrentInstance()
6060
{
61-
var instanceType = RoomManagerBase.field_Internal_Static_ApiWorldInstance_0?.InstanceType;
61+
var instanceType = RoomManager.field_Internal_Static_ApiWorldInstance_0?.InstanceType;
6262
if (instanceType == null) return false;
6363
switch (instanceType)
6464
{

UIExpansionKit/UIExpansionKit.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<VrcReferences>true</VrcReferences>
55
<LangVersion>latest</LangVersion>
66
<UseAltLibs>true</UseAltLibs>
7-
<AssemblyVersion>0.1.4.0</AssemblyVersion>
7+
<AssemblyVersion>0.1.5.0</AssemblyVersion>
88
</PropertyGroup>
99
<ItemGroup>
1010
<EmbeddedResource Include="modui.assetbundle" />

UIExpansionKit/UiExpansionKitMod.cs

+10-4
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111
using VRCSDK2;
1212
using Object = UnityEngine.Object;
1313

14-
[assembly:MelonInfo(typeof(UiExpansionKitMod), "UI Expansion Kit", "0.1.4", "knah", "https://github.com/knah/VRCMods")]
14+
[assembly:MelonInfo(typeof(UiExpansionKitMod), "UI Expansion Kit", "0.1.5", "knah", "https://github.com/knah/VRCMods")]
1515
[assembly:MelonGame("VRChat", "VRChat")]
1616

1717
namespace UIExpansionKit
1818
{
1919
public class UiExpansionKitMod : MelonMod
2020
{
21+
internal static UiExpansionKitMod Instance;
22+
2123
private PreloadedBundleContents myStuffBundle;
2224

2325
private GameObject myModSettingsExpando;
@@ -49,9 +51,13 @@ public class UiExpansionKitMod : MelonMod
4951
private readonly Dictionary<ExpandedMenu, GameObject> myMenuRoots = new Dictionary<ExpandedMenu, GameObject>();
5052
private readonly List<(GameObject from, GameObject to)> myVisibilityTransfers = new List<(GameObject from, GameObject to)>();
5153
private readonly Dictionary<GameObject, bool> myHasContents = new Dictionary<GameObject, bool>();
54+
55+
public PreloadedBundleContents StuffBundle => myStuffBundle;
5256

5357
public override void OnApplicationStart()
5458
{
59+
Instance = this;
60+
5561
ExpansionKitSettings.RegisterSettings();
5662
MelonCoroutines.Start(InitThings());
5763
}
@@ -75,7 +81,7 @@ public override void OnModSettingsApplied()
7581

7682
private IEnumerator InitThings()
7783
{
78-
while (VRCUiManager.field_Protected_Static_VRCUiManager_0 == null)
84+
while (VRCUiManager.prop_VRCUiManager_0 == null)
7985
yield return null;
8086

8187
while (QuickMenu.prop_QuickMenu_0 == null)
@@ -126,7 +132,7 @@ private void DecorateMenuPages()
126132
var quickMenuRoot = QuickMenu.prop_QuickMenu_0.gameObject;
127133

128134
var fullMenuExpandoPrefab = myStuffBundle.BigMenuExpando;
129-
var fullMenuRoot = VRCUiManager.field_Protected_Static_VRCUiManager_0.menuContent;
135+
var fullMenuRoot = VRCUiManager.prop_VRCUiManager_0.menuContent;
130136

131137
foreach (var valueTuple in GameObjectToCategoryList)
132138
{
@@ -221,7 +227,7 @@ private void FillBigMenuExpando(GameObject expando, ExpandedMenu categoryEnum)
221227

222228
private void DecorateFullMenu()
223229
{
224-
var fullMenuRoot = VRCUiManager.field_Protected_Static_VRCUiManager_0.menuContent;
230+
var fullMenuRoot = VRCUiManager.prop_VRCUiManager_0.menuContent;
225231

226232
var settingsExpandoPrefab = myStuffBundle.SettingsMenuExpando;
227233
myModSettingsExpando = Object.Instantiate(settingsExpandoPrefab, fullMenuRoot.transform, false);

0 commit comments

Comments
 (0)