public override void OnApplicationStart() { ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.SettingsMenu, "Nearplane-0.01", (() => ChangeNearClipPlane(.01f))); ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.SettingsMenu, "Nearplane-0.001", (() => ChangeNearClipPlane(.001f))); ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.SettingsMenu, "Nearplane-0.0001", (() => ChangeNearClipPlane(.0001f))); MelonLogger.Log("Near Plane Adjust Init"); }
private IEnumerator CreateQuickMenuButton() { while (QuickMenu.prop_QuickMenu_0 == null) { yield return(null); } ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.WorldMenu, "Disable Active Chairs", new Action(() => { int countChange = 0; var objects = Resources.FindObjectsOfTypeAll <VRCStation>(); foreach (var item in objects) { if (item.gameObject.active) //Only disable active chairs { countChange++; objectsDisabled.Add(item); item.gameObject.SetActive(false); // item.gameObject finds the parent gameObject of the VRCStation } } MelonLogger.Log("Disabled " + countChange + " chair objects"); })); ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.WorldMenu, "Re-enable Chairs", new Action(() => { int countChange = 0; foreach (var item in objectsDisabled) { countChange++; item.gameObject.SetActive(true); } MelonLogger.Log("Enabled " + countChange + " chair objects"); objectsDisabled.Clear(); })); }
private IEnumerator WaitAndRegisterEmojiButtons() { while (QuickMenu.prop_QuickMenu_0 == null) { yield return(null); } var emojiMenuRoot = QuickMenu.prop_QuickMenu_0.transform.Find("EmojiMenu"); if (emojiMenuRoot == null) { MelonLogger.LogError("Emoji menu root not found"); yield break; } var emojiMenu = emojiMenuRoot.GetComponent <EmojiMenu>(); var storeGo = new GameObject("ClonedPageStore"); storeGo.transform.SetParent(emojiMenu.transform); storeGo.SetActive(false); for (var index = 0; index < emojiMenu.pages.Count; index++) { var pageGo = emojiMenu.pages[index]; var clone = new GameObject($"Page{index}Button", new [] { Il2CppType.Of <RectTransform>() }); clone.transform.SetParent(storeGo.transform, false); var grid = clone.AddComponent <GridLayoutGroup>(); grid.constraint = GridLayoutGroup.Constraint.FixedColumnCount; grid.cellSize = new Vector2(33, 33); grid.startAxis = GridLayoutGroup.Axis.Horizontal; grid.startCorner = GridLayoutGroup.Corner.UpperLeft; grid.constraintCount = 3; foreach (var buttonXformObject in pageGo.transform) { var buttonTransform = buttonXformObject.Cast <Transform>(); if (!buttonTransform.gameObject.activeSelf) { continue; } var buttonClone = Object.Instantiate(buttonTransform.gameObject, clone.transform, false); CleanStuff(buttonClone); } var index1 = index; ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.EmojiQuickMenu, "", () => { emojiMenu.pages[emojiMenu.field_Private_Int32_0].SetActive(false); pageGo.SetActive(true); emojiMenu.field_Private_Int32_0 = index1; }, buttonGo => { Object.Instantiate(clone, buttonGo.transform, false); }); } }
public override void OnApplicationStart() { ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.SettingsMenu, "Speed Default", (() => ChangePlayerSpeed(2f))); ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.SettingsMenu, "Speed 1/2", (() => ChangePlayerSpeed(1f))); ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.SettingsMenu, "Speed 1/10", (() => ChangePlayerSpeed(.2f))); // ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.SettingsMenu, "Speed 1/100", (() => ChangePlayerSpeed(.02f))); //Breaks game, can't move at all MelonModLogger.Log("Slow speed Adjust Init"); }
public override void OnApplicationStart() { ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.CameraQuickMenu, "8k Res", () => ChangeCamRes(4320, 7680)); ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.CameraQuickMenu, "6k Res", () => ChangeCamRes(3240, 5760)); ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.CameraQuickMenu, "4k Res", () => ChangeCamRes(2160, 3840)); ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.CameraQuickMenu, "Default Res", () => ChangeCamRes(1080, 1920)); MelonModLogger.Log("Camera Res Changer Init"); }
public override void OnApplicationStart() { ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.CameraQuickMenu, "Hide camera lens", ToggleLens, SetToggleLensButton); ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.CameraQuickMenu, "Zoom in", ZoomIn); ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.CameraQuickMenu, "Zoom out", ZoomOut); ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.CameraQuickMenu, "Enlarge camera", Enlarge); ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.CameraQuickMenu, "Shrink camera", Shrink); }
public static void OnApplicationStart() { ClassInjector.RegisterTypeInIl2Cpp <QuickMenuHideAvatarButtonHandler>(); ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.UserDetailsMenu, "Hide all avatars by this author", OnHideBigClick, ConsumeHideBigInstance); ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.UserQuickMenu, "Hide this avatar (on anyone)", OnHideAvatarClick, ConsumeOnHideAvatar); ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.SettingsMenu, "Reload all avatars", ReloadAllAvatars); MelonCoroutines.Start(InitThings()); }
public override void OnApplicationStart() { MelonPreferences.CreateCategory("NearClipAdj", "NearClipPlane Adjuster"); MelonPreferences.CreateEntry <bool>("NearClipAdj", "Keyboard", true, "Keyboard Shortcuts: '[' - 0.0001, ']' - 0.05"); MelonPreferences.CreateEntry <bool>("NearClipAdj", "SmallerDefault", false, "Smaller Default Nearclip on World Change - 0.001 vs 0.01"); OnPreferencesSaved(); ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.SettingsMenu, "Nearplane-0.05", (() => ChangeNearClipPlane(.05f))); ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.SettingsMenu, "Nearplane-0.01", (() => ChangeNearClipPlane(.01f))); ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.SettingsMenu, "Nearplane-0.001", (() => ChangeNearClipPlane(.001f))); ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.SettingsMenu, "Nearplane-0.0001", (() => ChangeNearClipPlane(.0001f))); MelonLogger.Msg("Near Plane Adjust Init"); }
public override void OnApplicationStart() { ModPrefs.RegisterCategory(ModCategory, "Camera Resolution"); ModPrefs.RegisterPrefString(ModCategory, Resolution1NamePref, "1080p", "Resolution 1 Name:"); ModPrefs.RegisterPrefString(ModCategory, Resolution2NamePref, "4K", "Resolution 2 Name:"); ModPrefs.RegisterPrefString(ModCategory, Resolution3NamePref, "8K", "Resolution 3 Name:"); ModPrefs.RegisterPrefInt(ModCategory, Resolution1Pref, 1080, "Resolution 1: (Photo height, unstable > 4320)"); ModPrefs.RegisterPrefInt(ModCategory, Resolution2Pref, 2160, "Resolution 2: (Photo height, unstable > 4320)"); ModPrefs.RegisterPrefInt(ModCategory, Resolution3Pref, 4320, "Resolution 3: (Photo height, unstable > 4320)"); ModPrefs.RegisterPrefInt(ModCategory, ResolutionPref, 2, "Default resolution setting (1-3)"); ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.CameraQuickMenu, ModPrefs.GetString(ModCategory, Resolution1NamePref), Resolution1); ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.CameraQuickMenu, ModPrefs.GetString(ModCategory, Resolution2NamePref), Resolution2); ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.CameraQuickMenu, ModPrefs.GetString(ModCategory, Resolution3NamePref), Resolution3); }
private IEnumerator CreateQuickMenuButton() { while (QuickMenu.prop_QuickMenu_0 == null) { yield return(null); } ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.QuickMenu, "Toggle\nPortable\nMirror", new Action(() => { if (Utils.GetVRCPlayer() == null) { return; } ToggleMirror(); })); }
public override void OnApplicationStart() { MelonPrefs.RegisterCategory("CamResChange", "Camera Res Changer"); //MelonPrefs.RegisterBool("CamResChange", "LargerSizes", true, "Enabled sizes larger than 8k (Requires 'Lag Free Screenshots' and may break in some VRC versions. Requires Restart)"); //if (MelonHandler.Mods.Find(m => m.Info.Name == "Lag Free Screenshots") != null && ModPrefs.GetBool("CamResChange", "LargerSizes")) //Broke as od 1046-outputs black image //{ // ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.CameraQuickMenu, "16k Res", () => ChangeCamRes(8640, 15360)); // ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.CameraQuickMenu, "14k Res", () => ChangeCamRes(7560, 13440)); //use *.875 of 16k // ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.CameraQuickMenu, "12k Res", () => ChangeCamRes(6480, 11520)); //use *.75 of 16k //} ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.CameraQuickMenu, "8k Res", () => ChangeCamRes(4320, 7680)); ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.CameraQuickMenu, "6k Res", () => ChangeCamRes(3240, 5760)); ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.CameraQuickMenu, "4k Res", () => ChangeCamRes(2160, 3840)); //ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.CameraQuickMenu, "2k Res", () => ChangeCamRes(1440, 2560));//Really 1080p is often considered 2k ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.CameraQuickMenu, "Default Res", () => ChangeCamRes(1080, 1920)); MelonLogger.Log("Camera Res Changer Init"); }
public override void VRChat_OnUiManagerInit() { MelonLogger.Log("BTK Standalone: Self Portrait - Starting Up"); if (MelonHandler.Mods.Any(x => x.Info.Name.Equals("BTKCompanionLoader", StringComparison.OrdinalIgnoreCase))) { MelonLogger.Log("Hold on a sec! Looks like you've got BTKCompanion installed, this mod is built in and not needed!"); MelonLogger.LogError("BTKSASelfPortrait has not started up! (BTKCompanion Running)"); return; } instance = this; harmony = HarmonyInstance.Create("BTKStandaloneSP"); MelonPrefs.RegisterCategory(settingsCategory, "BTKSA Self Portrait"); MelonPrefs.RegisterFloat(settingsCategory, prefsCameraDistance, 0.7f, "Camera Distance"); MelonPrefs.RegisterInt(settingsCategory, prefsUIAlpha, 70, "UI Display Alpha Percentage"); MelonPrefs.RegisterBool(settingsCategory, prefsUIFlip, true, "Flip Display (Matches mirrors)"); MelonPrefs.RegisterBool(settingsCategory, prefsReflectOtherPlayers, false, "Reflect Other Players"); MelonPrefs.RegisterFloat(settingsCategory, prefsFarClippingDist, 5f, "Camera Cutoff Distance"); ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.QuickMenu, "Toggle Self Portrait", toggleSelfPortrait); //Using FadeTo hook to determine when world is pretty much loaded //Hooking FadeTo for world join late event foreach (MethodInfo method in typeof(VRCUiBackgroundFade).GetMethods(BindingFlags.Public | BindingFlags.Instance)) { if (method.Name.Contains("Method_Public_Void_Single_Action") && !method.Name.Contains("PDM")) { Log($"Found target fadeTo method, patching! ({method.Name})", true); harmony.Patch(method, null, new HarmonyMethod(typeof(BTKSASelfPortrait).GetMethod("OnFade", BindingFlags.Static | BindingFlags.Public))); } } loadAssets(); cameraEye = GameObject.Find("Camera (eye)"); hudContent = GameObject.Find("/UserInterface/UnscaledUI/HudContent"); }
public static void Init() { ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.SettingsMenu, "Optimize mirrors", OptimizeMirrors); ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.SettingsMenu, "Beautify mirrors", BeautifyMirrors); }
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 override void OnApplicationStart() { ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.QuickMenu, "OpenJint", SpawnMenu); ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.QuickMenu, "CloseJint", CloseMenu); }
public static void Initialize() { ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.UserDetailsMenu, "Remove Nickname", RemoveNicknameUserDetailsMenu); ExpansionKitApi.RegisterSimpleMenuButton(ExpandedMenu.UserDetailsMenu, "Update Nickname", UpdateNicknameUserDetailsMenu); }