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

Commit 626e680

Browse files
committed
2.0.9
* Fix an issue in mono builds causing a crash * Fix for games which only contain one scene * A few small cleanups
1 parent 7c85969 commit 626e680

File tree

6 files changed

+19
-13
lines changed

6 files changed

+19
-13
lines changed

src/Explorer.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<RootNamespace>Explorer</RootNamespace>
2626
<AssemblyName>Explorer</AssemblyName>
2727
<!-- Set this to the MelonLoader Il2Cpp Game folder, without the ending '\' character. -->
28-
<MLCppGameFolder>D:\Steam\steamapps\common\Hellpoint</MLCppGameFolder>
28+
<MLCppGameFolder>D:\Steam\steamapps\common\VRChat</MLCppGameFolder>
2929
<!-- Set this to the MelonLoader Mono Game folder, without the ending '\' character. -->
3030
<MLMonoGameFolder>D:\Steam\steamapps\common\Outward</MLMonoGameFolder>
3131
<!-- Set this to the BepInEx Il2Cpp Game folder, without the ending '\' character. -->

src/UI/ForceUnlockCursor.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,14 @@ public static void Init()
4343
// Get current cursor state and enable cursor
4444
try
4545
{
46-
//m_lastLockMode = Cursor.lockState;
47-
m_lastLockMode = (CursorLockMode?)typeof(Cursor).GetProperty("lockState", BF.Public | BF.Static)?.GetValue(null, null)
48-
?? CursorLockMode.None;
49-
50-
//m_lastVisibleState = Cursor.visible;
51-
m_lastVisibleState = (bool?)typeof(Cursor).GetProperty("visible", BF.Public | BF.Static)?.GetValue(null, null)
52-
?? false;
46+
m_lastLockMode = (CursorLockMode)typeof(Cursor).GetProperty("lockState", BF.Public | BF.Static).GetValue(null, null);
47+
m_lastVisibleState = (bool)typeof(Cursor).GetProperty("visible", BF.Public | BF.Static).GetValue(null, null);
48+
}
49+
catch
50+
{
51+
m_lastLockMode = CursorLockMode.None;
52+
m_lastVisibleState = true;
5353
}
54-
catch { }
5554

5655
// Setup Harmony Patches
5756
TryPatch("lockState", new HarmonyMethod(typeof(ForceUnlockCursor).GetMethod(nameof(Prefix_set_lockState))), true);

src/UI/Inspectors/ReflectionInspector.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,12 @@ private void CacheMembers(Type[] types)
150150
if (m < 4 || m > 16)
151151
continue;
152152

153-
var fi = member as FieldInfo;
154153
var pi = member as PropertyInfo;
155154
var mi = member as MethodInfo;
156155

157156
if (IsStaticInspector)
158157
{
159-
if (fi != null && !fi.IsStatic) continue;
158+
if (member is FieldInfo fi && !fi.IsStatic) continue;
160159
else if (pi != null && !pi.GetAccessors()[0].IsStatic) continue;
161160
else if (mi != null && !mi.IsStatic) continue;
162161
}
@@ -195,6 +194,8 @@ void AppendParams(ParameterInfo[] _args)
195194

196195
try
197196
{
197+
// ExplorerCore.Log($"Trying to cache member {sig}...");
198+
198199
var cached = CacheFactory.GetCacheObject(member, Target);
199200

200201
if (cached != null)

src/UI/InteractiveValue/Object/InteractiveSprite.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ public class InteractiveSprite : InteractiveTexture2D
1111
{
1212
private Sprite refSprite;
1313

14+
public override void Init()
15+
{
16+
base.Init();
17+
}
18+
1419
public override void UpdateValue()
1520
{
1621
#if CPP
@@ -30,7 +35,7 @@ public override void UpdateValue()
3035

3136
public override void GetTexture2D()
3237
{
33-
if (refSprite)
38+
if (refSprite && refSprite.texture)
3439
{
3540
currentTex = refSprite.texture;
3641
}

src/UI/Main/ScenePage.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public class ScenePage : BaseMainMenuPage
3535
public override void Init()
3636
{
3737
Instance = this;
38+
m_currentScene = UnityHelpers.ActiveSceneName;
3839
}
3940

4041
public void OnSceneChange()

src/Unstrip/IMGUI/GUIHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ internal static GUILayoutOption ExpandWidth(bool expand)
1818
#if CPP
1919
return GUIUnstrip.ExpandWidth(expand);
2020
#else
21-
return GUIHelper.ExpandWidth(expand);
21+
return GUILayout.ExpandWidth(expand);
2222
#endif
2323
}
2424

0 commit comments

Comments
 (0)