Skip to content

Commit f089fad

Browse files
committed
Fixes and no more integrity check again
1 parent de70b80 commit f089fad

File tree

9 files changed

+126
-44
lines changed

9 files changed

+126
-44
lines changed

AdvancedSafety/AdvancedSafetyMod.cs

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
using Object = UnityEngine.Object;
2020

2121
[assembly:MelonGame("VRChat", "VRChat")]
22-
[assembly:MelonInfo(typeof(AdvancedSafetyMod), "Advanced Safety", "1.6.1", "knah, Requi, Ben", "https://github.com/knah/VRCMods")]
22+
[assembly:MelonInfo(typeof(AdvancedSafetyMod), "Advanced Safety", "1.6.1", "knah, Requi, Ben", "https://github.com/xAstroBoy/VRCMods-Unchained")]
2323
[assembly:MelonOptionalDependencies("UIExpansionKit")]
2424

2525
namespace AdvancedSafety
@@ -31,10 +31,31 @@ internal partial class AdvancedSafetyMod : MelonMod
3131

3232
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
3333
private delegate void VoidDelegate(IntPtr thisPtr, IntPtr nativeMethodInfo);
34+
private static readonly Func<VRCUiManager> ourGetUiManager;
35+
36+
static AdvancedSafetyMod()
37+
{
38+
ourGetUiManager = (Func<VRCUiManager>)Delegate.CreateDelegate(typeof(Func<VRCUiManager>), typeof(VRCUiManager)
39+
.GetProperties(BindingFlags.Static | BindingFlags.Public | BindingFlags.DeclaredOnly)
40+
.First(it => it.PropertyType == typeof(VRCUiManager)).GetMethod);
41+
}
42+
43+
internal static VRCUiManager GetUiManager() => ourGetUiManager();
44+
45+
private static void DoAfterUiManagerInit(Action code)
46+
{
47+
MelonCoroutines.Start(OnUiManagerInitCoro(code));
48+
}
49+
50+
private static IEnumerator OnUiManagerInitCoro(Action code)
51+
{
52+
while (GetUiManager() == null)
53+
yield return null;
54+
code();
55+
}
3456

3557
public override void OnApplicationStart()
3658
{
37-
if (!CheckWasSuccessful || !MustStayTrue || MustStayFalse) return;
3859

3960
AdvancedSafetySettings.RegisterSettings();
4061
ClassInjector.RegisterTypeInIl2Cpp<SortingOrderHammerer>();

FavCat/Modules/ExtendedFavoritesModuleBase.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ public abstract class ExtendedFavoritesModuleBase<T> where T: class, INamedStore
3939
private UISoundCollection mySoundCollection;
4040
private static ScrollRect? _AvatarPageScrollRect;
4141
protected internal abstract void RefreshFavButtons();
42-
4342
protected abstract void OnFavButtonClicked(StoredCategory storedCategory);
4443
private static ScrollRect? AvatarPageScrollRect
4544
{

IKTweaks/IKTweaksMod.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
using Delegate = Il2CppSystem.Delegate;
2020
using Object = UnityEngine.Object;
2121

22-
[assembly:MelonInfo(typeof(IKTweaksMod), "IKTweaks", "1.0.26", "knah", "https://github.com/knah/VRCMods")]
22+
[assembly:MelonInfo(typeof(IKTweaksMod), "IKTweaks", "1.0.26", "knah", "https://github.com/xAstroBoy/VRCMods-Unchained")]
2323
[assembly:MelonGame("VRChat", "VRChat")]
2424
[assembly:MelonOptionalDependencies("UIExpansionKit")]
2525

@@ -145,7 +145,7 @@ private static void ShowIKTweaksMenu()
145145

146146
menu.AddSimpleButton("Clear per-avatar stored calibrations", CalibrationManager.ClearNonUniversal);
147147
menu.AddSpacer();
148-
menu.AddSimpleButton("Open documentation in browser", () => Process.Start("https://github.com/knah/VRCMods#iktweaks"));
148+
menu.AddSimpleButton("Open documentation in browser", () => Process.Start("https://github.com/xAstroBoy/VRCMods-Unchained#iktweaks"));
149149
menu.AddSpacer();
150150

151151
menu.AddSimpleButton("Adjust hand offsets",

JoinNotifier/JoinNotifierMod.cs

Lines changed: 45 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
using VRC.Management;
1717
using Object = UnityEngine.Object;
1818

19-
[assembly:MelonInfo(typeof(JoinNotifierMod), "JoinNotifier", "1.0.7", "knah", "https://github.com/knah/VRCMods")]
19+
[assembly:MelonInfo(typeof(JoinNotifierMod), "JoinNotifier", "1.0.7", "knah", "https://github.com/xAstroBoy/VRCMods-Unchained")]
2020
[assembly:MelonGame("VRChat", "VRChat")]
2121

2222
namespace JoinNotifier
@@ -35,21 +35,42 @@ internal partial class JoinNotifierMod : MelonMod
3535
private AudioSource myLeaveSource;
3636
private Text myJoinText;
3737
private Text myLeaveText;
38-
38+
3939
private int myLastLevelLoad;
4040
private bool myObservedLocalPlayerJoin;
41-
41+
4242
private AssetBundle myAssetBundle;
4343
private Sprite myJoinSprite;
4444
private AudioClip myJoinClip;
4545
private AudioClip myLeaveClip;
4646

4747
private AudioMixerGroup myUIGroup;
48+
private static readonly Func<VRCUiManager> ourGetUiManager;
49+
50+
static JoinNotifierMod()
51+
{
52+
ourGetUiManager = (Func<VRCUiManager>)Delegate.CreateDelegate(typeof(Func<VRCUiManager>), typeof(VRCUiManager)
53+
.GetProperties(BindingFlags.Static | BindingFlags.Public | BindingFlags.DeclaredOnly)
54+
.First(it => it.PropertyType == typeof(VRCUiManager)).GetMethod);
55+
}
56+
57+
internal static VRCUiManager GetUiManager() => ourGetUiManager();
58+
59+
private static void DoAfterUiManagerInit(Action code)
60+
{
61+
MelonCoroutines.Start(OnUiManagerInitCoro(code));
62+
}
63+
64+
private static IEnumerator OnUiManagerInitCoro(Action code)
65+
{
66+
while (GetUiManager() == null)
67+
yield return null;
68+
code();
69+
}
4870

4971
public override void OnApplicationStart()
5072
{
51-
if (!CheckWasSuccessful || !MustStayTrue || MustStayFalse) return;
52-
73+
5374
JoinNotifierSettings.RegisterSettings();
5475

5576
MelonCoroutines.Start(InitThings());
@@ -58,7 +79,7 @@ public override void OnApplicationStart()
5879
public IEnumerator InitThings()
5980
{
6081
MelonDebug.Msg("Waiting for init");
61-
82+
6283
while (ReferenceEquals(NetworkManager.field_Internal_Static_NetworkManager_0, null)) yield return null;
6384
while (ReferenceEquals(VRCAudioManager.field_Private_Static_VRCAudioManager_0, null)) yield return null;
6485
while (ReferenceEquals(GetUiManager(), null)) yield return null;
@@ -72,18 +93,18 @@ public IEnumerator InitThings()
7293
}.Single(it => it.name == "UI");
7394

7495
MelonDebug.Msg("Start init");
75-
96+
7697
NetworkManagerHooks.Initialize();
7798

7899
using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("JoinNotifier.joinnotifier.assetbundle"))
79-
using (var tempStream = new MemoryStream((int) stream.Length))
100+
using (var tempStream = new MemoryStream((int)stream.Length))
80101
{
81102
stream.CopyTo(tempStream);
82-
103+
83104
myAssetBundle = AssetBundle.LoadFromMemory_Internal(tempStream.ToArray(), 0);
84105
myAssetBundle.hideFlags |= HideFlags.DontUnloadUnusedAsset;
85106
}
86-
107+
87108
myJoinSprite = myAssetBundle.LoadAsset_Internal("Assets/JoinNotifier/JoinIcon.png", Il2CppType.Of<Sprite>()).Cast<Sprite>();
88109
myJoinSprite.hideFlags |= HideFlags.DontUnloadUnusedAsset;
89110

@@ -94,34 +115,34 @@ public IEnumerator InitThings()
94115
uwr.SendWebRequest();
95116

96117
while (!uwr.isDone) yield return null;
97-
118+
98119
myJoinClip = WebRequestWWW.InternalCreateAudioClipUsingDH(uwr.downloadHandler, uwr.url, false, false, AudioType.UNKNOWN);
99120
}
100-
121+
101122
if (myJoinClip == null)
102123
myJoinClip = myAssetBundle.LoadAsset_Internal("Assets/JoinNotifier/Chime.ogg", Il2CppType.Of<AudioClip>()).Cast<AudioClip>();
103-
124+
104125
myJoinClip.hideFlags |= HideFlags.DontUnloadUnusedAsset;
105126

106127
if (File.Exists(CustomLeaveSoundFileName))
107128
{
108129
MelonLogger.Msg("Loading custom leave sound");
109-
130+
110131
var uwr = UnityWebRequest.Get($"file://{Path.Combine(Environment.CurrentDirectory, CustomLeaveSoundFileName)}");
111132
uwr.SendWebRequest();
112133

113134
while (!uwr.isDone) yield return null;
114-
135+
115136
myLeaveClip = WebRequestWWW.InternalCreateAudioClipUsingDH(uwr.downloadHandler, uwr.url, false, false, AudioType.UNKNOWN);
116137
}
117-
138+
118139
if (myLeaveClip == null)
119140
myLeaveClip = myAssetBundle.LoadAsset_Internal("Assets/JoinNotifier/DoorClose.ogg", Il2CppType.Of<AudioClip>()).Cast<AudioClip>();
120-
141+
121142
myLeaveClip.hideFlags |= HideFlags.DontUnloadUnusedAsset;
122143

123144
CreateGameObjects();
124-
145+
125146
NetworkManagerHooks.OnJoin += OnPlayerJoined;
126147
NetworkManagerHooks.OnLeave += OnPlayerLeft;
127148

@@ -219,25 +240,25 @@ private void CreateGameObjects()
219240
MelonLogger.Msg("Not creating gameobjects - no hud root");
220241
return;
221242
}
222-
243+
223244
MelonDebug.Msg("Creating gameobjects");
224-
// var pathToThing = "UserInterface/UnscaledUI/HudContent_Old/Hud/NotificationDotParent/NotificationDot";
245+
// var pathToThing = "UserInterface/UnscaledUI/HudContent_Old/Hud/NotificationDotParent/NotificationDot";
225246
myJoinImage = CreateNotifierImage("join", 0f, JoinNotifierSettings.GetJoinIconColor());
226247
myJoinSource = CreateAudioSource(myJoinClip, myJoinImage.gameObject);
227248
myJoinText = CreateTextNear(myJoinImage, 110f, TextAnchor.LowerRight);
228-
249+
229250
myLeaveImage = CreateNotifierImage("leave", 100f, JoinNotifierSettings.GetLeaveIconColor());
230251
myLeaveSource = CreateAudioSource(myLeaveClip, myLeaveImage.gameObject);
231252
myLeaveText = CreateTextNear(myLeaveImage, 110f, TextAnchor.LowerLeft);
232253
}
233254

234-
partial void OnSceneWasLoaded2(int buildIndex, string sceneName)
255+
256+
public override void OnSceneWasLoaded(int buildIndex, string sceneName)
235257
{
236-
base.OnSceneWasLoaded(buildIndex, sceneName);
237-
238258
myLastLevelLoad = Environment.TickCount;
239259
myObservedLocalPlayerJoin = false;
240260
}
261+
241262

242263
public void OnPlayerJoined(Player player)
243264
{

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Requires UI Expansion Kit - new buttons are added to Camera expando (collapsed b
7575
* [Move the camera lens to not be instrusively in the middle of the camera screen](https://feedback.vrchat.com/feature-requests/p/move-the-camera-lens-to-not-be-instrusively-in-the-middle-of-the-camera-screen)
7676

7777
## EmojiPageButtons
78-
This mod is deprecated with the new Quick Menu (UI 1.5). Last revision containing its code can be found [here](https://github.com/knah/VRCMods/tree/c1c21edbb0ce13ef4c12b5ffefe0d9fcc0161f77)
78+
This mod is deprecated with the new Quick Menu (UI 1.5). Last revision containing its code can be found [here](https://github.com/xAstroBoy/VRCMods-Unchained/tree/c1c21edbb0ce13ef4c12b5ffefe0d9fcc0161f77)
7979

8080
## FavCat
8181
An all-in-one local favorites mod. Unlimited favorite lists with unlimited favorites in them and a searchable local database of content and players.
@@ -144,7 +144,7 @@ I believe this step to be necessary to ensure that VRChat team sees (wholesome)
144144
On top of that, recent API changes indicate that VRChat Team is taking action to restrict access to avatars. It might be an attempt at ripping prevention, or it might be aimed at privacy enhancement, or it might be aimed at extended avatar favorites. There's no way to tell for sure, and there's no knowing how far those changes would go in the future.
145145
Local favorite mods have to rely on the API to some degree, and with things changing quickly, there's no reliable way to ensure that things will stay working and stay safe ban-wise in the long run.
146146

147-
Before you read on, please [scroll up a bit](https://github.com/knah/VRCMods#canny-tickets) and **upvote all linked Canny tickets related to avatar favorites**. If you decide to comment on them, remember to **stay civil** and **avoid mentioning mods**.
147+
Before you read on, please [scroll up a bit](https://github.com/xAstroBoy/VRCMods-Unchained#canny-tickets) and **upvote all linked Canny tickets related to avatar favorites**. If you decide to comment on them, remember to **stay civil** and **avoid mentioning mods**.
148148

149149
In more practical terms, this means the following:
150150
* Starting with this update, you will not be able to add new avatar favorites, create new avatar favorite lists, or import avatar favorite lists
@@ -359,7 +359,7 @@ It's not recommended to scale avatar too small (below 0.1 scale) or too big as t
359359
* [Remeasure avatar](https://vrchat.canny.io/avatar-30/p/remeasure-avatar) (not this exact feature, but a similar one)
360360

361361
## SparkleBeGone
362-
This mod is deprecated with the new Quick Menu (UI 1.5). Last revision containing its code can be found [here](https://github.com/knah/VRCMods/tree/c1c21edbb0ce13ef4c12b5ffefe0d9fcc0161f77)
362+
This mod is deprecated with the new Quick Menu (UI 1.5). Last revision containing its code can be found [here](https://github.com/xAstroBoy/VRCMods-Unchained/tree/c1c21edbb0ce13ef4c12b5ffefe0d9fcc0161f77)
363363

364364
## Styletor
365365
This mod allows you to reskin your Quick Menu (and, eventually, main menu and other UI elements) using VRChat's new UI Styling system.
@@ -471,7 +471,7 @@ These two serve to tightly integrate integrity check with mods to make automated
471471

472472
## Installation
473473
To install these mods, you will need to install [MelonLoader](https://discord.gg/2Wn3N2P) (discord link, see \#how-to-install).
474-
Then, you will have to put mod .dll files from [releases](https://github.com/knah/VRCMods/releases) into the `Mods` folder of your game directory
474+
Then, you will have to put mod .dll files from [releases](https://github.com/xAstroBoy/VRCMods-Unchained/releases) into the `Mods` folder of your game directory
475475

476476
## Building
477477
To build these, drop required libraries (found in `<vrchat instanll dir>/MelonLoader/Managed` after melonloader installation, list found in `Directory.Build.props`) into Libs folder, then use your IDE of choice to build.

ScaleGoesBrr/ScaleGoesBrrMod.cs

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using System;
22
using System.Collections;
3+
using System.Linq;
4+
using System.Reflection;
35
using HarmonyLib;
46
using MelonLoader;
57
using RootMotion.FinalIK;
@@ -8,7 +10,7 @@
810
using UnityEngine;
911
using VRC.SDKBase;
1012

11-
[assembly:MelonInfo(typeof(ScaleGoesBrrMod), "Scale Goes Brr", "1.1.1", "knah", "https://github.com/knah/VRCMods")]
13+
[assembly:MelonInfo(typeof(ScaleGoesBrrMod), "Scale Goes Brr", "1.1.1", "knah", "https://github.com/xAstroBoy/VRCMods-Unchained")]
1214
[assembly:MelonGame("VRChat", "VRChat")]
1315

1416
namespace ScaleGoesBrr
@@ -28,6 +30,28 @@ internal static void FireScaleChange(Transform avatarRoot, float newScale)
2830
{
2931
OnAvatarScaleChanged?.Invoke(avatarRoot, newScale);
3032
}
33+
private static readonly Func<VRCUiManager> ourGetUiManager;
34+
35+
static ScaleGoesBrrMod()
36+
{
37+
ourGetUiManager = (Func<VRCUiManager>)Delegate.CreateDelegate(typeof(Func<VRCUiManager>), typeof(VRCUiManager)
38+
.GetProperties(BindingFlags.Static | BindingFlags.Public | BindingFlags.DeclaredOnly)
39+
.First(it => it.PropertyType == typeof(VRCUiManager)).GetMethod);
40+
}
41+
42+
internal static VRCUiManager GetUiManager() => ourGetUiManager();
43+
44+
private static void DoAfterUiManagerInit(Action code)
45+
{
46+
MelonCoroutines.Start(OnUiManagerInitCoro(code));
47+
}
48+
49+
private static IEnumerator OnUiManagerInitCoro(Action code)
50+
{
51+
while (GetUiManager() == null)
52+
yield return null;
53+
code();
54+
}
3155

3256
public override void OnApplicationStart()
3357
{

Styletor/Styletor.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net472</TargetFramework>
4+
<TargetFramework>net48</TargetFramework>
55
<Version>0.3.3.0</Version>
66
<LangVersion>latest</LangVersion>
77
<Nullable>enable</Nullable>

Styletor/StyletorMod.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
using UnhollowerRuntimeLib.XrefScans;
1515
using VRC.UI.Core.Styles;
1616

17-
[assembly:MelonInfo(typeof(StyletorMod), "Styletor", "0.3.3", "knah", "https://github.com/knah/VRCMods")]
17+
[assembly:MelonInfo(typeof(StyletorMod), "Styletor", "0.3.3", "knah", "https://github.com/xAstroBoy/VRCMods-Unchained")]
1818
[assembly:MelonGame("VRChat", "VRChat")]
1919

2020
#nullable disable
@@ -49,7 +49,7 @@ public override void OnApplicationStart()
4949
settingMenu.AddSimpleButton("Reload styles from disk", ReloadStyles);
5050
settingMenu.AddSimpleButton("Export default VRChat style reference", ExportStyleClick);
5151
settingMenu.AddSimpleButton("Export QM object/style tree", ExportTreeClick);
52-
settingMenu.AddSimpleButton("Open mod documentation in browser", () => Process.Start("https://github.com/knah/VRCMods#Styletor"));
52+
settingMenu.AddSimpleButton("Open mod documentation in browser", () => Process.Start("https://github.com/xAstroBoy/VRCMods-Unchained#Styletor"));
5353

5454
MelonCoroutines.Start(WaitForStyleInit());
5555
}

0 commit comments

Comments
 (0)