private IEnumerator Setup() { // Wait for load yield return(VRCMenuUtilsAPI.WaitForInit()); VRCMenuUtilsAPI.AddQuickMenuButton("headlight", "Toggle Headlight", "Enables/Disables a headlight on your avatar", ToggleHeadlight); }
private IEnumerator Setup() { yield return(VRCMenuUtilsAPI.WaitForInit()); VRCMenuUtilsAPI.AddQuickMenuButton("Teleport", "Teleport", "Teleports u to a player by name", new Action(this.TELEPORT)); VRCMenuUtilsAPI.AddQuickMenuButton("SaveCurrent\nPosition", "Save\nCurrent\nPos", "Store ur current world position", new Action(this.SavePosition)); VRCMenuUtilsAPI.AddQuickMenuButton("Tp-To\nStoredPosition", "Tp-To\nStoredPos", "Teleports u to stored world position", new Action(this.TPToStoredPos)); yield break; }
private IEnumerator Setup() { // Wait for load yield return(VRCMenuUtilsAPI.WaitForInit()); // Run UI loaders LoadSocialScreen(); LoadUserInfoScreen(); }
private IEnumerator Setup() { // Wait for load yield return(VRCMenuUtilsAPI.WaitForInit()); // Add wait for page shown VRCMenuUtilsAPI.OnPageShown += VRCMenuUtilsAPI_OnPageShown; // Wait for worlds while (_worldsList == null) { yield return(null); } // Wait for favourite and recent while (_worldsList.Find("Playlist1") == null || _worldsList.Find("Recent") == null) { yield return(null); } // Grab favourites and recent Transform[] favourites = new Transform[] { _worldsList.Find("Playlist1"), _worldsList.Find("Playlist2"), _worldsList.Find("Playlist3"), _worldsList.Find("Playlist4") }; Transform recent = _worldsList.Find("Recent"); // Grab the positions foreach (Transform favourite in favourites) { _worldsPositions.Add(favourite, favourite.GetSiblingIndex()); } _worldsPositions.Add(recent, recent.GetSiblingIndex()); // Change positions ChangePositions(); // Set watchers _config.WatchForUpdate("FavouriteWorldsAtTop", () => ChangePositions()); _config.WatchForUpdate("RecentWorldsAtTop", () => ChangePositions()); VRCMenuUtilsAPI.OnPageShown -= VRCMenuUtilsAPI_OnPageShown; VRCModLogger.Log("Worlds UI positions setup!"); }
public IEnumerator Setup() { yield return(VRCMenuUtilsAPI.WaitForInit()); var DropPortalButton = new VRCEUiButton("Portal", Vector2.zero, "Drop Portal"); DropPortalButton.OnClick += () => { //VRCMenuUtilsAPI.GetPage(VRCEUi.UserInfoScreen.name).GetComponentInChildren<PageUserInfo>().user; APIUser usr = VRCEUi.UserInfoScreen.GetComponentInChildren <PageUserInfo>().user; if (usr.id == APIUser.CurrentUser.id) { VRCMenuUtilsAPI.VRCUiPopupManager.ShowAlert("Error", "You cannot drop a portal to yourself!"); return; } else if (string.IsNullOrEmpty(usr.location)) { VRCMenuUtilsAPI.VRCUiPopupManager.ShowAlert("Error", usr.displayName + " has no valid location!"); return; } else if (usr.location.ToLower() == "private") { VRCMenuUtilsAPI.VRCUiPopupManager.ShowAlert("Error", usr.displayName + " is in a private world!"); return; } else if (usr.location.ToLower() == "offline") { VRCMenuUtilsAPI.VRCUiPopupManager.ShowAlert("Error", usr.displayName + " is offline!"); return; } string id = usr.location; string[] instance = id.Split(':'); if (instance.Length == 2) { DropPortalToWorld(instance[0], instance[1]); } else { DropPortalToWorld(id); } }; VRCMenuUtilsAPI.AddUserInfoButton(DropPortalButton); }