// ▲▼ public override void OnStart() { //Change QM collider size [for more buttons] GameObject.Find("UserInterface/QuickMenu").GetComponent <BoxCollider>().size = new Vector3(5034.68f, 3342.426f, 1f); ButtonAPI.CreateButton(ButtonAPI.ButtonType.Default, "HVH\nMod", "HVH menu", ButtonAPI.HorizontalPosition.LeftOfMenu, ButtonAPI.VerticalPosition.TopButton, ButtonAPI.ShortcutMenuTransform, delegate(bool a) { ButtonAPI.EnterSubMenu(ButtonAPI.MakeEmptyPage("HVH")); }, Color.red, Color.magenta, null, true, false, false, false, null, true); ButtonAPI.CreateButton(ButtonAPI.ButtonType.Default, "Player List", "Player list menu", ButtonAPI.HorizontalPosition.FirstButtonPos, ButtonAPI.VerticalPosition.TopButton, ButtonAPI.MakeEmptyPage("HVH").transform, delegate(bool a) { ButtonAPI.EnterSubMenu(ButtonAPI.MakeEmptyPage("PlayerList")); }, Color.red, Color.magenta, null, false, true, false, false, null, true); ButtonAPI.CreateButton(ButtonAPI.ButtonType.Default, "User\nUtils", "User utils menu [HVH]", ButtonAPI.HorizontalPosition.SecondButtonPos, ButtonAPI.VerticalPosition.BelowBottomButton, ButtonAPI.UserInteractMenuTransform, delegate(bool a) { ButtonAPI.EnterSubMenu(ButtonAPI.MakeEmptyPage("UserUtils")); }, Color.red, Color.magenta, null, true); isUIInit = true; }
private static IEnumerator createButton() { while (QuickMenu.prop_QuickMenu_0 == null) { yield return(null); } ExpansionKitApi.GetExpandedMenu(ExpandedMenu.QuickMenu).AddSimpleButton("Vibrator\nController", new Action(() => { ButtonAPI.EnterSubMenu(ButtonAPI.MakeEmptyPage("SubMenu_1")); })); }
public override void OnStart() { ButtonAPI.CreateButton(ButtonAPI.ButtonType.Default, "Fly Menu", "Fly menu", ButtonAPI.HorizontalPosition.FirstButtonPos, ButtonAPI.VerticalPosition.TopButton, ButtonAPI.MakeEmptyPage("PureCheat").transform, delegate(bool a) { ButtonAPI.EnterSubMenu(ButtonAPI.MakeEmptyPage("FlyMenu")); }, Color.white, Color.white, null, false, false); toggleFlyButton = ButtonAPI.CreateButton(ButtonAPI.ButtonType.Toggle, "Fly", "Toggle fly", ButtonAPI.HorizontalPosition.FirstButtonPos, ButtonAPI.VerticalPosition.TopButton, ButtonAPI.MakeEmptyPage("FlyMenu").transform, delegate(bool a) { isFly = a; PureUtils.GetLocalPlayer().GetComponent <CharacterController>().enabled = !a; PureLogger.Log(a ? "Fly enabled" : "Fly Disabled"); }, Color.white, Color.red, null, false, false); resetFlySpeedButton = ButtonAPI.CreateButton(ButtonAPI.ButtonType.Default, $"Speed [{flySpeed}]", "Reset fly speed", ButtonAPI.HorizontalPosition.FirstButtonPos, ButtonAPI.VerticalPosition.TopButton, ButtonAPI.MakeEmptyPage("FlyMenu").transform, delegate(bool a) { flySpeed = 2; resetFlySpeedButton.SetText($"Speed [{flySpeed}]"); }, Color.white, Color.white, null, false); ButtonAPI.CreateButton(ButtonAPI.ButtonType.Default, "▲", "Fly speed up", ButtonAPI.HorizontalPosition.SecondButtonPos, ButtonAPI.VerticalPosition.TopButton, ButtonAPI.MakeEmptyPage("FlyMenu").transform, delegate(bool a) { flySpeed += 1; resetFlySpeedButton.SetText($"Speed [{flySpeed}]"); }, Color.white, Color.white, null, false, false); ButtonAPI.CreateButton(ButtonAPI.ButtonType.Default, "▼", "Fly speed down", ButtonAPI.HorizontalPosition.SecondButtonPos, ButtonAPI.VerticalPosition.TopButton, ButtonAPI.MakeEmptyPage("FlyMenu").transform, delegate(bool a) { flySpeed -= 1; if (flySpeed <= 0) { flySpeed = 1; } resetFlySpeedButton.SetText($"Speed [{flySpeed}]"); }, Color.white, Color.white, null, false); }
public override void OnStart() { playerCamera = Wrapper.GetLocalPlayerCamera().GetComponent <Camera>(); defaultFOV = playerCamera.fieldOfView; playerCamera.fieldOfView = FOV; ButtonAPI.CreateButton(ButtonAPI.ButtonType.Default, "FOV Menu", "Field of view menu", ButtonAPI.HorizontalPosition.SecondButtonPos, ButtonAPI.VerticalPosition.TopButton, ButtonAPI.MakeEmptyPage("PureCheat").transform, delegate(bool a) { ButtonAPI.EnterSubMenu(ButtonAPI.MakeEmptyPage("FOVMenu")); }, Color.white, Color.white, null, false, false); resetFOVButton = ButtonAPI.CreateButton(ButtonAPI.ButtonType.Default, $"FOV [{FOV}]", $"Set field of view to {defaultFOV}", ButtonAPI.HorizontalPosition.FirstButtonPos, ButtonAPI.VerticalPosition.TopButton, ButtonAPI.MakeEmptyPage("FOVMenu").transform, delegate(bool a) { FOV = defaultFOV; playerCamera.fieldOfView = FOV; resetFOVButton.transform.GetComponentInChildren <Text>().text = $"FOV [{FOV}]"; }, Color.white, Color.white, null, true); ButtonAPI.CreateButton(ButtonAPI.ButtonType.Default, "▲", "Set field of view up", ButtonAPI.HorizontalPosition.SecondButtonPos, ButtonAPI.VerticalPosition.TopButton, ButtonAPI.MakeEmptyPage("FOVMenu").transform, delegate(bool a) { FOV += 1; playerCamera.fieldOfView = FOV; resetFOVButton.transform.GetComponentInChildren <Text>().text = $"FOV [{FOV}]"; }, Color.white, Color.white, null, false, false); ButtonAPI.CreateButton(ButtonAPI.ButtonType.Default, "▼", "Set field of view down", ButtonAPI.HorizontalPosition.SecondButtonPos, ButtonAPI.VerticalPosition.TopButton, ButtonAPI.MakeEmptyPage("FOVMenu").transform, delegate(bool a) { FOV -= 1; if (FOV <= 0) { FOV = 1; } playerCamera.fieldOfView = FOV; resetFOVButton.transform.GetComponentInChildren <Text>().text = $"FOV [{FOV}]"; }, Color.white, Color.white, null, false); }
public override void VRChat_OnUiManagerInit() { if (subMenu != "UIExpansionKit") { ButtonAPI.CustomTransform = GameObject.Find("/UserInterface/QuickMenu/" + subMenu).transform; ButtonAPI.CreateButton(ButtonAPI.ButtonType.Default, "Vibrator\nController", "Vibrator Controller Settings", buttonX - 4, 3 - buttonY, null, delegate(bool a) { ButtonAPI.EnterSubMenu(ButtonAPI.MakeEmptyPage("SubMenu_1")); }, Color.white, Color.magenta, null, true, false, false, false, null, true); } //Back LockButtonUI = ButtonAPI.CreateButton(ButtonAPI.ButtonType.Default, "Back", "Exit this menu", ButtonAPI.HorizontalPosition.RightOfMenu, ButtonAPI.VerticalPosition.BottomButton, ButtonAPI.MakeEmptyPage("SubMenu_1").transform, delegate(bool a) { if (subMenu == "UIExpansionKit") { ButtonAPI.EnterSubMenu(GameObject.Find("/UserInterface/QuickMenu/ShortcutMenu")); } else { ButtonAPI.EnterSubMenu(GameObject.Find("/UserInterface/QuickMenu/" + subMenu)); } }, Color.yellow, Color.magenta, null, true, false, false, false, null, true); //Lock button LockButtonUI = ButtonAPI.CreateButton(ButtonAPI.ButtonType.Default, "Lock Speed\nButton", "Click than press button on controller to set button to lock vibraton speed (click twice to disable)", ButtonAPI.HorizontalPosition.FirstButtonPos, ButtonAPI.VerticalPosition.TopButton, ButtonAPI.MakeEmptyPage("SubMenu_1").transform, delegate(bool a) { if (findButton == "lockButton") { lockButton = KeyCode.None; findButton = null; LockKeyBind.SetText(""); LockButtonUI.SetText("Lock Speed\nButton"); MelonPreferences.SetEntryValue(vibratorController.Identifier, "lockButton", lockButton.GetHashCode()); return; } findButton = "lockButton"; LockButtonUI.SetText("Press Now"); }, Color.white, Color.magenta, null, true, false, false, false, null, true); LockKeyBind = ButtonAPI.CreateButton(ButtonAPI.ButtonType.Default, "", "Lock Speed Keybind", ButtonAPI.HorizontalPosition.FirstButtonPos, ButtonAPI.VerticalPosition.SecondButton, ButtonAPI.MakeEmptyPage("SubMenu_1").transform, delegate(bool a) { }, Color.white, Color.grey, null, false, false, false, false, null, false); LockKeyBind.SetInteractivity(false); if (lockButton != 0) { LockKeyBind.SetText(lockButton.ToString()); } //Hold button HoldButtonUI = ButtonAPI.CreateButton(ButtonAPI.ButtonType.Default, "Hold\nButton", "Click than press button on controller to set button to hold to use toy (click twice to disable)", ButtonAPI.HorizontalPosition.SecondButtonPos, ButtonAPI.VerticalPosition.TopButton, ButtonAPI.MakeEmptyPage("SubMenu_1").transform, delegate(bool a) { if (findButton == "holdButton") { holdButton = KeyCode.None; findButton = null; HoldKeyBind.SetText(""); HoldButtonUI.SetText("Hold\nButton"); MelonPreferences.SetEntryValue(vibratorController.Identifier, "lockButton", holdButton.GetHashCode()); return; } findButton = "holdButton"; HoldButtonUI.SetText("Press Now"); }, Color.white, Color.magenta, null, true, false, false, false, null, true); HoldKeyBind = ButtonAPI.CreateButton(ButtonAPI.ButtonType.Default, "", "Hold Keybind", ButtonAPI.HorizontalPosition.SecondButtonPos, ButtonAPI.VerticalPosition.SecondButton, ButtonAPI.MakeEmptyPage("SubMenu_1").transform, delegate(bool a) { }, Color.white, Color.grey, null, false, false, false, false, null, false); HoldKeyBind.SetInteractivity(false); if (holdButton != 0) { HoldKeyBind.SetText(holdButton.ToString()); } //Add toy addButtonUI = ButtonAPI.CreateButton(ButtonAPI.ButtonType.Default, "Add\nToy", "Click to pair with a friend's toy", ButtonAPI.HorizontalPosition.ThirdButtonPos, ButtonAPI.VerticalPosition.TopButton, ButtonAPI.MakeEmptyPage("SubMenu_1").transform, delegate(bool a) { InputPopup("", delegate(string text) { if (text.Length != 4) { addButtonUI.SetText("Add\nToys\n<color=#FF0000>Invalid Code</color>"); } else { Client.send("join " + text); } }); }, Color.white, Color.magenta, null, true, false, false, false, null, true); //How to use ButtonAPI.CreateButton(ButtonAPI.ButtonType.Default, "How To Use", "Opens instructions to use", ButtonAPI.HorizontalPosition.ThirdButtonPos, ButtonAPI.VerticalPosition.SecondButton, ButtonAPI.MakeEmptyPage("SubMenu_1").transform, delegate(bool a) { System.Diagnostics.Process.Start("https://github.com/markviews/VRChatVibratorController"); }, Color.white, Color.grey, null, false, false, false, false, null, false); quickMenu = GameObject.Find("UserInterface/QuickMenu/QuickMenu_NewElements"); menuContent = GameObject.Find("UserInterface/MenuContent/Backdrop/Backdrop"); }
public override void VRChat_OnUiManagerInit() { Tuple<string, string, Color?, Color?, Action<bool>> SubMenu1Data = Tuple.Create<string, string, Color?, Color?, Action<bool>>("Sub Menu 1", "The First SubMenu", UnityEngine.Color.magenta, null, delegate(bool a) { Process.Start("https://VRCAntiCrash.com/ButtonAPI"); }); Tuple<string, string, Color?, Color?, Action<bool>> SubMenu2Data = Tuple.Create<string, string, Color?, Color?, Action<bool>>("Sub Menu 2", "The Second SubMenu", UnityEngine.Color.magenta, null, delegate(bool a) { Process.Start("https://VRCAntiCrash.com/ButtonAPI"); }); //Make Button To Enter SubMenu_1 ButtonAPI.CreateButton(ButtonAPI.ButtonType.Default, LoadedImage != null ? "" : "Utils", "Some Random Utils.", ButtonAPI.HorizontalPosition.LeftOfMenu, ButtonAPI.VerticalPosition.TopButton, null, delegate (bool a) { ButtonAPI.EnterSubMenu(ButtonAPI.MakeEmptyPage("SubMenu_1", SubMenu1Data.Item1, SubMenu1Data.Item2, SubMenu1Data.Item3, SubMenu1Data.Item4, SubMenu1Data.Item5)); }, UnityEngine.Color.white, UnityEngine.Color.magenta, null, true, false, false, false, LoadedImage, true); //SubMenu_1 Contents ButtonAPI.CreateButton(ButtonAPI.ButtonType.Default, "Next Page", "Goes To The Next Page.", ButtonAPI.HorizontalPosition.LeftOfMenu, ButtonAPI.VerticalPosition.TopButton, ButtonAPI.MakeEmptyPage("SubMenu_1", SubMenu1Data.Item1, SubMenu1Data.Item2, SubMenu1Data.Item3, SubMenu1Data.Item4, SubMenu1Data.Item5).transform, delegate (bool a) { ButtonAPI.EnterSubMenu(ButtonAPI.MakeEmptyPage("SubMenu_2", SubMenu2Data.Item1, SubMenu2Data.Item2, SubMenu2Data.Item3, SubMenu2Data.Item4, SubMenu2Data.Item5)); }, UnityEngine.Color.white, UnityEngine.Color.magenta, null, false, false, false, false, null, true); InputField InputField = null; InputField = ButtonAPI.CreateInputField("Enter Text Here..", ButtonAPI.VerticalPosition.BelowBottomButton, ButtonAPI.MakeEmptyPage("SubMenu_1", SubMenu1Data.Item1, SubMenu1Data.Item2, SubMenu1Data.Item3, SubMenu1Data.Item4, SubMenu1Data.Item5).transform, delegate (string text) { //MelonLogger.Log("New Text: " + text); }, delegate () { if (InputField.text.StartsWith("teleport ") && InputField.text.Length > 9) { Player TargetPlayer = PlayerManager.field_Private_Static_PlayerManager_0 .field_Private_List_1_Player_0.ToArray() .FirstOrDefault(o => o.field_Private_APIUser_0.displayName.ToLower().StartsWith(InputField.text.Replace("teleport ", "").ToLower())); if (TargetPlayer != null) { MelonLogger.Log("Teleporting To: " + TargetPlayer.field_Private_APIUser_0.displayName); VRCPlayer.field_Internal_Static_VRCPlayer_0.transform.position = TargetPlayer.transform.position; } else { MelonLogger.Log("Player: " + InputField.text.Replace("teleport ", "") + " Not Found!"); } } }); ButtonAPI.CreateButton(ButtonAPI.ButtonType.Toggle, "Disable Portals", "Disables Portals Entirely - This Stops That Stupid Notorious Menu Disabling Bullshit", ButtonAPI.HorizontalPosition.FirstButtonPos, ButtonAPI.VerticalPosition.TopButton, ButtonAPI.MakeEmptyPage("SubMenu_1", SubMenu1Data.Item1, SubMenu1Data.Item2, SubMenu1Data.Item3, SubMenu1Data.Item4, SubMenu1Data.Item5).transform, delegate (bool a) { DisablePortals = a; if (!a) { Functions.TogglePortals(true); } }, UnityEngine.Color.white, UnityEngine.Color.magenta, null, false, false, false, DisablePortals, null, true, KeyCode.LeftControl, KeyCode.P); //Test Checkbox ButtonAPI.PlagueButton CheckBox = null; CheckBox = ButtonAPI.CreateButton(ButtonAPI.ButtonType.Toggle, "X", "A CheckBox, Ez", ButtonAPI.HorizontalPosition.SecondButtonPos, ButtonAPI.VerticalPosition.SecondButton, ButtonAPI.MakeEmptyPage("SubMenu_1", SubMenu1Data.Item1, SubMenu1Data.Item2, SubMenu1Data.Item3, SubMenu1Data.Item4, SubMenu1Data.Item5).transform, delegate (bool a) { CheckBox.text.text = (a ? "✓" : "X"); }, UnityEngine.Color.white, UnityEngine.Color.magenta, null, false, false, true, false, null, true); ButtonAPI.CreateText(ButtonAPI.ButtonType.Toggle, ButtonAPI.SizeType.ButtonSize, "Some Text", "Just Some Text", ButtonAPI.HorizontalPosition.FirstButtonPos, ButtonAPI.VerticalPosition.SecondButton, ButtonAPI.MakeEmptyPage("SubMenu_1", SubMenu1Data.Item1, SubMenu1Data.Item2, SubMenu1Data.Item3, SubMenu1Data.Item4, SubMenu1Data.Item5).transform, true, true, delegate (bool a) { //Do Something Here }, false, UnityEngine.Color.magenta, UnityEngine.Color.white); ButtonAPI.CreateSlider(ButtonAPI.MakeEmptyPage("SubMenu_1", SubMenu1Data.Item1, SubMenu1Data.Item2, SubMenu1Data.Item3, SubMenu1Data.Item4, SubMenu1Data.Item5).transform, delegate (float v) { }, (float)ButtonAPI.HorizontalPosition.FirstButtonPos, (float)ButtonAPI.VerticalPosition.BottomButton, "Test Slider", 15f, 100f, 0f); //SubMenu_2 Contents ButtonAPI.CreateButton(ButtonAPI.ButtonType.Default, "Prev Page", "Goes To The Previous Page.", ButtonAPI.HorizontalPosition.LeftOfMenu, ButtonAPI.VerticalPosition.TopButton, ButtonAPI.MakeEmptyPage("SubMenu_2", SubMenu2Data.Item1, SubMenu2Data.Item2, SubMenu2Data.Item3, SubMenu2Data.Item4, SubMenu2Data.Item5).transform, delegate (bool a) { ButtonAPI.EnterSubMenu(ButtonAPI.MakeEmptyPage("SubMenu_1", SubMenu1Data.Item1, SubMenu1Data.Item2, SubMenu1Data.Item3, SubMenu1Data.Item4, SubMenu1Data.Item5)); }, UnityEngine.Color.white, UnityEngine.Color.magenta, null, false, false, false, false, null, true); ButtonAPI.CreateButton(ButtonAPI.ButtonType.Default, "Hello World", "Prints Hello World To Console.", ButtonAPI.HorizontalPosition.FirstButtonPos, ButtonAPI.VerticalPosition.TopButton, ButtonAPI.MakeEmptyPage("SubMenu_2", SubMenu2Data.Item1, SubMenu2Data.Item2, SubMenu2Data.Item3, SubMenu2Data.Item4, SubMenu2Data.Item5).transform, delegate (bool a) { MelonLogger.Log(ConsoleColor.Magenta, "Hello World!"); }, UnityEngine.Color.white, UnityEngine.Color.magenta, null, false, false, false, false, null, true); }