public static Transform CreateMenuNestedButton(string text, string tooltip, Color textColor, Color backgroundColor, float x_pos, float y_pos, Transform parent) { var quickMenu = Wrappers.GetQuickMenu(); Transform menu = InstantiateGameobject("menu"); menu.name = $"MENU_INDEX_{x_pos}_{y_pos}"; CreateButton(ButtonType.Default, text, tooltip, textColor, backgroundColor, x_pos, y_pos, parent, new Action(() => { ButtonAPI.ShowCustomMenu(menu.name); })); IEnumerator enumerator = menu.transform.GetEnumerator(); while (enumerator.MoveNext()) { Il2CppSystem.Object obj = enumerator.Current; Transform btnEnum = obj.Cast <Transform>(); if (btnEnum != null) { UnityEngine.Object.Destroy(btnEnum.gameObject); } } CreateButton(ButtonType.Default, "Back", "Go Back to the previous menu", Color.cyan, Color.white, 4, 2, menu, new Action(() => { ButtonAPI.ShowCustomMenu($"MENU_INDEX_0_0"); })); return(menu); }
public static void Update() { if (!Initialised) { if (Wrappers.GetQuickMenu() != null) { CleanupUI(); //SetColorTheme(Color.green, Color.white, 0.5f); Initialised = true; } } }
public static Transform InstantiateGameobject(string type) { var quickMenu = Wrappers.GetQuickMenu(); var VrcUIManager = Wrappers.GetVRCUiManager(); switch (type) { default: return(Object.Instantiate <GameObject>(Wrappers.GetVRCUiPageManager().transform.Find("MenuContent/Screens/Settings/AudioDevicePanel/LevelText").gameObject).transform); case "back": return(Object.Instantiate <GameObject>(quickMenu.transform.Find("CameraMenu/BackButton").gameObject).transform); case "nameplates": return(Object.Instantiate <GameObject>(quickMenu.transform.Find("UIElementsMenu/ToggleNameplatesButton").gameObject).transform); case "block1": return(Object.Instantiate <GameObject>(quickMenu.transform.Find("NotificationInteractMenu/BlockButton").gameObject).transform); case "next": return(Object.Instantiate <GameObject>(quickMenu.transform.Find("QuickMenu_NewElements/_CONTEXT/QM_Context_User_Selected/NextArrow_Button").gameObject).transform); case "prev": return(Object.Instantiate <GameObject>(quickMenu.transform.Find("QuickMenu_NewElements/_CONTEXT/QM_Context_User_Selected/PreviousArrow_Button").gameObject).transform); case "emojimenu": return(Object.Instantiate <GameObject>(quickMenu.transform.Find("EmojiMenu").gameObject).transform); case "userinteractmenu": return(Object.Instantiate <GameObject>(quickMenu.transform.Find("UserInteractMenu").gameObject).transform); case "block": return(Object.Instantiate <GameObject>(quickMenu.transform.Find("UserInteractMenu/BlockButton").gameObject).transform); case "menu": return(Object.Instantiate <GameObject>(quickMenu.transform.Find("CameraMenu").gameObject).transform); case "favorite": return(Object.Instantiate <GameObject>(VrcUIManager.transform.Find("MenuContent/Screens/Avatar/ButtonCreate").gameObject).transform); } }
public override void OnUpdate() { try { if (Wrappers.GetQuickMenu().transform.Find("ShortcutMenu/BuildNumText") != null) { Wrappers.GetQuickMenu().transform.Find("ShortcutMenu/BuildNumText").GetComponentInChildren <Text>().text = "<color=red>Quality of Life</color> for <color=cyan>Build 921</color>"; } if (Input.GetKeyDown(KeyCode.F9)) { var avi = Wrappers.GetQuickMenu().GetSelectedPlayer().field_VRCPlayer_0.prop_ApiAvatar_0; if (avi.releaseStatus != "private") { VRC.Core.API.SendRequest($"avatars/{avi.id}", VRC.Core.BestHTTP.HTTPMethods.Get, new ApiModelContainer <ApiAvatar>(), null, true, false, 3600f, 2, null); new PageAvatar { avatar = new SimpleAvatarPedestal { field_ApiAvatar_0 = new ApiAvatar { id = avi.id } } }.ChangeToSelectedAvatar(); } } if (Input.GetKeyDown(KeyCode.F10)) { GlobalUtils.DirectionalFlight = !GlobalUtils.DirectionalFlight; Physics.gravity = GlobalUtils.DirectionalFlight ? Vector3.zero : GlobalUtils.Grav; if (!GlobalUtils.DirectionalFlight) { GlobalUtils.ToggleColliders(true); } UIButtons.ToggleUIButton(0, GlobalUtils.DirectionalFlight); MelonModLogger.Log($"Flight has been {(GlobalUtils.DirectionalFlight ? "Enabled" : "Disabled")}."); } if (Input.GetKeyDown(KeyCode.F11)) { GlobalUtils.SelectedPlayerESP = !GlobalUtils.SelectedPlayerESP; MelonModLogger.Log($"Selected ESP has been {(GlobalUtils.SelectedPlayerESP ? "Enabled" : "Disabled")}."); UIButtons.ToggleUIButton(1, GlobalUtils.SelectedPlayerESP); 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); } } } if (GlobalUtils.DirectionalFlight) { GameObject gameObject = Wrappers.GetPlayerCamera(); var currentSpeed = (Input.GetKey(KeyCode.LeftShift) ? 16f : 8f); var player = PlayerWrappers.GetCurrentPlayer(); if (Input.GetKey(KeyCode.W)) { player.transform.position += gameObject.transform.forward * currentSpeed * Time.deltaTime; } if (Input.GetKey(KeyCode.A)) { player.transform.position += player.transform.right * -1f * currentSpeed * Time.deltaTime; } if (Input.GetKey(KeyCode.S)) { player.transform.position += gameObject.transform.forward * -1f * currentSpeed * Time.deltaTime; } if (Input.GetKey(KeyCode.D)) { player.transform.position += player.transform.right * currentSpeed * Time.deltaTime; } if (Input.GetKey(KeyCode.Space)) { player.transform.position += player.transform.up * currentSpeed * Time.deltaTime; } if (Math.Abs(Input.GetAxis("Joy1 Axis 2")) > 0f) { player.transform.position += gameObject.transform.forward * currentSpeed * Time.deltaTime * (Input.GetAxis("Joy1 Axis 2") * -1f); } if (Math.Abs(Input.GetAxis("Joy1 Axis 1")) > 0f) { player.transform.position += gameObject.transform.right * currentSpeed * Time.deltaTime * Input.GetAxis("Joy1 Axis 1"); } } } catch (Exception) { } }
public static QuickMenu GetQuickMenuInstance() { return(Wrappers.GetQuickMenu()); }
public static GameObject CreateButton(ButtonType type, string text, string tooltip, Color textColor, Color backgroundColor, float x_pos, float y_pos, Transform parent, Action listener, Action SecondListener = null) { Transform transform = InstantiateGameobject(type.ConvertToType()); var quickMenu = Wrappers.GetQuickMenu(); float num = quickMenu.transform.Find("UserInteractMenu/ForceLogoutButton").localPosition.x - quickMenu.transform.Find("UserInteractMenu/BanButton").localPosition.x; float num2 = quickMenu.transform.Find("UserInteractMenu/ForceLogoutButton").localPosition.x - quickMenu.transform.Find("UserInteractMenu/BanButton").localPosition.x; transform.localPosition = new Vector3(transform.localPosition.x + num * x_pos, transform.localPosition.y + num2 * y_pos, transform.localPosition.z); transform.SetParent(parent, false); switch (type) { case ButtonType.Toggle: var EnableButton = transform.Find("Toggle_States_Visible/ON").gameObject; var DisableButton = transform.Find("Toggle_States_Visible/OFF").gameObject; EnableButton.GetComponentsInChildren <Text>()[0].text = $"{text}\nON"; DisableButton.GetComponentsInChildren <Text>()[0].text = $"{text}\nON"; var fontSize = EnableButton.GetComponentsInChildren <Text>()[0].fontSize; EnableButton.GetComponentsInChildren <Text>()[1].text = $"{text}\nOFF"; DisableButton.GetComponentsInChildren <Text>()[1].text = $"{text}\nOFF"; EnableButton.GetComponentInChildren <Image>().color = backgroundColor; DisableButton.GetComponentInChildren <Image>().color = backgroundColor; transform.transform.GetComponent <UiTooltip>().text = tooltip; transform.transform.GetComponent <UiTooltip>().alternateText = tooltip; transform.transform.GetComponent <UiTooltip>().SetToolTipBasedOnToggle(); transform.GetComponent <Button>().onClick = new Button.ButtonClickedEvent(); DisableButton.SetActive(true); EnableButton.SetActive(false); transform.GetComponent <Button>().onClick.AddListener(new Action(() => { if (EnableButton.activeSelf) { SecondListener.Invoke(); EnableButton.SetActive(false); DisableButton.SetActive(true); } else { listener.Invoke(); DisableButton.SetActive(false); EnableButton.SetActive(true); } })); break; case ButtonType.Default: transform.GetComponentInChildren <Text>().text = text; transform.GetComponentInChildren <UiTooltip>().text = tooltip; transform.GetComponentInChildren <Text>().color = textColor; transform.GetComponentInChildren <Image>().color = backgroundColor; transform.GetComponent <Button>().onClick = new Button.ButtonClickedEvent(); transform.GetComponent <Button>().onClick.AddListener(listener); break; case ButtonType.Half: transform.localScale += new Vector3(0, 0.2f, 0); transform.GetComponentInChildren <Text>().text = text; transform.GetComponentInChildren <UiTooltip>().text = tooltip; transform.GetComponentInChildren <Text>().color = textColor; transform.GetComponentInChildren <Image>().color = backgroundColor; transform.GetComponent <Button>().onClick = new Button.ButtonClickedEvent(); transform.GetComponent <Button>().onClick.AddListener(listener); break; } return(transform.gameObject); }
public static void ShowCustomMenu(string index) { var quickMenu = Wrappers.GetQuickMenu(); var Menu = quickMenu.transform.Find(index); if (Menu == null) { GameObject gameObject2 = (GameObject)currentPageGetter.GetValue(quickMenu); gameObject2.SetActive(true); quickMenu.transform.Find("QuickMenu_NewElements/_InfoBar").gameObject.SetActive(true); } else { GameObject gameObject = quickMenu.transform.Find("ShortcutMenu").gameObject; FieldInfo[] array = (from fi in typeof(QuickMenu).GetFields(BindingFlags.Instance | BindingFlags.Public) where fi.FieldType == typeof(GameObject) select fi).ToArray <FieldInfo>(); int num = 0; foreach (FieldInfo fieldInfo in array) { if (fieldInfo.GetValue(quickMenu) as GameObject == gameObject && ++num == 2) { currentPageGetter = fieldInfo; break; } } if (currentPageGetter != null) { GameObject Active = (GameObject)currentPageGetter.GetValue(quickMenu); Active.SetActive(false); quickMenu.transform.Find("QuickMenu_NewElements/_InfoBar").gameObject.SetActive(false); quickmenuContextualDisplayGetter = typeof(QuickMenu).GetFields(BindingFlags.Instance | BindingFlags.Public).FirstOrDefault((FieldInfo fi) => fi.FieldType == typeof(QuickMenuContextualDisplay)); FieldInfo fieldInfo2 = quickmenuContextualDisplayGetter; if (fieldInfo2 == null) { return; } QuickMenuContextualDisplay quickMenuContextualDisplay = ((fieldInfo2 != null) ? fieldInfo2.GetValue(quickMenu) : null) as QuickMenuContextualDisplay; if (quickMenuContextualDisplay == null) { return; } currentPageGetter.SetValue(quickMenu, Menu.gameObject); MethodBase method = typeof(QuickMenuContextualDisplay).GetMethod("SetDefaultContext", BindingFlags.Instance | BindingFlags.Public); object obj = quickMenuContextualDisplay; object[] array3 = new object[3]; array3[0] = 0; method.Invoke(obj, array3); currentPageGetter.SetValue(quickMenu, Menu.gameObject); MethodBase method2 = typeof(QuickMenu).GetMethod("SetContext", BindingFlags.Instance | BindingFlags.Public); object obj2 = quickMenu; object[] array4 = new object[3]; array4[0] = 1; method2.Invoke(obj2, array4); Menu.gameObject.SetActive(true); } } // THIS IS CREDITS TO DUBYADUDE HERE }
public override void OnStart() { try { if (Buttons.Count() == 0) { Transform parent = Wrappers.GetQuickMenu().transform.Find("UIElementsMenu"); if (parent != null) { var Flightbutton = ButtonAPI.CreateButton(ButtonType.Toggle, "Flight", "Enable/Disable Flight", Color.white, Color.blue, -1, 0, parent, new Action(() => { GlobalUtils.DirectionalFlight = true; Physics.gravity = GlobalUtils.DirectionalFlight ? Vector3.zero : GlobalUtils.Grav; GlobalUtils.ToggleColliders(false); MelonModLogger.Log($"Flight has been {(GlobalUtils.DirectionalFlight ? "Enabled" : "Disabled")}."); }), new Action(() => { GlobalUtils.DirectionalFlight = false; Physics.gravity = GlobalUtils.DirectionalFlight ? Vector3.zero : GlobalUtils.Grav; GlobalUtils.ToggleColliders(true); MelonModLogger.Log($"Flight has been {(GlobalUtils.DirectionalFlight ? "Enabled" : "Disabled")}."); })); var ESPbutton = ButtonAPI.CreateButton(ButtonType.Toggle, "ESP", "Enable/Disable Selected ESP", Color.white, Color.blue, 0, 0, parent, new Action(() => { GlobalUtils.SelectedPlayerESP = true; MelonModLogger.Log($"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; MelonModLogger.Log($"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.cyan, 0, 0, Wrappers.GetQuickMenu().transform.Find("UserInteractMenu"), new Action(() => { MelonModLogger.Log("Teleporting to selected player."); var player = PlayerWrappers.GetCurrentPlayer(); var SelectedPlayer = Wrappers.GetQuickMenu().GetSelectedPlayer(); player.transform.position = SelectedPlayer.transform.position; })); var Freezebutton = ButtonAPI.CreateButton(ButtonType.Toggle, "Serialize", "Enable/Disable Custom Serialisation", Color.white, Color.blue, -3, -1, parent, new Action(() => { GlobalUtils.Serialise = false; MelonModLogger.Log($"Custom Serialisation has been Enabled."); }), new Action(() => { GlobalUtils.Serialise = true; MelonModLogger.Log($"Custom Serialisation has been Disabled."); })); var ForceCloneButton = ButtonAPI.CreateButton(ButtonType.Toggle, "Force Clone", "Enable/disable force clone", Color.white, Color.blue, -2, -1, parent, new Action(() => { GlobalUtils.ForceClone = true; MelonModLogger.Log($"Force Clone has been Enabled."); }), new Action(() => { GlobalUtils.ForceClone = false; MelonModLogger.Log($"Force Clone has been Disabled."); })); Buttons.Add(Flightbutton.gameObject); Buttons.Add(ESPbutton.gameObject); Buttons.Add(teleportButton.gameObject); Buttons.Add(Freezebutton.gameObject); Buttons.Add(ForceCloneButton.gameObject); } } } catch (Exception) { } }
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 OnUpdate() { if (Input.GetKeyDown(KeyCode.B)) { 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(); } } if (Input.GetKey(KeyCode.LeftAlt) && Input.GetKey(KeyCode.F5)) { Process.GetCurrentProcess().Kill(); } if (Input.GetKey(KeyCode.LeftControl) && Input.GetKeyDown(KeyCode.R)) { //Respawn Делай даун } if (Input.GetKey(KeyCode.LeftAlt) && Input.GetKeyDown(KeyCode.P)) { //TPS Делай Сука } if (Input.GetKeyDown(KeyCode.F)) { GlobalUtils.DirectionalFlight = !GlobalUtils.DirectionalFlight; Physics.gravity = GlobalUtils.DirectionalFlight ? Vector3.zero : GlobalUtils.Grav; if (!GlobalUtils.DirectionalFlight) { GlobalUtils.ToggleColliders(true); } else { GlobalUtils.ToggleColliders(false); } //UIButtons.ToggleUIButton(0, GlobalUtils.SelectedPlayerESP); Console.WriteLine($"Flight has been {(GlobalUtils.DirectionalFlight ? "Enabled" : "Disabled")}."); } if (Input.GetKeyDown(KeyCode.O)) { GlobalUtils.SelectedPlayerESP = !GlobalUtils.SelectedPlayerESP; Console.WriteLine($"Selected ESP has been {(GlobalUtils.SelectedPlayerESP ? "Enabled" : "Disabled")}."); //UIButtons.ToggleUIButton(1, GlobalUtils.SelectedPlayerESP); 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); } } } if (Input.GetKeyDown(KeyCode.T)) { RayTeleport(); Console.WriteLine("Teleported"); } if (GlobalUtils.DirectionalFlight) { GameObject gameObject = Wrappers.GetPlayerCamera(); var player = PlayerWrappers.GetCurrentPlayer(); if (currentSpeed <= 0f) { currentSpeed = 1f; } if (Input.GetKeyDown(KeyCode.LeftShift)) { currentSpeed *= 2f; } if (Input.GetKeyUp(KeyCode.LeftShift)) { currentSpeed /= 2f; } if (Input.mouseScrollDelta.y != 0) { currentSpeed += Input.mouseScrollDelta.y; Console.WriteLine("Speed Changed: [" + currentSpeed + "]"); } if (Input.GetKey(KeyCode.LeftControl) && Input.GetKeyDown(KeyCode.R)) { currentSpeed = 5f; Console.WriteLine("Fly Speed Reset [5]"); } if (Input.GetKey(KeyCode.W)) { player.transform.position += gameObject.transform.forward * currentSpeed * Time.deltaTime; } if (Input.GetKey(KeyCode.A)) { player.transform.position -= player.transform.right * currentSpeed * Time.deltaTime; } if (Input.GetKey(KeyCode.S)) { player.transform.position -= gameObject.transform.forward * currentSpeed * Time.deltaTime; } if (Input.GetKey(KeyCode.D)) { player.transform.position += player.transform.right * currentSpeed * Time.deltaTime; } if (Input.GetKey(KeyCode.E)) { player.transform.position += player.transform.up * currentSpeed * Time.deltaTime; } if (Input.GetKey(KeyCode.Q)) { player.transform.position -= player.transform.up * currentSpeed * Time.deltaTime; } if (Math.Abs(Input.GetAxis("Joy1 Axis 2")) > 0f) { player.transform.position += gameObject.transform.forward * currentSpeed * Time.deltaTime * (Input.GetAxis("Joy1 Axis 2") * -1f); } if (Math.Abs(Input.GetAxis("Joy1 Axis 1")) > 0f) { player.transform.position += gameObject.transform.right * currentSpeed * Time.deltaTime * Input.GetAxis("Joy1 Axis 1"); } } }
public override void OnStart() { try { if (Buttons.Count() == 0) { Transform parent = Wrappers.GetQuickMenu().transform.Find("UIElementsMenu"); if (parent != null) { var Flightbutton = ButtonAPI.CreateButton(ButtonType.Toggle, "Flight", "Enable/Disable Flight", Color.white, Color.blue, -1, 0, parent, new Action(() => { GlobalUtils.DirectionalFlight = true; Physics.gravity = GlobalUtils.DirectionalFlight ? Vector3.zero : GlobalUtils.Grav; GlobalUtils.ToggleColliders(false); MelonModLogger.Log($"Flight has been {(GlobalUtils.DirectionalFlight ? "Enabled" : "Disabled")}."); }), new Action(() => { GlobalUtils.DirectionalFlight = false; Physics.gravity = GlobalUtils.DirectionalFlight ? Vector3.zero : GlobalUtils.Grav; GlobalUtils.ToggleColliders(true); MelonModLogger.Log($"Flight has been {(GlobalUtils.DirectionalFlight ? "Enabled" : "Disabled")}."); })); var ESPbutton = ButtonAPI.CreateButton(ButtonType.Toggle, "ESP", "Enable/Disable Selected ESP", Color.white, Color.blue, 0, 0, parent, new Action(() => { GlobalUtils.SelectedPlayerESP = true; MelonModLogger.Log($"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; MelonModLogger.Log($"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.cyan, 0, 0, Wrappers.GetQuickMenu().transform.Find("UserInteractMenu"), new Action(() => { MelonModLogger.Log("Teleporting to selected player."); var player = PlayerWrappers.GetCurrentPlayer(); var SelectedPlayer = Wrappers.GetQuickMenu().GetSelectedPlayer(); player.transform.position = SelectedPlayer.transform.position; })); var Freezebutton = ButtonAPI.CreateButton(ButtonType.Toggle, "Serialize", "Enable/Disable Custom Serialisation", Color.white, Color.blue, -3, -1, parent, new Action(() => { GlobalUtils.Serialise = false; MelonModLogger.Log($"Custom Serialisation has been Enabled."); }), new Action(() => { GlobalUtils.Serialise = true; MelonModLogger.Log($"Custom Serialisation has been Disabled."); })); var JumpButton = ButtonAPI.CreateButton(ButtonType.Toggle, "Jump", "Enable/disable jumping in the current world", Color.white, Color.blue, -2, -1, parent, new Action(() => { if (PlayerWrappers.GetCurrentPlayer() != null) { if (PlayerWrappers.GetCurrentPlayer().GetComponent <PlayerModComponentJump>() == null) { PlayerWrappers.GetCurrentPlayer().gameObject.AddComponent <PlayerModComponentJump>(); } else { PlayerWrappers.GetCurrentPlayer().GetComponent <PlayerModComponentJump>().enabled = true; } } MelonModLogger.Log($"Jumping has been Enabled."); }), new Action(() => { if (PlayerWrappers.GetCurrentPlayer() != null) { if (PlayerWrappers.GetCurrentPlayer().GetComponent <PlayerModComponentJump>() != null) { PlayerWrappers.GetCurrentPlayer().GetComponent <PlayerModComponentJump>().enabled = false; } } MelonModLogger.Log($"Jumping has been Disabled."); })); var CloneButton = ButtonAPI.CreateButton(ButtonType.Default, "Clone\nBy\nID", "Clone an avatar by it's ID", Color.white, Color.blue, -1, 1, parent, new Action(() => { MelonModLogger.Log("Enter AvatarID: "); string ID = Console.ReadLine(); VRC.Core.API.SendRequest($"avatars/{ID}", HTTPMethods.Get, new ApiModelContainer <ApiAvatar>(), null, true, true, 3600f, 2, null); new PageAvatar { avatar = new SimpleAvatarPedestal { field_ApiAvatar_0 = new ApiAvatar { id = ID } } }.ChangeToSelectedAvatar(); Resources.FindObjectsOfTypeAll <VRCUiPopupManager>()[0].Method_Public_String_String_Single_0("<color=cyan>Success!</color>", "<color=green>Successfully cloned that avatar by It's AvtrID.</color>", 10f); }), null); var GotoButton = ButtonAPI.CreateButton(ButtonType.Default, "Join\nBy\nID", "Goto a world by It's ID", Color.white, Color.blue, 0, 1, parent, new Action(() => { MelonModLogger.Log("Enter WorldID: "); string ID = Console.ReadLine(); Networking.GoToRoom(ID); }), null); Buttons.Add(Flightbutton.gameObject); Buttons.Add(ESPbutton.gameObject); Buttons.Add(teleportButton.gameObject); Buttons.Add(Freezebutton.gameObject); Buttons.Add(JumpButton.gameObject); Buttons.Add(CloneButton.gameObject); } } } catch (Exception) { } }