/// <summary> /// Turns a QMSingleButton into an arrow button. /// </summary> /// <param name="qmSingleButton">QMSingleButton you want to turn into an arrow.</param> /// <param name="arrowDirection">Direction you want the arrow to point.</param> public static void MakeArrowButton(QMSingleButton qmSingleButton, ArrowDirection arrowDirection) { var arrowSprite = QuickMenu.prop_QuickMenu_0.transform.Find("QuickMenu_NewElements/_CONTEXT/QM_Context_User_Selected/NextArrow_Button").GetComponentInChildren <Image>().sprite; if (arrowDirection == ArrowDirection.Up) { qmSingleButton.getGameObject().GetComponentInChildren <Image>().sprite = arrowSprite; qmSingleButton.getGameObject().GetComponent <RectTransform>().localRotation = Quaternion.Euler(new Vector3(0, 0, 90)); qmSingleButton.getGameObject().GetComponentInChildren <Text>().GetComponent <RectTransform>().localRotation = Quaternion.Euler(new Vector3(0, 0, -90)); } else if (arrowDirection == ArrowDirection.Down) { qmSingleButton.getGameObject().GetComponentInChildren <Image>().sprite = arrowSprite; qmSingleButton.getGameObject().GetComponent <RectTransform>().localRotation = Quaternion.Euler(new Vector3(0, 0, -90)); qmSingleButton.getGameObject().GetComponentInChildren <Text>().GetComponent <RectTransform>().localRotation = Quaternion.Euler(new Vector3(0, 0, 90)); } else if (arrowDirection == ArrowDirection.Left) { qmSingleButton.getGameObject().GetComponentInChildren <Image>().sprite = arrowSprite; qmSingleButton.getGameObject().GetComponent <RectTransform>().localRotation = Quaternion.Euler(new Vector3(0, 0, 180)); qmSingleButton.getGameObject().GetComponentInChildren <Text>().GetComponent <RectTransform>().localRotation = Quaternion.Euler(new Vector3(0, 0, -180)); } else if (arrowDirection == ArrowDirection.Right) { qmSingleButton.getGameObject().GetComponentInChildren <Image>().sprite = arrowSprite; } }
public override void OnStart() { FOVChangerMenu = new QMNestedButton(UI.mainMenuP1, 1, 1, "FOV\nMenu", "Field Of View Menu"); FOVUp = new QMHalfButton(FOVChangerMenu, 2, -0.5f, "▲", new Action(() => { if (GlobalUtils.cameraFOV < 100) { GlobalUtils.cameraFOV++; } Wrapper.GetPlayerCamera().GetComponent <Camera>().fieldOfView = GlobalUtils.cameraFOV; resetFOV.setButtonText("Reset\nFOV\n[" + GlobalUtils.cameraFOV + "]"); }), "Fly Speed Up"); FOVDown = new QMHalfButton(FOVChangerMenu, 2, 0.5f, "▼", new Action(() => { if (GlobalUtils.cameraFOV > 0) { GlobalUtils.cameraFOV--; } Wrapper.GetPlayerCamera().GetComponent <Camera>().fieldOfView = GlobalUtils.cameraFOV; resetFOV.setButtonText("Reset\nFOV\n[" + GlobalUtils.cameraFOV + "]"); }), "Fly Speed Down"); FOVUpX = new QMHalfButton(FOVChangerMenu, 3, -0.5f, "▲▲▲", new Action(() => { if (GlobalUtils.cameraFOV < 100) { GlobalUtils.cameraFOV += 3; } Wrapper.GetPlayerCamera().GetComponent <Camera>().fieldOfView = GlobalUtils.cameraFOV; resetFOV.setButtonText("Reset\nFOV\n[" + GlobalUtils.cameraFOV + "]"); }), "Fly Speed Up 3X"); FOVDownX = new QMHalfButton(FOVChangerMenu, 3, 0.5f, "▼▼▼", new Action(() => { if (GlobalUtils.cameraFOV > 0) { GlobalUtils.cameraFOV -= 3; } Wrapper.GetPlayerCamera().GetComponent <Camera>().fieldOfView = GlobalUtils.cameraFOV; resetFOV.setButtonText("Reset\nFOV\n[" + GlobalUtils.cameraFOV + "]"); }), "Fly Speed Down 3X"); resetFOV = new QMSingleButton(FOVChangerMenu, 1, 0, "Reset\nFOV\n[" + GlobalUtils.cameraFOV + "]", new Action(() => { GlobalUtils.cameraFOV = 60; Wrapper.GetPlayerCamera().GetComponent <Camera>().fieldOfView = GlobalUtils.cameraFOV; resetFOV.setButtonText("Reset\nFOV\n[" + GlobalUtils.cameraFOV + "]"); }), "Reset To Default Field Of View [60]"); Wrapper.GetPlayerCamera().GetComponent <Camera>().fieldOfView = GlobalUtils.cameraFOV; }
private static void EditMenu_4() { QMSingleButton tmpBtn = null; tmpBtn = new QMSingleButton("UIElementsMenu4", 5, 0, " ", () => { QuickMenuStuff.ShowQuickmenuPage("UIElementsMenu3"); }, "Go to prev page"); tmpBtn.gameObject.GetComponentInChildren <Image>().sprite = imgPageUp.sprite; tmpBtn.gameObject.GetComponentInChildren <Image>().material = imgPageUp.material; tmpBtn = new QMSingleButton("UIElementsMenu4", 5, 1, " ", () => { QuickMenuStuff.ShowQuickmenuPage("UIElementsMenu"); }, "Go to next page"); tmpBtn.gameObject.GetComponentInChildren <Image>().sprite = imgPageDown.sprite; tmpBtn.gameObject.GetComponentInChildren <Image>().material = imgPageDown.material; GameObject UIEM4_Back = UnityEngine.Object.Instantiate <GameObject>(button.gameObject, QuickTools.quickTransform.Find("UIElementsMenu4"), true); UIEM4_Back.GetComponentInChildren <Text>().text = "Back\n(4 of 4)"; UIEM4_Back.GetComponent <Button>().onClick = clickEvent; }
public override void OnStart() { userUtilsMenu = new QMNestedButton("UserInteractMenu", 4, 2, "Utils", "User Utils"); forceClone = new QMSingleButton(userUtilsMenu, 1, 0, "Force\nClone", new Action(() => { try { ApiAvatar avatar = Wrapper.GetQuickMenu().GetSelectedPlayer().field_Internal_VRCPlayer_0.prop_ApiAvatar_0; if (avatar.releaseStatus != "private") { new PageAvatar { avatar = new SimpleAvatarPedestal { field_Internal_ApiAvatar_0 = new ApiAvatar { id = avatar.id } } } } .ChangeToSelectedAvatar();
private static void EditMenu_1() { QMSingleButton tmpBtn = null; tmpBtn = new QMSingleButton("UIElementsMenu", 5, 0, " ", () => { QuickMenuStuff.ShowQuickmenuPage("UIElementsMenu4"); }, "Go to prev page"); tmpBtn.gameObject.GetComponentInChildren <Image>().sprite = imgPageUp.sprite; tmpBtn.gameObject.GetComponentInChildren <Image>().material = imgPageUp.material; tmpBtn = new QMSingleButton("UIElementsMenu", 5, 1, " ", () => { QuickMenuStuff.ShowQuickmenuPage("UIElementsMenu2"); }, "Go to next page"); tmpBtn.gameObject.GetComponentInChildren <Image>().sprite = imgPageDown.sprite; tmpBtn.gameObject.GetComponentInChildren <Image>().material = imgPageDown.material; button = QuickTools.quickTransform.Find("UIElementsMenu/BackButton"); clickEvent = button.GetComponent <Button>().onClick; button.GetComponentInChildren <Text>().text = "Back\n(1 of 4)"; RectTransform rTransform = button.transform.MonoCast <RectTransform>(); rTransform.anchoredPosition += Vector2.right * (420 * 1); rTransform.anchoredPosition += Vector2.down * (420 * 0); }
private void OnUIInit() { QMSingleButton CopyIDButton = new QMSingleButton( "ShortcutMenu", ButtonsX.Value, ButtonsY.Value, "Copy\nInstance ID", delegate() { Clipboard.SetText($"{RoomManager.field_Internal_Static_ApiWorld_0.id}:{RoomManager.field_Internal_Static_ApiWorldInstance_0.instanceId}"); }, "Copy the ID of the current instance." ); QMSingleButton JoinInstanceButton = new QMSingleButton( "ShortcutMenu", ButtonsX.Value, ButtonsY.Value, "Join\nInstance", delegate() { new PortalInternal().Method_Private_Void_String_String_PDM_0(Clipboard.GetText().Split(':')[0], Clipboard.GetText().Split(':')[1]); }, "Join an instance via your clipboard." ); Misc.ChangeButtonSize(CopyIDButton.getGameObject(), 420, 210); Misc.ChangeButtonSize(JoinInstanceButton.getGameObject(), 420, 210); Misc.MoveButton(CopyIDButton.getGameObject(), CopyIDButton.getGameObject().GetComponent <RectTransform>().localPosition.x, CopyIDButton.getGameObject().GetComponent <RectTransform>().localPosition.y + 105); Misc.MoveButton(JoinInstanceButton.getGameObject(), JoinInstanceButton.getGameObject().GetComponent <RectTransform>().localPosition.x, JoinInstanceButton.getGameObject().GetComponent <RectTransform>().localPosition.y - 105); }
public static void Init() { menu = new QMNestedButton("UIElementsMenu", 0, 0, "Component\nToggle", "Opens a menu for toggling various components in VRChat."); menu.getBackButton().setLocation(0, 0); TogglePickup = new QMToggleButton(menu, 1, 0, "VRC_Pickup", () => { Main.VRC_Pickup.Value = true; VRCPickup.Toggle(); }, "Disabled", () => { Main.VRC_Pickup.Value = false; VRCPickup.Toggle(); }, "TOGGLE: Keep Objects visible, but disable you being able to pick them up."); TogglePickupObject = new QMToggleButton(menu, 2, 0, "Pickup Objects", () => { Main.VRC_Pickup_Objects.Value = true; VRCPickup.Toggle(); }, "Disabled", () => { Main.VRC_Pickup_Objects.Value = false; VRCPickup.Toggle(); }, "TOGGLE: Change the visibility of pickup-able objects"); ToggleVideoPlayers = new QMToggleButton(menu, 3, 0, "Video Players", () => { Main.VRC_SyncVideoPlayer.Value = true; _VRCSyncVideoPlayer.Toggle(); }, "Disabled", () => { _VRCSyncVideoPlayer.OnLevelLoad(); Main.VRC_SyncVideoPlayer.Value = false; _VRCSyncVideoPlayer.Toggle(); }, "TOGGLE: Video Players"); TogglePens = new QMToggleButton(menu, 4, 0, "Pens", () => { Main.Pens.Value = true; Pens.Toggle(); }, "Disabled", () => { Main.Pens.Value = false; Pens.Toggle(); }, "TOGGLE: Pens & Erasers"); ToggleStation = new QMToggleButton(menu, 1, 1, "Chairs", () => { Main.VRC_Station.Value = true; }, "Disabled", () => { Main.VRC_Station.Value = false; }, "TOGGLE: Ability to sit in chairs"); ToggleMirror = new QMToggleButton(menu, 2, 1, "Mirrors", () => { Main.VRC_MirrorReflect.Value = true; VRCMirrorReflect.Toggle(); }, "Disabled", () => { Main.VRC_MirrorReflect.Value = false; VRCMirrorReflect.Toggle(); }, "TOGGLE: All Mirrors"); TogglePostProcessing = new QMToggleButton(menu, 3, 1, "PostProcessing", () => { Main.PostProcessing.Value = true; PostProcessing.Toggle(); }, "Disabled", () => { Main.PostProcessing.Value = false; PostProcessing.Toggle(); }, "TOGGLE: Post Processing"); TogglePedestal = new QMToggleButton(menu, 4, 1, "Avatar\nPedestals", () => { Main.VRC_AvatarPedestal.Value = true; VRCAvatarPedestal.Revert(); }, "Disabled", () => { Main.VRC_AvatarPedestal.Value = false; VRCAvatarPedestal.Disable(); }, "TOGGLE: Avatar Pedestals throughout the world"); RefreshButton = new QMSingleButton(menu, 4, -2, "Refresh", () => { VRCPickup.OnLevelLoad(); _VRCSyncVideoPlayer.OnLevelLoad(); Pens.OnLevelLoad(); Patches.PatchVRC_Station(); PostProcessing.OnLevelLoad(); _VRCSyncVideoPlayer.OnLevelLoad(); VRCAvatarPedestal.OnLevelLoad(); VRCMirrorReflect.OnLevelLoad(); }, "Pressing this will attempt to recache all objects in the world.\nThis is the same thing as if you rejoin the world."); RefreshButton.getGameObject().GetComponent <RectTransform>().sizeDelta /= new Vector2(1.0f, 2.0f); RefreshButton.getGameObject().GetComponent <RectTransform>().anchoredPosition += new Vector2(0f, -105f); menu.getMainButton().getGameObject().name = "CTMenu"; // Sets Toggle States on UI Init setAllButtonToggleStates(false); }
public override void VRChat_OnUiManagerInit() { videoLibrary = new QMNestedButton("ShortcutMenu", -10, 0, "", "", null, null, null, null); videoLibrary.getMainButton().getGameObject().GetComponentInChildren <Image>().enabled = false; videoLibrary.getMainButton().getGameObject().GetComponentInChildren <Text>().enabled = false; ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.QuickMenu, "Video\nLibrary", delegate { videoLibrary.getMainButton().getGameObject().GetComponent <Button>().Press(); }); var indexButton = new QMSingleButton(videoLibrary, 4, 1, "Page:\n" + (currentMenuIndex + 1).ToString() + " of " + (indexNumber + 1).ToString(), delegate { }, "", Color.clear, Color.yellow); indexButton.getGameObject().GetComponentInChildren <Button>().enabled = false; indexButton.getGameObject().GetComponentInChildren <Image>().enabled = false; previousButton = new QMSingleButton(videoLibrary, 4, 0, "Previous\nPage", delegate { if (currentMenuIndex != 0) { currentMenuIndex--; } foreach (ModVideo videoButton in videoList) { if (videoButton.IndexNumber != currentMenuIndex) { videoButton.VideoButton.setActive(false); } else { videoButton.VideoButton.setActive(true); } } indexButton.setButtonText("Page:\n" + (currentMenuIndex + 1).ToString() + " of " + (indexNumber + 1).ToString()); }, "Previous video page", null, null); nextButton = new QMSingleButton(videoLibrary, 4, 2, "Next\nPage", delegate { if (currentMenuIndex != indexNumber) { currentMenuIndex++; } foreach (ModVideo videoButton in videoList) { if (videoButton.IndexNumber != currentMenuIndex) { videoButton.VideoButton.setActive(false); } else { videoButton.VideoButton.setActive(true); } } indexButton.setButtonText("Page:\n" + (currentMenuIndex + 1).ToString() + " of " + (indexNumber + 1).ToString()); }, "Previous video page", null, null); var openReadMe = new QMSingleButton(videoLibrary, 5, 0, "Read\nMe", delegate { Process.Start("https://github.com/UshioHiko/VRCVideoLibrary/blob/master/README.md"); }, "Opens a link to the mod's \"Read Me\""); var openListButton = new QMSingleButton(videoLibrary, 5, -1, "Open\nLibrary\nDocument", delegate { OpenVideoLibrary(); }, "Opens the Video Library text document\nLibrary Format: \"Button Name|Video Url\"", null, null); var getLinkToggle = new QMToggleButton(videoLibrary, 5, 1, "Buttons Copy\nVideo Link", delegate { getLink = true; }, "Disabled", delegate { getLink = false; }, "Makes video library buttons copy video url to your system clipboard", null, null, false, false); foreach (ModVideo video in videoList) { if (video.VideoNumber == 0) { var vidButton = new QMSingleButton(videoLibrary, 1, 0, video.VideoName, delegate { if (getLink) { video.GetLink(); } else { MelonCoroutines.Start(video.AddVideo(onCooldown)); if (!onCooldown) { MelonCoroutines.Start(CoolDown()); } } }, $"Puts {video.VideoName} on the video player", null, null); video.VideoButton = vidButton; } else if (video.VideoNumber == 1) { var vidButton = new QMSingleButton(videoLibrary, 2, 0, video.VideoName, delegate { if (getLink) { video.GetLink(); } else { MelonCoroutines.Start(video.AddVideo(onCooldown)); if (!onCooldown) { MelonCoroutines.Start(CoolDown()); } } }, $"Puts {video.VideoName} on the video player", null, null); video.VideoButton = vidButton; } else if (video.VideoNumber == 2) { var vidButton = new QMSingleButton(videoLibrary, 3, 0, video.VideoName, delegate { if (getLink) { video.GetLink(); } else { MelonCoroutines.Start(video.AddVideo(onCooldown)); if (!onCooldown) { MelonCoroutines.Start(CoolDown()); } } }, $"Puts {video.VideoName} on the video player", null, null); video.VideoButton = vidButton; } else if (video.VideoNumber == 3) { var vidButton = new QMSingleButton(videoLibrary, 1, 1, video.VideoName, delegate { if (getLink) { video.GetLink(); } else { MelonCoroutines.Start(video.AddVideo(onCooldown)); if (!onCooldown) { MelonCoroutines.Start(CoolDown()); } } }, $"Puts {video.VideoName} on the video player", null, null); video.VideoButton = vidButton; } else if (video.VideoNumber == 4) { var vidButton = new QMSingleButton(videoLibrary, 2, 1, video.VideoName, delegate { if (getLink) { video.GetLink(); } else { MelonCoroutines.Start(video.AddVideo(onCooldown)); if (!onCooldown) { MelonCoroutines.Start(CoolDown()); } } }, $"Puts {video.VideoName} on the video player", null, null); video.VideoButton = vidButton; } else if (video.VideoNumber == 5) { var vidButton = new QMSingleButton(videoLibrary, 3, 1, video.VideoName, delegate { if (getLink) { video.GetLink(); } else { MelonCoroutines.Start(video.AddVideo(onCooldown)); if (!onCooldown) { MelonCoroutines.Start(CoolDown()); } } }, $"Puts {video.VideoName} on the video player", null, null); video.VideoButton = vidButton; } else if (video.VideoNumber == 6) { var vidButton = new QMSingleButton(videoLibrary, 1, 2, video.VideoName, delegate { if (getLink) { video.GetLink(); } else { MelonCoroutines.Start(video.AddVideo(onCooldown)); if (!onCooldown) { MelonCoroutines.Start(CoolDown()); } } }, $"Puts {video.VideoName} on the video player", null, null); video.VideoButton = vidButton; } else if (video.VideoNumber == 7) { var vidButton = new QMSingleButton(videoLibrary, 2, 2, video.VideoName, delegate { if (getLink) { video.GetLink(); } else { MelonCoroutines.Start(video.AddVideo(onCooldown)); if (!onCooldown) { MelonCoroutines.Start(CoolDown()); } } }, $"Puts {video.VideoName} on the video player", null, null); video.VideoButton = vidButton; } else if (video.VideoNumber == 8) { var vidButton = new QMSingleButton(videoLibrary, 3, 2, video.VideoName, delegate { if (getLink) { video.GetLink(); } else { MelonCoroutines.Start(video.AddVideo(onCooldown)); if (!onCooldown) { MelonCoroutines.Start(CoolDown()); } } }, $"Puts {video.VideoName} on the video player", null, null); video.VideoButton = vidButton; } if (video.IndexNumber != currentMenuIndex) { video.VideoButton.setActive(false); } } if (videoList.Count <= 9) { previousButton.setIntractable(false); nextButton.setIntractable(false); } }
public void BuildList() { for (int i = 0; i < videoList.Count; i++) { ModVideo video = videoList[i]; switch (video.VideoNumber) { case 0: { var vidButton = new QMSingleButton(videoLibrary, 1, 0, video.VideoName, delegate { if (getLink) { video.GetLink(); } else { video.AddVideo(onCooldown); if (!onCooldown) { MelonCoroutines.Start(CoolDown()); } } }, $"Puts {video.VideoName} on the video player", null, null); video.VideoButton = vidButton; vidButton.getGameObject().GetComponentInChildren <Text>().resizeTextForBestFit = true; break; } case 1: { var vidButton = new QMSingleButton(videoLibrary, 2, 0, video.VideoName, delegate { if (getLink) { video.GetLink(); } else { video.AddVideo(onCooldown); if (!onCooldown) { MelonCoroutines.Start(CoolDown()); } } }, $"Puts {video.VideoName} on the video player", null, null); video.VideoButton = vidButton; vidButton.getGameObject().GetComponentInChildren <Text>().resizeTextForBestFit = true; break; } case 2: { var vidButton = new QMSingleButton(videoLibrary, 3, 0, video.VideoName, delegate { if (getLink) { video.GetLink(); } else { video.AddVideo(onCooldown); if (!onCooldown) { MelonCoroutines.Start(CoolDown()); } } }, $"Puts {video.VideoName} on the video player", null, null); video.VideoButton = vidButton; vidButton.getGameObject().GetComponentInChildren <Text>().resizeTextForBestFit = true; break; } case 3: { var vidButton = new QMSingleButton(videoLibrary, 1, 1, video.VideoName, delegate { if (getLink) { video.GetLink(); } else { video.AddVideo(onCooldown); if (!onCooldown) { MelonCoroutines.Start(CoolDown()); } } }, $"Puts {video.VideoName} on the video player", null, null); video.VideoButton = vidButton; vidButton.getGameObject().GetComponentInChildren <Text>().resizeTextForBestFit = true; break; } case 4: { var vidButton = new QMSingleButton(videoLibrary, 2, 1, video.VideoName, delegate { if (getLink) { video.GetLink(); } else { video.AddVideo(onCooldown); if (!onCooldown) { MelonCoroutines.Start(CoolDown()); } } }, $"Puts {video.VideoName} on the video player", null, null); video.VideoButton = vidButton; vidButton.getGameObject().GetComponentInChildren <Text>().resizeTextForBestFit = true; break; } case 5: { var vidButton = new QMSingleButton(videoLibrary, 3, 1, video.VideoName, delegate { if (getLink) { video.GetLink(); } else { video.AddVideo(onCooldown); if (!onCooldown) { MelonCoroutines.Start(CoolDown()); } } }, $"Puts {video.VideoName} on the video player", null, null); video.VideoButton = vidButton; vidButton.getGameObject().GetComponentInChildren <Text>().resizeTextForBestFit = true; break; } case 6: { var vidButton = new QMSingleButton(videoLibrary, 1, 2, video.VideoName, delegate { if (getLink) { video.GetLink(); } else { video.AddVideo(onCooldown); if (!onCooldown) { MelonCoroutines.Start(CoolDown()); } } }, $"Puts {video.VideoName} on the video player", null, null); video.VideoButton = vidButton; vidButton.getGameObject().GetComponentInChildren <Text>().resizeTextForBestFit = true; break; } case 7: { var vidButton = new QMSingleButton(videoLibrary, 2, 2, video.VideoName, delegate { if (getLink) { video.GetLink(); } else { video.AddVideo(onCooldown); if (!onCooldown) { MelonCoroutines.Start(CoolDown()); } } }, $"Puts {video.VideoName} on the video player", null, null); video.VideoButton = vidButton; vidButton.getGameObject().GetComponentInChildren <Text>().resizeTextForBestFit = true; break; } case 8: { var vidButton = new QMSingleButton(videoLibrary, 3, 2, video.VideoName, delegate { if (getLink) { video.GetLink(); } else { video.AddVideo(onCooldown); if (!onCooldown) { MelonCoroutines.Start(CoolDown()); } } }, $"Puts {video.VideoName} on the video player", null, null); video.VideoButton = vidButton; vidButton.getGameObject().GetComponentInChildren <Text>().resizeTextForBestFit = true; break; } } if (video.IndexNumber != currentMenuIndex) { video.VideoButton.setActive(false); } } indexButton.setButtonText("Page:\n" + (currentMenuIndex + 1).ToString() + " of " + (indexNumber + 1).ToString()); }
private IEnumerator LoadMenu() { while (!libraryInitialized) { yield return(null); } indexButton = new QMSingleButton(videoLibrary, 4, 1, "Page:\n" + (currentMenuIndex + 1).ToString() + " of " + (indexNumber + 1).ToString(), delegate { }, "", Color.clear, Color.yellow); indexButton.getGameObject().GetComponentInChildren <Button>().enabled = false; indexButton.getGameObject().GetComponentInChildren <Image>().enabled = false; previousButton = new QMSingleButton(videoLibrary, 4, 0, "Previous\nPage", delegate { if (currentMenuIndex != 0) { currentMenuIndex--; } foreach (ModVideo videoButton in videoList) { if (videoButton.IndexNumber != currentMenuIndex) { videoButton.VideoButton.setActive(false); } else { videoButton.VideoButton.setActive(true); } } indexButton.setButtonText("Page:\n" + (currentMenuIndex + 1).ToString() + " of " + (indexNumber + 1).ToString()); }, "Previous video page", null, null); nextButton = new QMSingleButton(videoLibrary, 4, 2, "Next\nPage", delegate { if (currentMenuIndex != indexNumber) { currentMenuIndex++; } foreach (ModVideo videoButton in videoList) { if (videoButton.IndexNumber != currentMenuIndex) { videoButton.VideoButton.setActive(false); } else { videoButton.VideoButton.setActive(true); } } indexButton.setButtonText("Page:\n" + (currentMenuIndex + 1).ToString() + " of " + (indexNumber + 1).ToString()); }, "Previous video page", null, null); var videoFromClipboard = new QMSingleButton(videoLibrary, 1, -2, "Video From\nClipboard", delegate { MelonCoroutines.Start(ModVideo.VideoFromClipboard(onCooldown)); }, "Puts the link in your system clipboard into the world's video player"); var openListButton = new QMSingleButton(videoLibrary, 2, -2, "Open\nLibrary\nDocument", delegate { OpenVideoLibrary(); }, "Opens the Video Library text document\nLibrary Format: \"Button Name|Video Url\"", null, null); var openReadMe = new QMSingleButton(videoLibrary, 3, -2, "Read\nMe", delegate { Process.Start("https://github.com/UshioHiko/VRCVideoLibrary/blob/master/README.md"); }, "Opens a link to the mod's \"Read Me\""); var getLinkToggle = new QMToggleButton(videoLibrary, 4, -2, "Buttons Copy\nVideo Link", delegate { getLink = true; }, "Disabled", delegate { getLink = false; }, "Makes video library buttons copy video url to your system clipboard", null, null, false, false); var refreshList = new QMSingleButton(videoLibrary, 5, -2, "Refresh\nList", delegate { DeleteButtons(); ClearButtons(); GetVideoLibrary(); BuildList(); }, "Refreshes the list"); BuildList(); if (videoList.Count <= 9) { previousButton.setIntractable(false); nextButton.setIntractable(false); } }
public override void OnStart() { // Инициализация меню mainMenuP1 = new QMNestedButton("ShortcutMenu", 5, 2, "Utils", "Ice Burn Utils"); mainMenuP2 = new QMNestedButton(mainMenuP1, 5, 1, "Next\nPage", "Page 2"); mainMenuP3 = new QMNestedButton(mainMenuP2, 5, 1, "Next\nPage", "Page 3"); speedHackMenu = new QMNestedButton(mainMenuP1, 1, 2, "Player\nSpeed", "Speed Hack Menu"); brightnessMenu = new QMNestedButton(mainMenuP2, 1, 1, "Light\nIntensity", "Set Light Intensity"); lightMenu = new QMNestedButton(mainMenuP2, 3, 1, "Light\nMenu", "User Light Menu"); // Это просто нужно mainMenuP2.getBackButton().setButtonText("Previous\nPage"); mainMenuP3.getBackButton().setButtonText("Previous\nPage"); // Инициализация кнопок toggleESP = new QMToggleButton(mainMenuP1, 3, 0, "ESP ON", new Action(() => { GlobalUtils.ESP = true; var allPlayers = PlayerWrapper.GetAllPlayers().ToArray(); for (int i = 0; i < allPlayers.Length; i++) { Transform sRegion = allPlayers[i].transform.Find("SelectRegion"); if (sRegion != null) { sRegion.GetComponent <Renderer>().sharedMaterial.SetColor("_Color", Color.red); Renderer testRenderer = allPlayers[i].field_Internal_VRCPlayer_0.namePlate.gameObject.GetComponent <Renderer>(); HighlightsFX.prop_HighlightsFX_0.EnableOutline(testRenderer, GlobalUtils.ESP); HighlightsFX.prop_HighlightsFX_0.EnableOutline(sRegion.GetComponent <Renderer>(), GlobalUtils.ESP); } } IceLogger.Log("ESP has been Enabled"); }), "ESP OFF", new Action(() => { GlobalUtils.ESP = false; var allPlayers = PlayerWrapper.GetAllPlayers().ToArray(); for (int i = 0; i < allPlayers.Length; i++) { Transform sRegion = allPlayers[i].transform.Find("SelectRegion"); if (sRegion != null) { sRegion.GetComponent <Renderer>().sharedMaterial.SetColor("_Color", Color.red); HighlightsFX.prop_HighlightsFX_0.EnableOutline(sRegion.GetComponent <Renderer>(), GlobalUtils.ESP); } } IceLogger.Log("ESP has been Disabled"); }), "Toggle ESP"); void updatepointlist() { // Remove old Buttons foreach (QMHalfButton item in tPointList) { item.DestroyMe(); } tPointList.Clear(); removeAllPointsToTeleport.setTextColor(Color.red); if (pointTeleportList.Count < 24) { createNewPointToTeleport.setActive(true); } else { createNewPointToTeleport.setActive(false); } int localX = 1; float localY = -0.5f; foreach (GameObject point in pointTeleportList) { QMHalfButton tmpButton = new QMHalfButton(pointTeleportMenu, localX, localY, point.name, new Action(() => { try { IceLogger.Log("Trying Teleport TO: [" + point.name + "]"); PlayerWrapper.GetCurrentPlayer().transform.position = point.transform.position; } catch (Exception ex) { IceLogger.Error(ex.ToString()); } }), "Teleport To " + point.name); localX++; if (localX > 4) { localX = 1; localY += 1f; } tPointList.Add(tmpButton); } if (pointTeleportList.Count < 24) { createNewPointToTeleport.setActive(true); } else { createNewPointToTeleport.setActive(false); } } pointTeleportMenu = new QMNestedButton(mainMenuP1, 2, 1, "Point\nTeleport", new Action(() => { updatepointlist(); }), "Teleport TO Points"); removeAllPointsToTeleport = new QMHalfButton(pointTeleportMenu, 5, 2.5f, "Remove All", new Action(() => { foreach (QMHalfButton buttons in tPointList) { buttons.DestroyMe(); } tPointList.Clear(); pointTeleportList.Clear(); if (pointTeleportList.Count < 24) { createNewPointToTeleport.setActive(true); } else { createNewPointToTeleport.setActive(false); } }), "Remove All Points"); createNewPointToTeleport = new QMHalfButton(pointTeleportMenu, 5, 1.5f, "Create New", new Action(() => { Transform tmpPlayerTransform = PlayerWrapper.GetCurrentPlayer().gameObject.transform; GameObject tmpPointGO = GameObject.Instantiate(new GameObject(), tmpPlayerTransform); Text tmpPointGOText = tmpPointGO.AddComponent <Text>(); //tmpPointGOText.font = Resources.GetBuiltinResource(Il2CppSystem.Type.typeof(Font), "BankGothicLight.ttf") as Font; tmpPointGOText.text = PlayerWrapper.GetCurrentPlayer().transform.position.ToString(); tmpPointGO.name = tmpPointGOText.text; pointTeleportList.Add(tmpPointGO); updatepointlist(); }), "Create New Point"); quitApp = new QMSingleButton("UIElementsMenu", 5, 2, "Quit\nGame", new Action(() => { Process.GetCurrentProcess().Kill(); UnityEngine.Application.Quit(); }), "Quit Game", null, Color.red); resetWalkSpeed = new QMSingleButton(speedHackMenu, 1, 0, "Reset\nSpeed\n[" + GlobalUtils.walkSpeed + "]", new Action(() => { GlobalUtils.walkSpeed = 2; GlobalUtils.UpdatePlayerSpeed(); resetWalkSpeed.setButtonText("Reset\nSpeed\n[" + GlobalUtils.walkSpeed + "]"); }), "Reset Speed To Default [2]"); WalkSpeedUp = new QMHalfButton(speedHackMenu, 2, -0.5f, "▲", new Action(() => { GlobalUtils.walkSpeed++; GlobalUtils.UpdatePlayerSpeed(); resetWalkSpeed.setButtonText("Reset\nSpeed\n[" + GlobalUtils.walkSpeed + "]"); }), "Speed UP"); WalkSpeedDown = new QMHalfButton(speedHackMenu, 2, 0.5f, "▼", new Action(() => { GlobalUtils.walkSpeed--; GlobalUtils.UpdatePlayerSpeed(); resetWalkSpeed.setButtonText("Reset\nSpeed\n[" + GlobalUtils.walkSpeed + "]"); }), "Speed DOWN"); WalkSpeedUpX = new QMHalfButton(speedHackMenu, 3, -0.5f, "▲▲▲", new Action(() => { GlobalUtils.walkSpeed += 3; GlobalUtils.UpdatePlayerSpeed(); resetWalkSpeed.setButtonText("Reset\nSpeed\n[" + GlobalUtils.walkSpeed + "]"); }), "Speed UP 3X"); WalkSpeedDownX = new QMHalfButton(speedHackMenu, 3, 0.5f, "▼▼▼", new Action(() => { GlobalUtils.walkSpeed -= 3; GlobalUtils.UpdatePlayerSpeed(); resetWalkSpeed.setButtonText("Reset\nSpeed\n[" + GlobalUtils.walkSpeed + "]"); }), "Speed DOWN 3X"); ohShiitWalk = new QMSingleButton(speedHackMenu, 1, 2, "SHEEET", new Action(() => { GlobalUtils.walkSpeed += 1000; GlobalUtils.UpdatePlayerSpeed(); resetWalkSpeed.setButtonText("Reset\nSpeed\n[" + GlobalUtils.walkSpeed + "]"); }), "OH SHEEEEEEEEEEEEEEEEEEEET"); deleteAllPortals = new QMSingleButton(mainMenuP2, 2, 0, "Delete\nPortals", new Action(() => { (from portal in Resources.FindObjectsOfTypeAll <PortalInternal>() where portal.gameObject.activeInHierarchy && !portal.gameObject.GetComponentInParent <VRC_PortalMarker>() select portal).ToList <PortalInternal>().ForEach(delegate(PortalInternal p) { Player component = Networking.GetOwner(p.gameObject).gameObject.GetComponent <Player>(); UnityEngine.Object.Destroy(p.transform.root.gameObject); }); }), "Delete All Portals"); hideAllPortals = new QMSingleButton(mainMenuP1, 3, 1, "Hide\nPortals", new Action(() => { (from portal in Resources.FindObjectsOfTypeAll <PortalInternal>() where portal.gameObject.activeInHierarchy && !portal.gameObject.GetComponentInParent <VRC_PortalMarker>() select portal).ToList <PortalInternal>().ForEach(delegate(PortalInternal p) { Player component = Networking.GetOwner(p.gameObject).gameObject.GetComponent <Player>(); p.transform.root.gameObject.SetActive(false); }); }), "Hide All Portals"); toggleAudioBitrate = new QMToggleButton(mainMenuP1, 2, 2, "64kbps", new Action(() => { PlayerWrapper.GetCurrentPlayer().field_Private_USpeaker_0.CurrentBitrate = EnumPublicSealedvaBi15BiBiBiBiBiBiBiUnique.BitRate_64k; }), "24kbps", new Action(() => { PlayerWrapper.GetCurrentPlayer().field_Private_USpeaker_0.CurrentBitrate = EnumPublicSealedvaBi15BiBiBiBiBiBiBiUnique.BitRate_24K; }), "Toggle Audio Bitrate"); reconnectInstance = new QMSingleButton(mainMenuP1, 3, 2, "Reconnect", new Action(() => { Networking.GoToRoom(Wrapper.GetInstance().instanceWorld.id + ":" + Wrapper.GetInstance().instanceWorld.currentInstanceIdWithTags); }), "Reconnect to instance"); test = new QMSingleButton(mainMenuP1, 4, 2, "Test", new Action(() => { var allPlayers = PlayerWrapper.GetAllPlayers().ToArray(); for (int i = 0; i < allPlayers.Length; i++) { IceLogger.Log(allPlayers[i].field_Internal_VRCPlayer_0.prop_String_0); IceLogger.Log(allPlayers[i].field_Internal_VRCPlayer_0.prop_String_1); var usertags = allPlayers[i].GetAPIUser().tags; foreach (var tags in usertags) { IceLogger.Log(allPlayers[i].ToString() + " " + tags); } //Status: IceLogger.Log(allPlayers[i].field_Internal_VRCPlayer_0.field_Internal_String_1.ToString()); } IceLogger.Log(PlayerWrapper.GetCurrentPlayer().namePlate.mainText.font.name); /*var allPlayers = Wrapper.GetPlayerManager().GetAllPlayers().ToArray(); * for (int i = 0; i < allPlayers.Length; i++) * { * Image someImage = allPlayers[i].field_Internal_VRCPlayer_0.friendSprite.gameObject.AddComponent<Image>(); * someImage.rectTransform.anchoredPosition += new Vector2(-1f, 0f); * * float distance = Vector3.Distance(PlayerWrapper.GetCurrentPlayer().transform.position, allPlayers[i].transform.position); * IceLogger.Log(allPlayers[i].field_Internal_VRCPlayer_0.prop_String_0 + ": " + distance); * * IceLogger.Log(allPlayers[i].field_Internal_VRCPlayer_0.prop_String_0 + ": " + allPlayers[i].field_Internal_VRCPlayer_0.prop_String_1); * var usertags = allPlayers[i].GetAPIUser().tags; * foreach (var tags in usertags) * { * IceLogger.Log(allPlayers[i].field_Internal_VRCPlayer_0.prop_String_0 + ": " + tags); * } * }*/ }), "Test"); toggleShadows = new QMToggleButton(mainMenuP2, 3, 0, "Shadows ON", new Action(() => { foreach (Light light in Resources.FindObjectsOfTypeAll <Light>()) { light.shadows = LightShadows.Soft; light.shadowResolution = UnityEngine.Rendering.LightShadowResolution.High; } }), "Shadows OFF", new Action(() => { foreach (Light light in Resources.FindObjectsOfTypeAll <Light>()) { light.shadows = LightShadows.None; } }), "Toggle Shadows on map"); addJump = new QMSingleButton(mainMenuP2, 1, 0, "Add\nJump", new Action(() => { if (VRCPlayer.field_Internal_Static_VRCPlayer_0.gameObject.GetComponent <PlayerModComponentJump>()) { return; } else { PlayerWrapper.GetCurrentPlayer().gameObject.AddComponent <PlayerModComponentJump>(); } }), "Add JumpComponent to you"); toggleOptimizeMirror = new QMToggleButton(mainMenuP2, 4, 0, "Optimized Mirror", new Action(() => { MirrorReflection[] array = UnityEngine.Object.FindObjectsOfType <MirrorReflection>(); LayerMask mask = new LayerMask(); mask.value = 263680; for (int i = 0; i < array.Length; i++) { array[i].m_ReflectLayers = mask;//.value = 263680; } VRCSDK2.VRC_MirrorReflection[] array2 = UnityEngine.Object.FindObjectsOfType <VRCSDK2.VRC_MirrorReflection>(); for (int i = 0; i < array2.Length; i++) { array2[i].m_ReflectLayers = mask;//.value = 263680; } VRC_MirrorReflection[] array4 = UnityEngine.Object.FindObjectsOfType <VRC_MirrorReflection>(); for (int i = 0; i < array4.Length; i++) { array4[i].m_ReflectLayers = mask;//.value = -1025; } }), "Normal Mirror", new Action(() => { MirrorReflection[] array = UnityEngine.Object.FindObjectsOfType <MirrorReflection>(); LayerMask mask = new LayerMask(); mask.value = -1025; for (int i = 0; i < array.Length; i++) { array[i].m_ReflectLayers = mask;//.value = 263680; } VRCSDK2.VRC_MirrorReflection[] array2 = UnityEngine.Object.FindObjectsOfType <VRCSDK2.VRC_MirrorReflection>(); for (int i = 0; i < array2.Length; i++) { array2[i].m_ReflectLayers = mask;//.value = 263680; } VRC_MirrorReflection[] array4 = UnityEngine.Object.FindObjectsOfType <VRC_MirrorReflection>(); for (int i = 0; i < array4.Length; i++) { array4[i].m_ReflectLayers = mask;//.value = -1025; } }), "Toggle Shadows on map"); brightnessUp = new QMHalfButton(brightnessMenu, 2, -0.5f, "▲", new Action(() => { GlobalUtils.brightness += (1f / 10f); foreach (Light light in Resources.FindObjectsOfTypeAll <Light>()) { light.intensity = GlobalUtils.brightness; } resetBrightness.setButtonText("Reset\nBrightness\n[" + GlobalUtils.brightness + "]"); }), "Brightness Up"); brightnessDown = new QMHalfButton(brightnessMenu, 2, 0.5f, "▼", new Action(() => { GlobalUtils.brightness -= (1f / 10f); foreach (Light light in Resources.FindObjectsOfTypeAll <Light>()) { light.intensity = GlobalUtils.brightness; } resetBrightness.setButtonText("Reset\nBrightness\n[" + GlobalUtils.brightness + "]"); }), "Brightness Down"); resetBrightness = new QMSingleButton(brightnessMenu, 1, 0, "Reset\nBrightness\n[" + GlobalUtils.brightness + "]", new Action(() => { GlobalUtils.brightness = 1f; foreach (Light light in Resources.FindObjectsOfTypeAll <Light>()) { light.intensity = GlobalUtils.brightness; } resetBrightness.setButtonText("Reset\nBrightness\n[" + GlobalUtils.brightness + "]"); }), "Reset To Default Brightness"); toggleHand = new QMToggleButton(mainMenuP2, 2, 1, "Hand ON", new Action(() => { /*controller = PlayerWrapper.GetCurrentPlayer().prop_Player_0.prop_VRCAvatarManager_0.prop_GameObject_0.GetComponent<RootMotion.FinalIK.VRIK>(); * if (Input.GetMouseButton(1)) * { * if (controller != null) * { * switch (hand) * { * case Hand.Left: * controller.solver.leftArm.positionWeight = 1; * controller.solver.leftArm.rotationWeight = 1; * break; * case Hand.Right: * controller.solver.rightArm.positionWeight = 1; * controller.solver.rightArm.rotationWeight = 1; * break; * case Hand.Both: * controller.solver.leftArm.positionWeight = 1; * controller.solver.leftArm.rotationWeight = 1; * controller.solver.rightArm.positionWeight = 1; * controller.solver.rightArm.rotationWeight = 1; * break; * default: * break; * } * } * }*/ }), "Hand OFF", new Action(() => { }), "Toggle Sphere For Desktop Hand"); toggleOwnLight = new QMToggleButton(lightMenu, 1, 0, "Light ON", new Action(() => { PlayerLight.enabled = true; }), "Light OFF", new Action(() => { PlayerLight.enabled = false; }), "Toggle Own Light"); toggleOwnLightShadows = new QMToggleButton(lightMenu, 1, 1, "Shadows ON", new Action(() => { PlayerLight.shadows = LightShadows.Soft; PlayerLight.shadowResolution = UnityEngine.Rendering.LightShadowResolution.VeryHigh; }), "Shadows OFF", new Action(() => { PlayerLight.shadows = LightShadows.None; }), "Toggle Own Shadow"); ownLightIntUp = new QMHalfButton(lightMenu, 2, -0.5f, "▲", new Action(() => { GlobalUtils.ownBrightness += 1f / 10f; ownLightIntReset.setButtonText("Reset\nInt\n[" + GlobalUtils.ownBrightness + "]"); PlayerLight.intensity = GlobalUtils.ownBrightness; }), "Light Int UP"); ownLightIntDown = new QMHalfButton(lightMenu, 2, 0.5f, "▼", new Action(() => { if (GlobalUtils.ownBrightness <= 0) { GlobalUtils.ownBrightness = 0.1f; } GlobalUtils.ownBrightness -= 1f / 10f; ownLightIntReset.setButtonText("Reset\nInt\n[" + GlobalUtils.ownBrightness + "]"); PlayerLight.intensity = GlobalUtils.ownBrightness; }), "Light Int DOWN"); ownLightIntReset = new QMSingleButton(lightMenu, 3, 0, "Reset\nInt\n[" + GlobalUtils.ownBrightness + "]", new Action(() => { GlobalUtils.ownBrightness = 1f; PlayerLight.intensity = GlobalUtils.ownBrightness; ownLightIntReset.setButtonText("Reset\nInt\n[" + GlobalUtils.ownBrightness + "]"); }), "Reset Own Light Int"); ownLightAdd = new QMSingleButton(lightMenu, 4, 0, "Init\nLight", new Action(() => { VRCPlayer player = PlayerWrapper.GetCurrentPlayer(); GameObject def = GameObject.Instantiate(new GameObject(), player.transform); def.transform.position = player.transform.position + (player.transform.forward * 0.5f) + player.transform.up; PlayerLight = def.AddComponent <Light>(); PlayerLight.type = LightType.Point; PlayerLight.intensity = 1.0f; PlayerLight.enabled = false; IceLogger.Log("Light XPos: " + def.transform.position.x); IceLogger.Log("Light YPos: " + def.transform.position.y); IceLogger.Log("Light ZPos: " + def.transform.position.z); }), "USE ONE TIME!"); toggleGDB = new QMToggleButton(mainMenuP2, 1, 2, "GDB ON", new Action(() => { GlobalDynamicBones.AddAllCollidersToAllPlayers(); }), "GDB OFF", new Action(() => { GlobalDynamicBones.RestoreOriginalColliderList(); }), "Toggle GlobalDynamicBones"); togglePortalColliders = new QMToggleButton(mainMenuP2, 2, 2, "PortalCol. ON", new Action(() => { try { IEnumerator <PortalInternal> enumerator = UnityEngine.Object.FindObjectsOfType <PortalInternal>().GetEnumerator(); try { while (enumerator.MoveNext()) { PortalInternal portalInternal = enumerator.Current; portalInternal.gameObject.GetComponent <Collider>().enabled = true; } } finally { if (enumerator != null) { enumerator.Dispose(); } } } catch { } }), "PortalCol. OFF", new Action(() => { try { IEnumerator <PortalInternal> enumerator = UnityEngine.Object.FindObjectsOfType <PortalInternal>().GetEnumerator(); try { while (enumerator.MoveNext()) { PortalInternal portalInternal = enumerator.Current; portalInternal.gameObject.GetComponent <Collider>().enabled = false; } } finally { if (enumerator != null) { enumerator.Dispose(); } } } catch { } }), "Toggle Portal Colliders"); toggleFreeCamera = new QMToggleButton(mainMenuP2, 3, 2, "FreeCam ON", new Action(() => { GameObject playerOrigCam = Wrapper.GetPlayerCamera().gameObject; GameObject playerFreeCam = GameObject.Instantiate(playerOrigCam, playerOrigCam.transform.position, playerOrigCam.transform.rotation); playerFreeCam.name = "playerFreeCam"; GlobalUtils.FreeCam = true; }), "FreeCam OFF", new Action(() => { GlobalUtils.FreeCam = false; GlobalUtils.walkSpeed = 2; GlobalUtils.UpdatePlayerSpeed(); resetWalkSpeed.setButtonText("Reset\nSpeed\n[" + GlobalUtils.walkSpeed + "]"); GameObject.Destroy(GameObject.Find("playerFreeCam")); }), "Toggle Free Cam"); }
public override void OnStart() { //var testBtn = new QMNestedButton("ShortcutMenu", 0, 0, "lol", "BAN NAXUY!"); //var testBtn2 = new QMSingleButton(testBtn, 0, 1, "BAN!",new Action(() => Console.WriteLine("ssss")), "BAN NAXUY!"); var DoneteButton = new QMSingleButton("UIElementsMenu", 0, 0, "Donate", new Action(() => { Console.WriteLine("Thanks (^-^)"); Process.Start("https://www.donationalerts.com/r/ice_fox"); }), "Support Author Please (^-^)"); var DiscordButton = new QMSingleButton("UIElementsMenu", 0, 1, "Join us", new Action(() => { Console.WriteLine("Welcome"); Process.Start("https://discord.gg/kNDRN7k"); }), "Join us in discord server"); var Flightbutton = new QMToggleButton("UIElementsMenu", 3, 0, "Fly On", new Action(() => { GlobalUtils.DirectionalFlight = true; Physics.gravity = GlobalUtils.DirectionalFlight ? Vector3.zero : GlobalUtils.Grav; GlobalUtils.ToggleColliders(false); Console.WriteLine($"Flight has been enabled."); }), "Fly Off", new Action(() => { GlobalUtils.DirectionalFlight = false; Physics.gravity = GlobalUtils.DirectionalFlight ? Vector3.zero : GlobalUtils.Grav; GlobalUtils.ToggleColliders(true); Console.WriteLine($"Flight has been disabled."); }), "Enable or Disable Flight"); var ESPbutton = new QMToggleButton("UIElementsMenu", 4, 0, "ESP On", new Action(() => { GlobalUtils.SelectedPlayerESP = true; Console.WriteLine($"Selected ESP has been enabled."); GameObject[] array = GameObject.FindGameObjectsWithTag("Player"); for (int i = 0; i < array.Length; i++) { if (array[i].transform.Find("SelectRegion")) { array[i].transform.Find("SelectRegion").GetComponent <Renderer>().sharedMaterial.SetColor("_Color", Color.magenta); HighlightsFX.prop_HighlightsFX_0.EnableOutline(array[i].transform.Find("SelectRegion").GetComponent <Renderer>(), GlobalUtils.SelectedPlayerESP); } } foreach (VRC_Pickup pickup in Resources.FindObjectsOfTypeAll <VRC_Pickup>()) { if (pickup.gameObject.transform.Find("SelectRegion")) { pickup.gameObject.transform.Find("SelectRegion").GetComponent <Renderer>().sharedMaterial.SetColor("_Color", Color.magenta); Wrappers.GetHighlightsFX().EnableOutline(pickup.gameObject.transform.Find("SelectRegion").GetComponent <Renderer>(), GlobalUtils.SelectedPlayerESP); } } }), "ESP Off", new Action(() => { GlobalUtils.SelectedPlayerESP = false; Console.WriteLine($"Selected ESP has been disabled"); GameObject[] array = GameObject.FindGameObjectsWithTag("Player"); for (int i = 0; i < array.Length; i++) { if (array[i].transform.Find("SelectRegion")) { array[i].transform.Find("SelectRegion").GetComponent <Renderer>().sharedMaterial.SetColor("_Color", Color.magenta); HighlightsFX.prop_HighlightsFX_0.EnableOutline(array[i].transform.Find("SelectRegion").GetComponent <Renderer>(), GlobalUtils.SelectedPlayerESP); } } foreach (VRC_Pickup pickup in Resources.FindObjectsOfTypeAll <VRC_Pickup>()) { if (pickup.gameObject.transform.Find("SelectRegion")) { pickup.gameObject.transform.Find("SelectRegion").GetComponent <Renderer>().sharedMaterial.SetColor("_Color", Color.magenta); Wrappers.GetHighlightsFX().EnableOutline(pickup.gameObject.transform.Find("SelectRegion").GetComponent <Renderer>(), GlobalUtils.SelectedPlayerESP); } } }), "Enable or Disable ESP"); var JumpButton = new QMToggleButton("UIElementsMenu", 1, 1, "Jump On", new Action(() => { if (PlayerWrappers.GetCurrentPlayer() != null) { if (PlayerWrappers.GetCurrentPlayer().GetComponent <PlayerModComponentJump>() == null) { PlayerWrappers.GetCurrentPlayer().gameObject.AddComponent <PlayerModComponentJump>(); } } }), "Jump Off", new Action(() => { if (PlayerWrappers.GetCurrentPlayer() != null) { if (PlayerWrappers.GetCurrentPlayer().GetComponent <PlayerModComponentJump>() != null) { UnityEngine.GameObject.Destroy(PlayerWrappers.GetCurrentPlayer().GetComponent <PlayerModComponentJump>()); } } }), "Enable or Disable Jump"); var ForceQuitButton = new QMSingleButton("UIElementsMenu", 5, 2, "Force Quit", new Action(() => { Process.GetCurrentProcess().Kill(); }), "Quit Game"); var CloneAvatarButton = new QMSingleButton("UserInteractMenu", 4, 2, "Force Clone", new Action(() => { Console.WriteLine("Cloned Avatar"); var avi = Wrappers.GetQuickMenu().GetSelectedPlayer().field_Internal_VRCPlayer_0.prop_ApiAvatar_0; if (avi.releaseStatus != "private") { new PageAvatar { avatar = new SimpleAvatarPedestal { field_Internal_ApiAvatar_0 = new ApiAvatar { id = avi.id } } }.ChangeToSelectedAvatar(); } }), "Clone Avatar"); var DownloadAvatarButton = new QMSingleButton("UserInteractMenu", 4, 3, "Download VRCA", new Action(() => { Console.WriteLine("Downloading Avatar..."); var avatar = Wrappers.GetQuickMenu().GetSelectedPlayer().field_Internal_VRCPlayer_0.prop_ApiAvatar_0; Process.Start(avatar.assetUrl); Console.WriteLine(avatar.assetUrl); }), "Clone Avatar"); /*var CloneAvatarButton2 = new QMSingleButton("/UserInterface/MenuContent/Screens/Social", 0, 0, "Download VRCA", new Action(() => * { * Console.WriteLine("Downloading Avatar..."); * var avatar = CustomList.AList.avatarPedestal.field_Internal_ApiAvatar_0; * Process.Start("https://api.vrchat.cloud/api/1/avatars/" + avatar.id); * }), "Clone Avatar");*/ if (Input.GetKeyDown(KeyCode.F)) { if (GlobalUtils.DirectionalFlight) { Flightbutton.btnOn.SetActive(true); Flightbutton.btnOff.SetActive(false); } else { Flightbutton.btnOn.SetActive(false); Flightbutton.btnOff.SetActive(true); } } if (Input.GetKeyDown(KeyCode.O)) { if (GlobalUtils.SelectedPlayerESP) { ESPbutton.btnOn.SetActive(true); ESPbutton.btnOff.SetActive(false); } else { ESPbutton.btnOn.SetActive(false); ESPbutton.btnOff.SetActive(true); } } //не имеет смысла но пусть будет ._. /*try * { * if (Buttons.Count() == 0) * { * Transform parent = Wrappers.GetQuickMenu().transform.Find("UIElementsMenu"); * Transform parentMain = Wrappers.GetQuickMenu().transform.Find("ShortcutMenu"); * * if (parentMain != null) * { * var TPLists = ButtonAPI.CreateMenuNestedButton("Teleport List", "Teleport List", Color.white, Color.red, 1, 1, parentMain); * * var TeleportToPlayerI = ButtonAPI.CreateButton(ButtonType.Default, "Teleport", "Teleport To Player", Color.white, Color.red, -2, 1, TPLists, new Action(() => * { * * })); * * Buttons.Add(TeleportToPlayerI.gameObject); * } * if (parent != null) * { * var Flightbutton = ButtonAPI.CreateButton(ButtonType.Toggle, "Flight", "Enable/Disable Flight", Color.white, Color.red, -1, 0, parent, new Action(() => * { * GlobalUtils.DirectionalFlight = true; * Physics.gravity = GlobalUtils.DirectionalFlight ? Vector3.zero : GlobalUtils.Grav; * GlobalUtils.ToggleColliders(false); * Console.WriteLine($"Flight has been {(GlobalUtils.DirectionalFlight ? "Enabled" : "Disabled")}."); * }), new Action(() => * { * GlobalUtils.DirectionalFlight = false; * Physics.gravity = GlobalUtils.DirectionalFlight ? Vector3.zero : GlobalUtils.Grav; * GlobalUtils.ToggleColliders(true); * Console.WriteLine($"Flight has been {(GlobalUtils.DirectionalFlight ? "Enabled" : "Disabled")}."); * })); * * var ESPbutton = ButtonAPI.CreateButton(ButtonType.Toggle, "ESP", "Enable/Disable Selected ESP", Color.white, Color.red, 0, 0, parent, new Action(() => * { * GlobalUtils.SelectedPlayerESP = true; * Console.WriteLine($"Selected ESP has been {(GlobalUtils.SelectedPlayerESP ? "Enabled" : "Disabled")}."); * * GameObject[] array = GameObject.FindGameObjectsWithTag("Player"); * for (int i = 0; i < array.Length; i++) * { * if (array[i].transform.Find("SelectRegion")) * { * array[i].transform.Find("SelectRegion").GetComponent<Renderer>().sharedMaterial.SetColor("_Color", Color.magenta); * HighlightsFX.prop_HighlightsFX_0.EnableOutline(array[i].transform.Find("SelectRegion").GetComponent<Renderer>(), GlobalUtils.SelectedPlayerESP); * } * } * * foreach (VRC_Pickup pickup in Resources.FindObjectsOfTypeAll<VRC_Pickup>()) * { * if (pickup.gameObject.transform.Find("SelectRegion")) * { * pickup.gameObject.transform.Find("SelectRegion").GetComponent<Renderer>().sharedMaterial.SetColor("_Color", Color.magenta); * Wrappers.GetHighlightsFX().EnableOutline(pickup.gameObject.transform.Find("SelectRegion").GetComponent<Renderer>(), GlobalUtils.SelectedPlayerESP); * } * } * }), new Action(() => * { * GlobalUtils.SelectedPlayerESP = false; * Console.WriteLine($"Selected ESP has been {(GlobalUtils.SelectedPlayerESP ? "Enabled" : "Disabled")}."); * * GameObject[] array = GameObject.FindGameObjectsWithTag("Player"); * for (int i = 0; i < array.Length; i++) * { * if (array[i].transform.Find("SelectRegion")) * { * array[i].transform.Find("SelectRegion").GetComponent<Renderer>().sharedMaterial.SetColor("_Color", Color.magenta); * HighlightsFX.prop_HighlightsFX_0.EnableOutline(array[i].transform.Find("SelectRegion").GetComponent<Renderer>(), GlobalUtils.SelectedPlayerESP); * } * } * * foreach (VRC_Pickup pickup in Resources.FindObjectsOfTypeAll<VRC_Pickup>()) * { * if (pickup.gameObject.transform.Find("SelectRegion")) * { * pickup.gameObject.transform.Find("SelectRegion").GetComponent<Renderer>().sharedMaterial.SetColor("_Color", Color.magenta); * Wrappers.GetHighlightsFX().EnableOutline(pickup.gameObject.transform.Find("SelectRegion").GetComponent<Renderer>(), GlobalUtils.SelectedPlayerESP); * } * } * })); * * var teleportButton = ButtonAPI.CreateButton(ButtonType.Default, "Teleport", "Teleport to the selected player", Color.white, Color.red, 0, 0, Wrappers.GetQuickMenu().transform.Find("UserInteractMenu"), new Action(() => * { * Console.WriteLine("Teleporting to selected player."); * var player = PlayerWrappers.GetCurrentPlayer(); * var SelectedPlayer = Wrappers.GetQuickMenu().GetSelectedPlayer(); * player.transform.position = SelectedPlayer.transform.position; * })); * * var CloneAvatar = ButtonAPI.CreateButton(ButtonType.Default, "Clone", "Clone the selected player", Color.white, Color.red, 0, 1, Wrappers.GetQuickMenu().transform.Find("UserInteractMenu"), new Action(() => * { * Console.WriteLine("Cloned Avatar"); * var avi = Wrappers.GetQuickMenu().GetSelectedPlayer().field_Internal_VRCPlayer_0.prop_ApiAvatar_0; * * if (avi.releaseStatus != "private") * { * new PageAvatar * { * avatar = new SimpleAvatarPedestal * { * field_Internal_ApiAvatar_0 = new ApiAvatar * { * id = avi.id * } * } * }.ChangeToSelectedAvatar(); * } * })); * * var Freezebutton = ButtonAPI.CreateButton(ButtonType.Toggle, "Serialize", "Enable/Disable Custom Serialisation", Color.white, Color.red, -3, -1, parent, new Action(() => * { * GlobalUtils.Serialise = false; * Console.WriteLine($"Custom Serialisation has been Enabled."); * }), new Action(() => * { * GlobalUtils.Serialise = true; * Console.WriteLine($"Custom Serialisation has been Disabled."); * })); * * var ForceCloneButton = ButtonAPI.CreateButton(ButtonType.Toggle, "Jump", "Enable/disable jumping in the current world", Color.white, Color.red, -2, -1, parent, new Action(() => * { * if (PlayerWrappers.GetCurrentPlayer() != null) * { * if (PlayerWrappers.GetCurrentPlayer().GetComponent<PlayerModComponentJump>() == null) * { * PlayerWrappers.GetCurrentPlayer().gameObject.AddComponent<PlayerModComponentJump>(); * } * } * * Console.WriteLine($"Jumping has been Enabled."); * }), new Action(() => * { * if (PlayerWrappers.GetCurrentPlayer() != null) * { * if (PlayerWrappers.GetCurrentPlayer().GetComponent<PlayerModComponentJump>() != null) * { * UnityEngine.GameObject.Destroy(PlayerWrappers.GetCurrentPlayer().GetComponent<PlayerModComponentJump>()); * } * } * * Console.WriteLine($"Jumping has been Disabled."); * })); * * var ForceQuit = ButtonAPI.CreateButton(ButtonType.Default, "Force Quit", "Quit From Game", Color.white, Color.red, 1, 1, parent, new Action(() => * { * Process.GetCurrentProcess().Kill(); * })); * * Buttons.Add(Flightbutton.gameObject); * Buttons.Add(ESPbutton.gameObject); * Buttons.Add(CloneAvatar.gameObject); * Buttons.Add(teleportButton.gameObject); * Buttons.Add(Freezebutton.gameObject); * Buttons.Add(ForceCloneButton.gameObject); * Buttons.Add(ForceQuit.gameObject); * } * } * } * catch (Exception) { }*/ }
public override void OnStart() { flyMenu = new QMNestedButton(UI.mainMenuP1, 1, 0, "Fly\nMenu", "Fly Menu"); resetflySpeed = new QMSingleButton(flyMenu, 2, 0, "Reset\nSpeed\n[" + GlobalUtils.flySpeed + "]", new Action(() => { GlobalUtils.flySpeed = 5; resetflySpeed.setButtonText("Reset\nSpeed\n[5]"); }), "Reset Fly Speed To Default"); flySpeedUp = new QMHalfButton(flyMenu, 3, -0.5f, "▲", new Action(() => { GlobalUtils.flySpeed++; resetflySpeed.setButtonText("Reset\nSpeed\n[" + GlobalUtils.flySpeed + "]"); }), "Fly Speed Up"); flySpeedDown = new QMHalfButton(flyMenu, 3, 0.5f, "▼", new Action(() => { if (GlobalUtils.flySpeed > 0) { GlobalUtils.flySpeed--; } resetflySpeed.setButtonText("Reset\nSpeed\n[" + GlobalUtils.flySpeed + "]"); }), "Fly Speed Down"); flySpeedUpX = new QMHalfButton(flyMenu, 4, -0.5f, "▲▲▲", new Action(() => { GlobalUtils.flySpeed += 3; resetflySpeed.setButtonText("Reset\nSpeed\n[" + GlobalUtils.flySpeed + "]"); }), "Fly Speed Up"); flySpeedDownX = new QMHalfButton(flyMenu, 4, 0.5f, "▼▼▼", new Action(() => { if (GlobalUtils.flySpeed > 0) { GlobalUtils.flySpeed -= 3; } resetflySpeed.setButtonText("Reset\nSpeed\n[" + GlobalUtils.flySpeed + "]"); }), "Fly Speed Down"); toggleFly = new QMToggleButton(flyMenu, 1, 0, "Fly ON", new Action(() => { GlobalUtils.Fly = true; PlayerWrapper.GetCurrentPlayer().GetComponent <CharacterController>().enabled = false; flySpeedUp.setActive(true); flySpeedDown.setActive(true); flySpeedUpX.setActive(true); flySpeedDownX.setActive(true); resetflySpeed.setActive(true); ohShiitFly.setActive(true); IceLogger.Log("Fly has been Enabled"); }), "Fly OFF", new Action(() => { GlobalUtils.Fly = false; PlayerWrapper.GetCurrentPlayer().GetComponent <CharacterController>().enabled = true; flySpeedUp.setActive(false); flySpeedDown.setActive(false); flySpeedUpX.setActive(false); flySpeedDownX.setActive(false); resetflySpeed.setActive(false); ohShiitFly.setActive(false); IceLogger.Log("Fly has been Disabled"); }), "Toggle Fly"); ohShiitFly = new QMSingleButton(flyMenu, 1, 2, "SHEEET", new Action(() => { GlobalUtils.flySpeed += 1000; resetflySpeed.setButtonText("Reset\nSpeed\n[" + GlobalUtils.flySpeed + "]"); }), "OH SHEEEEEEEEEEEEEEEEEEEET"); toggleFly.setToggleState(false); flySpeedUp.setActive(false); flySpeedDown.setActive(false); resetflySpeed.setActive(false); flySpeedUpX.setActive(false); flySpeedDownX.setActive(false); ohShiitFly.setActive(false); }