Skip to content

Commit 3d39e29

Browse files
authored
Merge pull request #15 from Lionmeow/main
input glyph revamp + small fixes
2 parents e4c0d6d + bb78b36 commit 3d39e29

20 files changed

+257
-224
lines changed

SRVR/EntryPoint.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,14 @@ public override void PreLoad()
5757
SRCallbacks.OnMainMenuLoaded += _ =>
5858
{
5959
var uiTemplates = Object.FindObjectOfType<UITemplates>();
60-
VRInstaller.UninstallDLC(uiTemplates);
60+
if (!VRInstaller.installed)
61+
VRInstaller.UninstallDLC(uiTemplates);
62+
else
63+
VRInstaller.Shutdown(uiTemplates);
6164
};
6265
return;
6366
}
6467

65-
if (typeof(ConsoleWindow).GetMethod("OnGUI", AccessTools.all) != null)
66-
{
67-
EntryPoint.ConsoleInstance.LogWarning("Optimization Fixes did not work properly, please try to reinstall the game and mod.");
68-
}
69-
7068
TranslationPatcher.AddUITranslation("b.vr", "VR");
7169
TranslationPatcher.AddUITranslation("b.uninstall_srvr", "Uninstall SRVR");
7270
TranslationPatcher.AddUITranslation("b.snap_turn", "Toggle Snap Turn");

SRVR/Files/Managed/SteamVR.dll

3 KB
Binary file not shown.
0 Bytes
Binary file not shown.
-512 Bytes
Binary file not shown.
3.5 KB
Binary file not shown.
0 Bytes
Binary file not shown.

SRVR/Files/Plugins/XRSDKOpenVR.dll

236 KB
Binary file not shown.

SRVR/Files/Plugins/openvr_api.dll

7.86 KB
Binary file not shown.

SRVR/Files/Plugins/ucrtbased.dll

1.72 MB
Binary file not shown.

SRVR/Patches/Patch_IMGUI.cs

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
using HarmonyLib;
2+
using UnityEngine;
3+
4+
namespace SRVR.Patches
5+
{
6+
[HarmonyPatch(typeof(GUILayoutUtility), "Begin")]
7+
internal static class Patch_IMGUI
8+
{
9+
public static bool Prefix(GUILayoutUtility __instance, int instanceID)
10+
{
11+
GUILayoutUtility.LayoutCache layoutCache = GUILayoutUtility.SelectIDList(instanceID, false);
12+
if (Event.current.type == EventType.Layout)
13+
{
14+
if (layoutCache.topLevel == null)
15+
layoutCache.topLevel = new GUILayoutGroup();
16+
else
17+
ResetGUILayoutGroup(layoutCache.topLevel);
18+
19+
if (layoutCache.windows == null)
20+
layoutCache.windows = new GUILayoutGroup();
21+
else
22+
ResetGUILayoutGroup(layoutCache.windows);
23+
24+
GUILayoutUtility.current.topLevel = layoutCache.topLevel;
25+
GUILayoutUtility.current.layoutGroups.Clear();
26+
GUILayoutUtility.current.layoutGroups.Push(GUILayoutUtility.current.topLevel);
27+
GUILayoutUtility.current.windows = layoutCache.windows;
28+
}
29+
else
30+
{
31+
GUILayoutUtility.current.topLevel = layoutCache.topLevel;
32+
GUILayoutUtility.current.layoutGroups = layoutCache.layoutGroups;
33+
GUILayoutUtility.current.windows = layoutCache.windows;
34+
}
35+
36+
return false;
37+
}
38+
39+
internal static void ResetGUILayoutGroup(GUILayoutGroup layoutGroup)
40+
{
41+
layoutGroup.entries.Clear();
42+
layoutGroup.isVertical = true;
43+
layoutGroup.resetCoords = false;
44+
layoutGroup.spacing = 0f;
45+
layoutGroup.sameSize = true;
46+
layoutGroup.isWindow = false;
47+
layoutGroup.windowID = -1;
48+
layoutGroup.m_Cursor = 0;
49+
layoutGroup.m_StretchableCountX = 100;
50+
layoutGroup.m_StretchableCountY = 100;
51+
layoutGroup.m_UserSpecifiedWidth = false;
52+
layoutGroup.m_UserSpecifiedHeight = false;
53+
layoutGroup.m_ChildMinWidth = 100f;
54+
layoutGroup.m_ChildMaxWidth = 100f;
55+
layoutGroup.m_ChildMinHeight = 100f;
56+
layoutGroup.m_ChildMaxHeight = 100f;
57+
layoutGroup.m_MarginLeft = 0;
58+
layoutGroup.m_MarginRight = 0;
59+
layoutGroup.m_MarginTop = 0;
60+
layoutGroup.m_MarginBottom = 0;
61+
layoutGroup.rect = new Rect(0f, 0f, 0f, 0f);
62+
layoutGroup.consideredForMargin = true;
63+
layoutGroup.m_Style = GUIStyle.none;
64+
layoutGroup.stretchWidth = 1;
65+
layoutGroup.stretchHeight = 0;
66+
layoutGroup.minWidth = 0f;
67+
layoutGroup.maxWidth = 0f;
68+
layoutGroup.minHeight = 0f;
69+
layoutGroup.maxHeight = 0f;
70+
}
71+
}
72+
}

0 commit comments

Comments
 (0)