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; }
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() { 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); }