Skip to content
This repository has been archived by the owner on Jul 28, 2022. It is now read-only.

Commit

Permalink
UI Update 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gompoc committed Nov 9, 2021
1 parent 3c97231 commit eb84d6f
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 16 deletions.
4 changes: 2 additions & 2 deletions ActionMenuUtils/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private static GoHomeDelegate GetGoHomeDelegate

public static void Respawn()
{
GameObject.Find("UserInterface/QuickMenu/ShortcutMenu/RespawnButton").GetComponent<Button>().onClick.Invoke();
GameObject.Find("UserInterface/Canvas_QuickMenu(Clone)/Container/Window/QMParent/Menu_Dashboard/ScrollRect/Viewport/VerticalLayoutGroup/Buttons_QuickActions/Button_Respawn").GetComponent<Button>().onClick.Invoke();
VRCPlayer.field_Internal_Static_VRCPlayer_0.GetComponent<VRCMotionState>().Reset();
}

Expand All @@ -59,7 +59,7 @@ public static void Home()
if (ModSettings.forceGoHome)
GoHome();
else
GameObject.Find("UserInterface/QuickMenu/ShortcutMenu/GoHomeButton").GetComponent<Button>().onClick.Invoke();
GameObject.Find("UserInterface/Canvas_QuickMenu(Clone)/Container/Window/QMParent/Menu_Dashboard/ScrollRect/Viewport/VerticalLayoutGroup/Buttons_QuickActions/Button_GoHome").GetComponent<Button>().onClick.Invoke();
}

public static void ResetAvatar()
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
### ActionMenuUtils v2.0.3
- Fixed compatibility for ui update

### ActionMenuApi v0.3.5
- Fixed compatibility for upcoming beta
- Fixed compatibility for ui update

### StandaloneThirdPerson v1.3.3
- Fixed compatibility for ui update

### ActionMenuUtils v2.0.2
- Change text on uix button to fit it better
Expand Down
6 changes: 5 additions & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
### ActionMenuUtils v2.0.3
- Fixed compatibility for ui update
### ActionMenuApi v0.3.5
- Fixed compatibility for upcoming beta
- Fixed compatibility for ui update
### StandaloneThirdPerson v1.3.3
- Fixed compatibility for ui update
9 changes: 5 additions & 4 deletions StandaloneThirdPerson/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,15 @@ private static IEnumerator WaitForUIInit()
yield return new WaitForEndOfFrame();
if (XRDevice.isPresent)
yield break;
ModSettings.RegisterSettings();
ModSettings.LoadSettings();
while (GameObject.Find("UserInterface/Canvas_QuickMenu(Clone)/Container/Window/MicButton") == null)
yield return null;
OnUIInit();
}

private static void OnUIInit()
{
ModSettings.RegisterSettings();
ModSettings.LoadSettings();

vrcCamera = GameObject.Find("Camera (eye)")?.GetComponent<Camera>();

if (vrcCamera == null)
Expand All @@ -66,7 +67,7 @@ private static void OnUIInit()
thirdPersonCamera.enabled = false;
thirdPersonCamera.transform.parent = originalCameraTransform.parent;

GameObject.Find("UserInterface/QuickMenu/MicControls").AddComponent<QMEnableDisableListener>();
GameObject.Find("UserInterface/Canvas_QuickMenu(Clone)/Container/Window/MicButton").AddComponent<QMEnableDisableListener>();

initialised = true;
}
Expand Down
4 changes: 2 additions & 2 deletions WorldPredownload/DownloadManager/DownloadComplete.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static partial class WorldDownloadManager
InviteButton.UpdateTextDownloadStopped();
FriendButton.UpdateTextDownloadStopped();
WorldButton.UpdateTextDownloadStopped();
WorldDownloadStatus.GameObject.SetText(Constants.STATUS_IDLE_TEXT);
//WorldDownloadStatus.GameObject.SetText(Constants.STATUS_IDLE_TEXT);
if (!string.IsNullOrEmpty(file)) File.Delete(file);
if (!args.Cancelled)
MelonLogger.Error(
Expand Down Expand Up @@ -77,7 +77,7 @@ private static async void OnRecompress()
InviteButton.UpdateTextDownloadStopped();
FriendButton.UpdateTextDownloadStopped();
WorldButton.UpdateTextDownloadStopped();
WorldDownloadStatus.GameObject.SetText(Constants.STATUS_IDLE_TEXT);
//WorldDownloadStatus.GameObject.SetText(Constants.STATUS_IDLE_TEXT);
switch (DownloadInfo.DownloadType)
{
case DownloadType.Friend:
Expand Down
2 changes: 1 addition & 1 deletion WorldPredownload/DownloadManager/DownloadProgress.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static partial class WorldDownloadManager
await TaskUtilities.YieldToMainThread();
if (!Downloading) return;
var text = $"Progress:{args.ProgressPercentage} %";
if (ModSettings.showStatusOnQM) WorldDownloadStatus.GameObject.SetText(text);
//if (ModSettings.showStatusOnQM) WorldDownloadStatus.GameObject.SetText(text);
//if (InviteButton.CanChangeText) InviteButton.Button.SetText(text);
if (FriendButton.CanChangeText) FriendButton.Button.SetText(text);
if (WorldButton.CanChangeText) WorldButton.Button.SetText(text);
Expand Down
4 changes: 2 additions & 2 deletions WorldPredownload/DownloadManager/WorldDownloadManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private static void DisplayWorldPopup()
new Action(delegate
{
Utilities.HideCurrentPopup();
GameObject.Find("UserInterface/QuickMenu/ShortcutMenu/WorldsButton").GetComponent<Button>().onClick
GameObject.Find("UserInterface/Canvas_QuickMenu(Clone)/Container/Window/QMParent/Menu_Dashboard/ScrollRect/Viewport/VerticalLayoutGroup/Buttons_QuickLinks/Button_Worlds").GetComponent<Button>().onClick
.Invoke();
Utilities.ShowPage(DownloadInfo.PageWorldInfo!);

Expand Down Expand Up @@ -101,7 +101,7 @@ private static void DisplayFriendPopup()
new Action(delegate
{
Utilities.HideCurrentPopup();
GameObject.Find("UserInterface/QuickMenu/ShortcutMenu/SocialButton").GetComponent<Button>().onClick
GameObject.Find("UserInterface/Canvas_QuickMenu(Clone)/Container/Window/QMParent/Menu_Dashboard/ScrollRect/Viewport/VerticalLayoutGroup/Buttons_QuickLinks/Button_Social").GetComponent<Button>().onClick
.Invoke();
_ = DownloadInfo.APIUser ?? throw new NullReferenceException("Friend User Info Null Uh Oh");
Utilities.ShowPage(DownloadInfo.PageUserInfo!);
Expand Down
2 changes: 1 addition & 1 deletion WorldPredownload/Helpers/Utilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public static void ShowDismissPopup(string title, string body, string middleButt
{
Delegates.GetShowDismissPopupDelegate(title, body, middleButtonText, buttonAction);
}


public static void ShowPage(VRCUiPage page)
{
Expand Down
2 changes: 1 addition & 1 deletion WorldPredownload/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ private void UiManagerInit()
InviteButton.Setup();
FriendButton.Setup();
WorldButton.Setup();
WorldDownloadStatus.Setup();
//WorldDownloadStatus.Setup();
HudIcon.Setup();
}

Expand Down
2 changes: 1 addition & 1 deletion WorldPredownload/Patches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ private static void Prefix()
InviteButton.UpdateTextDownloadStopped();
FriendButton.UpdateTextDownloadStopped();
WorldButton.UpdateTextDownloadStopped();
WorldDownloadStatus.GameObject.SetText(Constants.STATUS_IDLE_TEXT);
//WorldDownloadStatus.GameObject.SetText(Constants.STATUS_IDLE_TEXT);
}
}

Expand Down
3 changes: 3 additions & 0 deletions WorldPredownload/UI/WorldDownloadStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public static class WorldDownloadStatus

public static void Setup()
{
return;
GameObject = Utilities.CloneGameObject(PATH_TO_GAMEOBJECT_TO_CLONE, PATH_TO_CLONE_PARENT);
GameObject.GetRectTrans().SetAnchoredPos(Constants.DwldStatusPos);
if (ModSettings.showStatusOnQM && !ModSettings.hideQMStatusWhenInActive) GameObject.SetActive(true);
Expand All @@ -27,6 +28,7 @@ public static void Setup()

public static void Enable()
{
return;
if (GameObject != null)
{
GameObject.SetActive(true);
Expand All @@ -36,6 +38,7 @@ public static void Enable()

public static void Disable()
{
return;
if (GameObject != null)
GameObject.SetActive(false);
}
Expand Down

0 comments on commit eb84d6f

Please sign in to comment.