private static void ShowWorlds() { ICustomShowableLayoutedMenu worldsPermissionsPopup = ExpansionKitApi.CreateCustomFullMenuPopup(LayoutDescription.WideSlimList); if (WorldPermissionHandler.BlacklistedWorlds.Count > 0) { worldsPermissionsPopup.AddLabel("Blacklisted Worlds"); foreach (WorldPermissionHandler.PermissionEntry blacklistedWorld in WorldPermissionHandler.BlacklistedWorlds) { worldsPermissionsPopup.AddSimpleButton( blacklistedWorld.WorldName, () => { worldsPermissionsPopup.Hide(); WorldPermissionHandler.RemoveFromBlacklist(blacklistedWorld.WorldId); WorldPermissionHandler.SaveSettings(); ShowWorlds(); }); } worldsPermissionsPopup.AddSpacer(); } worldsPermissionsPopup.AddSimpleButton("Close", () => worldsPermissionsPopup.Hide()); worldsPermissionsPopup.Show(); }
public void CubeMenu(bool useBigMenu) { ICustomShowableLayoutedMenu cubeMenu = null; cubeMenu = useBigMenu ? ExpansionKitApi.CreateCustomFullMenuPopup(LayoutDescriptionCustom.QuickMenu3Column4Row) : ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescriptionCustom.QuickMenu3Column4Row); cubeMenu.AddSimpleButton($"Destroy Cube", () => { DestroyCube(); cubeState = 0; }); cubeMenu.AddSimpleButton($"Create Custom Cube", () => { CreateCube(customCubeHeight, customCubeWidth, customCubeLength, cubeHeightOffset); cubeState = 10; }); cubeMenu.AddSimpleButton($"Settings", () => { SettMenu(useBigMenu); }); /// cubeMenu.AddSimpleButton($"Create Small Cube", () => { CreateCube(5, 5, 5, .1f); cubeState = 1; }); cubeMenu.AddSimpleButton($"Create Medium Cube", () => { CreateCube(15, 15, 15, .05f); cubeState = 2; }); cubeMenu.AddSimpleButton($"Create Large Cube", () => { CreateCube(30, 30, 30, .05f); cubeState = 3; }); ///// cubeMenu.AddSimpleButton($"Wall Visibility Menu", () => { WallMenu(useBigMenu); }); cubeMenu.AddSimpleButton($"Color Menu", () => { ColorMenu(useBigMenu); }); cubeMenu.AddSimpleButton($"Color Menu Adjust", () => { ColorMenuAdj(useBigMenu); }); ///// cubeMenu.AddSimpleButton($"--Exit--", () => { cubeMenu.Hide(); }); cubeMenu.AddToggleButton("Pickupable", (action) => { category.GetEntry <bool>("WallsPickupable").Value = !category.GetEntry <bool>("WallsPickupable").Value; OnPreferencesSaved(); }, () => category.GetEntry <bool>("WallsPickupable").Value); cubeMenu.AddToggleButton("Pickups snap to hand", (action) => { category.GetEntry <bool>("PickupOrient").Value = !category.GetEntry <bool>("PickupOrient").Value; OnPreferencesSaved(); }, () => category.GetEntry <bool>("PickupOrient").Value); //cubeMenu.AddSpacer(); cubeMenu.Show(); }
public void ColorMenuAdj(bool useBigMenu) { ICustomShowableLayoutedMenu Menu = null; Menu = useBigMenu ? ExpansionKitApi.CreateCustomFullMenuPopup(LayoutDescriptionCustom.QuickMenu3Column4Row) : ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescriptionCustom.QuickMenu3Column4Row); string[] colorList = { "Red", "Green", "Blue" }; for (int i = 0; i < colorList.GetLength(0); i++) { string c = colorList[i].Substring(0, 1); Menu.AddSimpleButton($"{(colorList[i])} -", () => { category.GetEntry <float>($"CubeColor{c}").Value = Clamp(category.GetEntry <float>($"CubeColor{c}").Value - 10, 0, 100); OnPreferencesSaved(); Menu.Hide(); ColorMenuAdj(useBigMenu); }); Menu.AddSimpleButton($"{(colorList[i])} -0-", () => { category.GetEntry <float>($"CubeColor{c}").Value = 0f; OnPreferencesSaved(); Menu.Hide(); ColorMenuAdj(useBigMenu); }); Menu.AddSimpleButton($"{(colorList[i])} +", () => { category.GetEntry <float>($"CubeColor{c}").Value = Clamp(category.GetEntry <float>($"CubeColor{c}").Value + 10, 0, 100); OnPreferencesSaved(); Menu.Hide(); ColorMenuAdj(useBigMenu); }); } Menu.AddSimpleButton("Color Adj\n----\nBack", () => { CubeMenu(useBigMenu); }); Menu.AddLabel($"R:{category.GetEntry<float>("CubeColorR").Value}\nG:{category.GetEntry<float>("CubeColorG").Value}\nB:{category.GetEntry<float>("CubeColorB").Value}"); Menu.Show(); }
public void ColorMenu(bool useBigMenu) { var colorList = new Dictionary <string, Color> { { "Black", Color.black }, { "Grey", Color.grey }, { "White", Color.white },// { "Red", Color.red }, { "Green", Color.green }, { "Blue", Color.blue },// { "Cyan", Color.cyan }, { "Magenta", Color.magenta }, { "Yellow", Color.yellow }// }; ICustomShowableLayoutedMenu Menu = null; Menu = useBigMenu ? ExpansionKitApi.CreateCustomFullMenuPopup(LayoutDescriptionCustom.QuickMenu3Column4Row) : ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescriptionCustom.QuickMenu3Column4Row); foreach (KeyValuePair <string, Color> entry in colorList) { if (entry.Key == "x") { Menu.AddSpacer(); continue; } //If desc is x, then skip Menu.AddSimpleButton(entry.Key, () => { category.GetEntry <float>("CubeColorR").Value = entry.Value.r * 100; category.GetEntry <float>("CubeColorG").Value = entry.Value.g * 100; category.GetEntry <float>("CubeColorB").Value = entry.Value.b * 100; OnPreferencesSaved(); }); } // Menu.AddSimpleButton("Color Menu\n----\nBack", () => { CubeMenu(useBigMenu); }); Menu.Show(); }
public static void ColorMenu() { var colorsList = new Dictionary <string, Color> { { "Black", Color.black }, { "Grey", Color.grey }, { "White", Color.white },// { "Red", Color.red }, { "Green", Color.green }, { "Blue", Color.blue },// { "Cyan", Color.cyan }, { "Magenta", Color.magenta }, { "Yellow", Color.yellow }// }; ICustomShowableLayoutedMenu Menu = null; Menu = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescriptionCustom.QuickMenu3Column4Row); foreach (KeyValuePair <string, Color> entry in colorsList) { if (entry.Key == "x") { Menu.AddSpacer(); continue; } //If desc is x, then skip Menu.AddSimpleButton(entry.Key, () => { colorList["Red"] = entry.Value.r * 100; colorList["Green"] = entry.Value.g * 100; colorList["Blue"] = entry.Value.b * 100; ColorMenuAdj(); }); } // Menu.AddSimpleButton("<-Back", () => { ColorMenuAdj(); }); Menu.Show(); }
private void addSettingsBackButtons() { int numSpaces; if (settings.Resolutions.Count <= 6) { numSpaces = 1; if (settings.Resolutions.Count % 3 != 0) { numSpaces += (3 - (settings.Resolutions.Count % 3)); } } else { numSpaces = 2; if (settings.Resolutions.Count % 4 != 0) { numSpaces += (4 - (settings.Resolutions.Count % 4)); } } for (int i = 0; i < numSpaces; i++) { camMenu.AddSpacer(); } camMenu.AddSimpleButton("Settings", delegate() { settingsMenu.Show(); }); camMenu.AddSimpleButton("Back", delegate() { camMenu.Hide(); }); }
private static void ShowRotationMenu() { if (_rotationMenu == null) { _rotationMenu = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescription.QuickMenu4Columns); _rotationMenu.AddSpacer(); _rotationMenu.AddSimpleButton("Forward", () => Move(Transform.right)); _rotationMenu.AddSpacer(); _rotationMenu.AddSpacer(); _rotationMenu.AddSimpleButton("Tilt Left", () => Move(Transform.forward)); _rotationMenu.AddSimpleButton("Reset", () => CameraTransform.localRotation = OriginalRotation); _rotationMenu.AddSimpleButton("Tilt Right", () => Move(-Transform.forward)); _rotationMenu.AddSpacer(); _rotationMenu.AddSpacer(); _rotationMenu.AddSimpleButton("Backward", () => Move(-Transform.right)); _rotationMenu.AddSimpleButton("Left", () => Move(-Transform.up)); _rotationMenu.AddSimpleButton("Right", () => Move(Transform.up)); _rotationMenu.AddToggleButton("High precision", b => HighPrecision = b, () => HighPrecision); _rotationMenu.AddSpacer(); _rotationMenu.AddSpacer(); _rotationMenu.AddSimpleButton("Back", _rotationMenu.Hide); } _rotationMenu.Show(); }
public void DefaultsMenu(bool useBigMenu) { ICustomShowableLayoutedMenu mirrorLayerMenu = null; mirrorLayerMenu = useBigMenu ? ExpansionKitApi.CreateCustomFullMenuPopup(LayoutDescriptionCustom.QuickMenu3Column) : ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescriptionCustom.QuickMenu3Column_Longer); mirrorLayerMenu.AddLabel("Set Default Layer Mask On World Join"); mirrorLayerMenu.AddToggleButton("Set on Join", b => setMaskOnJoin.Value = b, () => setMaskOnJoin.Value); //mirrorLayerMenu.AddLabel($"Mask: {defaultMask.Value}"); mirrorLayerMenu.AddSpacer(); mirrorLayerMenu.AddSpacer(); mirrorLayerMenu.AddSimpleButton($"Enable All", () => { defaultMask.Value = -1; UpdateButtons(defaultMask.Value); }); mirrorLayerMenu.AddSimpleButton($"Disable All", () => { defaultMask.Value = 0; UpdateButtons(defaultMask.Value); }); foreach (KeyValuePair <int, string> entry in layerList) { mirrorLayerMenu.AddLabel($"Layer #{entry.Key} {(IsLayerEnabled(defaultMask.Value, entry.Key) ? "++++++++" : "-----------")} \n{entry.Value}", (button) => buttonList[entry.Key] = button.transform); mirrorLayerMenu.AddSimpleButton($"Enable", () => { defaultMask.Value = defaultMask.Value | (1 << entry.Key); UpdateButtons(defaultMask.Value); }); //Remove Layer mirrorLayerMenu.AddSimpleButton($"Disable", () => { defaultMask.Value = defaultMask.Value & ~(1 << entry.Key); UpdateButtons(defaultMask.Value); }); //Add Layer } mirrorLayerMenu.AddSimpleButton($"Close", () => { mirrorLayerMenu.Hide(); }); mirrorLayerMenu.AddSimpleButton($"Back", () => { EditMirrorLayersMenu(useBigMenu, null); }); mirrorLayerMenu.Show(); }
private static void ColorMenuAdj() { ICustomShowableLayoutedMenu Menu = null; Menu = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescriptionCustom.QuickMenu3Column4Row); foreach (KeyValuePair <string, float> entry in colorList) { string c = entry.Key; Menu.AddSimpleButton($"{(c)} -", () => { colorList[c] = Clamp(entry.Value - 10, 0, 100); Menu.Hide(); ColorMenuAdj(); }); Menu.AddSimpleButton($"{(c)} - 0/100", () => { if (colorList[c] != 0f) { colorList[c] = 0f; } else { colorList[c] = 100f; } Menu.Hide(); ColorMenuAdj(); }); Menu.AddSimpleButton($"{(c)} +", () => { colorList[c] = Clamp(colorList[c] + 10, 0, 100); Menu.Hide(); ColorMenuAdj(); }); } Menu.AddSimpleButton($"<-Back", () => { CamSettingsMenu(); }); Menu.AddLabel($"R:{colorList["Red"]}\nG:{colorList["Green"]}\nB:{colorList["Blue"]}"); camColor.Value = new Color(colorList["Red"] / 100, colorList["Green"] / 100, colorList["Blue"] / 100); Menu.Show(); }
public static void ColorMenuAdj() { ICustomShowableLayoutedMenu Menu = null; Menu = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescriptionCustom.QuickMenu3Column5Row); foreach (KeyValuePair <string, float> entry in colorList) { string c = entry.Key; Menu.AddSimpleButton($"{(c)} -", () => { colorList[c] = Utils.Clamp(entry.Value - 10, 0, 100); Menu.Hide(); ColorMenuAdj(); }); Menu.AddSimpleButton($"{(c)} - 0/100", () => { if (colorList[c] != 0f) { colorList[c] = 0f; } else { colorList[c] = 100f; } Menu.Hide(); ColorMenuAdj(); }); Menu.AddSimpleButton($"{(c)} +", () => { colorList[c] = Utils.Clamp(colorList[c] + 10, 0, 100); Menu.Hide(); ColorMenuAdj(); }); } Menu.AddSimpleButton($"-Update Active Light-", () => { Main.UpdateLight(Main.activeLight); }); Menu.AddSimpleButton($"All -", () => { colorList["Red"] = Utils.Clamp(colorList["Red"] - 10, 0, 100); colorList["Green"] = Utils.Clamp(colorList["Green"] - 10, 0, 100); colorList["Blue"] = Utils.Clamp(colorList["Blue"] - 10, 0, 100); Menu.Hide(); ColorMenuAdj(); }); Menu.AddSimpleButton($"All +", () => { colorList["Red"] = Utils.Clamp(colorList["Red"] + 10, 0, 100); colorList["Green"] = Utils.Clamp(colorList["Green"] + 10, 0, 100); colorList["Blue"] = Utils.Clamp(colorList["Blue"] + 10, 0, 100); Menu.Hide(); ColorMenuAdj(); }); Menu.AddSimpleButton($"<-Back\nR:{colorList["Red"]}\nG:{colorList["Green"]}\nB:{colorList["Blue"]}", () => { LightDetailsMenu(); }); Menu.AddSimpleButton("Color Shortcuts", () => { ColorMenu(); }); Menu.AddSimpleButton("Save/Load Colors", () => { StoredColorsMenu(); }); Main.Config.lightColor = new Color(Utils.Clamp(colorList["Red"] / 100, 0, 1), Utils.Clamp(colorList["Green"] / 100, 0, 1), Utils.Clamp(colorList["Blue"] / 100, 0, 1)); Menu.Show(); }
public static void Show(string title, Action <List <Keys> > acceptAction, Action cancelAction) { selectedKeys.Clear(); AcceptAction = acceptAction; CancelAction = cancelAction; Page.Show(); if (titleObject != null && titleObject.GetComponentInChildren <Text>() != null) { titleObject.GetComponentInChildren <Text>().text = title; } fetchingKeys = true; MelonLoader.MelonCoroutines.Start(WaitForKey()); }
public void ViewMirrorLayers(bool useBigMenu) { ICustomShowableLayoutedMenu mirrorLayerView = null; mirrorLayerView = useBigMenu ? ExpansionKitApi.CreateCustomFullMenuPopup(LayoutDescription.WideSlimList) : ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescription.WideSlimList); mirrorLayerView.AddLabel("All mirrors in world\n Layer format is 'Layer:E/D' E - Enabled, D-Disabled"); foreach (var vrcMirrorReflection in UnityEngine.Object.FindObjectsOfType <VRC_MirrorReflection>()) { mirrorLayerView.AddSimpleButton($"Edit Mirror: {vrcMirrorReflection.gameObject.name}", () => { EditMirrorLayersMenu(useBigMenu, vrcMirrorReflection); }); mirrorLayerView.AddLabel($"Path: {GetHierarchyPath(vrcMirrorReflection.gameObject.transform)}"); mirrorLayerView.AddLabel($"{FindLayerString(vrcMirrorReflection.m_ReflectLayers.value)}"); } mirrorLayerView.AddSimpleButton($"Back", () => { EditMirrorLayersMenu(useBigMenu, null); }); mirrorLayerView.AddSimpleButton($"Close", () => { mirrorLayerView.Hide(); }); mirrorLayerView.Show(); }
public void WallMenu(bool useBigMenu) { ICustomShowableLayoutedMenu wallMenu = null; wallMenu = useBigMenu ? ExpansionKitApi.CreateCustomFullMenuPopup(LayoutDescription.QuickMenu3Columns) : ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescription.QuickMenu3Columns); wallMenu.AddSimpleButton($"Toggle\nTop", () => { wallTop.gameObject.SetActive(!wallTop.gameObject.active); }); wallMenu.AddSimpleButton($"Toggle\nFront", () => { wallFront.gameObject.SetActive(!wallFront.gameObject.active); }); wallMenu.AddSimpleButton($"Toggle\nBottom", () => { wallBottom.gameObject.SetActive(!wallBottom.gameObject.active); }); // wallMenu.AddSimpleButton($"Toggle\nLeft", () => { wallLeft.gameObject.SetActive(!wallLeft.gameObject.active); }); wallMenu.AddSimpleButton($"Toggle\nBack", () => { wallBack.gameObject.SetActive(!wallBack.gameObject.active); }); wallMenu.AddSimpleButton($"Toggle\nRight", () => { wallRight.gameObject.SetActive(!wallRight.gameObject.active); }); // wallMenu.AddSimpleButton("Wall Visibility Menu\n----\nBack", () => { CubeMenu(useBigMenu); }); wallMenu.AddSimpleButton($"All On", () => { if (localCube != null) { for (int i = 0; i < localCube.transform.childCount; ++i) { if (localCube.transform.GetChild(i).gameObject != null && !localCube.transform.GetChild(i).gameObject.Equals(null)) { localCube.transform.GetChild(i).gameObject.SetActive(true); } } } }); wallMenu.AddSimpleButton($"All Off", () => { if (localCube != null) { for (int i = 0; i < localCube.transform.childCount; ++i) { if (localCube.transform.GetChild(i).gameObject != null && !localCube.transform.GetChild(i).gameObject.Equals(null)) { localCube.transform.GetChild(i).gameObject.SetActive(false); } } } }); wallMenu.Show(); }
private static void ShowUsers() { ICustomShowableLayoutedMenu userPermissionsPopup = ExpansionKitApi.CreateCustomFullMenuPopup(LayoutDescription.WideSlimList); if (UserPermissionHandler.BlacklistedUsers.Count > 0) { userPermissionsPopup.AddLabel("Blacklisted Users"); foreach (UserPermissionHandler.PermissionEntry blacklistedUser in UserPermissionHandler.BlacklistedUsers) { userPermissionsPopup.AddSimpleButton( blacklistedUser.DisplayName, () => { userPermissionsPopup.Hide(); UserPermissionHandler.RemoveFromBlacklist(blacklistedUser.UserId); UserPermissionHandler.SaveSettings(); ShowUsers(); }); } userPermissionsPopup.AddSpacer(); } if (UserPermissionHandler.WhitelistedUsers.Count > 0) { userPermissionsPopup.AddLabel("Whitelisted Users"); foreach (UserPermissionHandler.PermissionEntry whitelistedUser in UserPermissionHandler.WhitelistedUsers) { userPermissionsPopup.AddSimpleButton( whitelistedUser.DisplayName, () => { userPermissionsPopup.Hide(); UserPermissionHandler.RemoveFromWhitelist(whitelistedUser.UserId); UserPermissionHandler.SaveSettings(); ShowUsers(); }); } userPermissionsPopup.AddSpacer(); } userPermissionsPopup.AddSimpleButton("Close", () => userPermissionsPopup.Hide()); userPermissionsPopup.Show(); }
public void SettMenu(bool useBigMenu) { ICustomShowableLayoutedMenu Menu = null; Menu = useBigMenu ? ExpansionKitApi.CreateCustomFullMenuPopup(LayoutDescription.QuickMenu3Columns) : ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescription.QuickMenu3Columns); Menu.AddToggleButton("Cube Button on QuickMenu", (action) => { category.GetEntry <bool>("CubeQMButt").Value = !category.GetEntry <bool>("CubeQMButt").Value; OnPreferencesSaved(); }, () => category.GetEntry <bool>("CubeQMButt").Value); Menu.AddToggleButton("Cube Button on World Big Menu", (action) => { category.GetEntry <bool>("CubeBigButt").Value = !category.GetEntry <bool>("CubeBigButt").Value; OnPreferencesSaved(); }, () => category.GetEntry <bool>("CubeBigButt").Value); Menu.AddSpacer(); /// Menu.AddSimpleButton($"-", () => { category.GetEntry <float>($"CubeHeightOffset").Value = Clamp(category.GetEntry <float>($"CubeHeightOffset").Value - 10, 0, 100); OnPreferencesSaved(); Menu.Hide(); SettMenu(useBigMenu); }); Menu.AddSimpleButton($"Cube Height Offset:{(category.GetEntry<float>("CubeHeightOffset").Value)}\n0=None, 100=-1/2 Height", () => { }); Menu.AddSimpleButton($"+", () => { category.GetEntry <float>($"CubeHeightOffset").Value = Clamp(category.GetEntry <float>($"CubeHeightOffset").Value + 10, 0, 100); OnPreferencesSaved(); Menu.Hide(); SettMenu(useBigMenu); }); /// Menu.AddSimpleButton("Settings Menu\n----\nBack", () => { CubeMenu(useBigMenu); }); Menu.AddToggleButton("Cube Respawns on world join", (action) => { category.GetEntry <bool>("CubeRepawn").Value = !category.GetEntry <bool>("CubeRepawn").Value; OnPreferencesSaved(); }, () => category.GetEntry <bool>("CubeRepawn").Value); Menu.AddToggleButton("Use Standard Shader vs Unlit Color", (action) => { category.GetEntry <bool>("UseStandard").Value = !category.GetEntry <bool>("UseStandard").Value; OnPreferencesSaved(); }, () => category.GetEntry <bool>("UseStandard").Value); Menu.Show(); }
public override void OnApplicationStart() { Instance = this; CacheManager.Init(); foreach (MethodInfo method in typeof(MenuController).GetMethods().Where(mi => mi.Name.StartsWith("Method_Public_Void_APIUser_") && !mi.Name.Contains("_PDM_"))) { HarmonyInstance.Patch(method, postfix: new HarmonyMethod(typeof(UserInfoExtensionsMod).GetMethod("OnUserInfoOpen", BindingFlags.Static | BindingFlags.Public))); } HarmonyInstance.Patch(AccessTools.Method(typeof(PageUserInfo), "Back"), postfix: new HarmonyMethod(typeof(UserInfoExtensionsMod).GetMethod("OnUserInfoClose", BindingFlags.Static | BindingFlags.Public))); LayoutDescription popupLayout = new LayoutDescription { RowHeight = 80, NumColumns = 3, NumRows = 5 }; menu = ExpansionKitApi.CreateCustomFullMenuPopup(popupLayout); userDetailsMenu = ExpansionKitApi.GetExpandedMenu(ExpandedMenu.UserDetailsMenu); menu.AddLabel("General Things"); menu.AddSpacer(); menu.AddSimpleButton("Back", () => menu.Hide()); userDetailsMenu.AddSimpleButton("UserInfoExtensions", () => { HideAllPopups(); menu.Show(); foreach (ModuleBase module in modules) { module.OnUIXMenuOpen(); } }); AddModule(new QuickMenuFromSocial()); AddModule(new GetAvatarAuthor()); AddModule(new BioButtons()); AddModule(new UserInformation()); AddModule(new AvatarInformation()); VRCUtils.OnUiManagerInit += OnUiManagerInit; MelonLogger.Msg("Initialized!"); }
public void initMenus() { ExpansionKitApi.GetExpandedMenu(ExpandedMenu.CameraQuickMenu).AddSimpleButton("Resolution", delegate() { camMenu.Show(); }); settingsMenu = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescription.WideSlimList); settingsMenu.AddLabel("\nChange Resolutions"); settingsMenu.AddSimpleButton("Add Resolution", delegate() { MelonCoroutines.Start(addCam()); }); settingsMenu.AddSimpleButton("Delete Resolution", delegate() { MelonCoroutines.Start(removeCam()); }); settingsMenu.AddLabel("\nChange Default Settings"); settingsMenu.AddSimpleButton("Default Aspect Ratio", delegate() { MelonCoroutines.Start(ChangeDefaultAspectRatio()); }); settingsMenu.AddSimpleButton("Default Resolution", delegate() { MelonCoroutines.Start(ChangeDefaultRes()); }); settingsMenu.AddSimpleButton("Clipping Planes", delegate() { MelonCoroutines.Start(ChangeClipSetting()); }); settingsMenu.AddSpacer(); settingsMenu.AddSimpleButton("Back", delegate() { settingsMenu.Hide(); }); loadCamMenu(); }
// Based on knah's ViewPointTweaker mod, https://github.com/knah/VRCMods/blob/master/ViewPointTweaker private void ShowRotationMenu() { if (rotationMenu == null) { rotationMenu = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescription.QuickMenu4Columns); void Move(Vector3 direction) { cameraTransform.Rotate(direction, highPrecision ? highPrecisionRotationValue : rotationValue, Space.World); } var transform = Camera.main.transform; rotationMenu.AddSpacer(); rotationMenu.AddSimpleButton("Forward", () => Move(transform.right)); rotationMenu.AddSpacer(); rotationMenu.AddSpacer(); rotationMenu.AddSimpleButton("Tilt Left", () => Move(transform.forward)); rotationMenu.AddSimpleButton("Reset", () => cameraTransform.localRotation = originalRotation); rotationMenu.AddSimpleButton("Tilt Right", () => Move(-transform.forward)); rotationMenu.AddSpacer(); rotationMenu.AddSpacer(); rotationMenu.AddSimpleButton("Backward", () => Move(-transform.right)); rotationMenu.AddSimpleButton("Left", () => Move(-transform.up)); rotationMenu.AddSimpleButton("Right", () => Move(transform.up)); rotationMenu.AddToggleButton("High precision", b => highPrecision = b, () => highPrecision); rotationMenu.AddSpacer(); rotationMenu.AddSpacer(); rotationMenu.AddSimpleButton("Back", rotationMenu.Hide); } rotationMenu.Show(); }
public void EditMirrorLayersMenu(bool useBigMenu, VRC_MirrorReflection mirror) { ICustomShowableLayoutedMenu mirrorLayerMenu = null; mirrorLayerMenu = useBigMenu ? ExpansionKitApi.CreateCustomFullMenuPopup(LayoutDescriptionCustom.QuickMenu3Column) : ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescriptionCustom.QuickMenu3Column_Longer); if (mirror is null) { mirrorLayerMenu.AddLabel("Enable/Disable Layers on All Mirrors in a world"); } else { mirrorLayerMenu.AddLabel("Enable/Disable Layers on specific mirror:"); } if (mirror is null) { mirrorLayerMenu.AddSimpleButton($"All to Full", () => { SetSingleLayerOnMirrors(0, 10, mirror); }); } else { mirrorLayerMenu.AddLabel($"{mirror.gameObject.name}"); } if (mirror is null) { mirrorLayerMenu.AddSimpleButton($"All to Optimized", () => { SetSingleLayerOnMirrors(0, 11, mirror); }); } else { mirrorLayerMenu.AddLabel($"{GetHierarchyPath(mirror.gameObject.transform)}"); } mirrorLayerMenu.AddSimpleButton($"View Mirrors", () => { ViewMirrorLayers(useBigMenu); }); if (mirror is null) { mirrorLayerMenu.AddSimpleButton($"Enable All", () => { SetSingleLayerOnMirrors(0, 5, mirror); }); } else { mirrorLayerMenu.AddSimpleButton($"Enable All", () => { SetSingleLayerOnMirrors(0, 5, mirror); UpdateButtons(mirror.m_ReflectLayers); }); } if (mirror is null) { mirrorLayerMenu.AddSimpleButton($"Disable All", () => { SetSingleLayerOnMirrors(0, 6, mirror); }); } else { mirrorLayerMenu.AddSimpleButton($"Disable All", () => { SetSingleLayerOnMirrors(0, 6, mirror); UpdateButtons(mirror.m_ReflectLayers); }); } foreach (KeyValuePair <int, string> entry in layerList) { if (mirror is null) { mirrorLayerMenu.AddLabel($"Layer #{entry.Key} ----------- \n{entry.Value}"); mirrorLayerMenu.AddSimpleButton($"Enable", () => { SetSingleLayerOnMirrors(entry.Key, 1, mirror); }); mirrorLayerMenu.AddSimpleButton($"Disable", () => { SetSingleLayerOnMirrors(entry.Key, 0, mirror); }); } else { //If editing solo mirror, show current state on lables mirrorLayerMenu.AddLabel($"Layer #{entry.Key} {(IsLayerEnabled(mirror.m_ReflectLayers.value, entry.Key) ? "++++++++" : "-----------")} \n{entry.Value}", (button) => buttonList[entry.Key] = button.transform); //mirrorLayerMenu.AddToggleButton($"Enable", b => { // if (b) // SetSingleLayerOnMirrors(entry.Key, 1, mirror); // else // SetSingleLayerOnMirrors(entry.Key, 0, mirror); //}, () => IsLayerEnabled(mirror.m_ReflectLayers.value, entry.Key)); mirrorLayerMenu.AddSimpleButton($"Enable", () => { SetSingleLayerOnMirrors(entry.Key, 1, mirror); UpdateButtons(mirror.m_ReflectLayers.value); }); mirrorLayerMenu.AddSimpleButton($"Disable", () => { SetSingleLayerOnMirrors(entry.Key, 0, mirror); UpdateButtons(mirror.m_ReflectLayers.value); }); } } mirrorLayerMenu.AddSimpleButton($"View Mirrors", () => { ViewMirrorLayers(useBigMenu); }); mirrorLayerMenu.AddSimpleButton($"Close", () => { mirrorLayerMenu.Hide(); }); if (mirror is null) { mirrorLayerMenu.AddSimpleButton($"Defaults Menu", () => { DefaultsMenu(useBigMenu); }); } else { mirrorLayerMenu.AddSimpleButton($"Back", () => { EditMirrorLayersMenu(useBigMenu, null); }); } mirrorLayerMenu.Show(); }
public override void Init() { AvatarInfoMenuButton = MelonPreferences.CreateEntry("UserInfoExtensionsSettings", nameof(AvatarInfoMenuButton), true, "Show \"Avatar Info Menu\" button in Avatar Menu"); ExpansionKitApi.GetExpandedMenu(ExpandedMenu.AvatarMenu).AddSimpleButton("Avatar Info Menu", new Action(() => { avatarInfoMenu?.Show(); OnMenuShown(); }), new Action <GameObject>((go) => { avatarInfoMenuButtonGameObject = go; GetAvatarAuthor.avatarPage.GetComponent <EnableDisableListener>().OnDisabled += new Action(() => avatarInfoMenu?.Hide()); })); avatarInfoMenu = ExpansionKitApi.CreateCustomFullMenuPopup(new LayoutDescription() { RowHeight = 80, NumColumns = 3, NumRows = 5 }); avatarInfoMenu.AddLabel("Avatar information:"); avatarInfoMenu.AddSpacer(); avatarInfoMenu.AddSimpleButton("Back", new Action(() => avatarInfoMenu.Hide())); avatarInfoMenu.AddSimpleButton("", new Action(() => { }), new Action <GameObject>((gameObject) => authorNameLabel = gameObject.transform.GetChild(0).GetComponent <Text>())); avatarInfoMenu.AddSimpleButton("Show Avatar Description", new Action(() => { avatarInfoMenu.Hide(); UiManager.OpenSmallPopup("Description:", avatar.description == null ? "" : avatar.description, "Close", UiManager.ClosePopup); })); avatarInfoMenu.AddSimpleButton("", new Action(() => { }), new Action <GameObject>((gameObject) => avatarNameLabel = gameObject.transform.GetChild(0).GetComponent <Text>())); avatarInfoMenu.AddSimpleButton("", new Action(() => { }), new Action <GameObject>((gameObject) => platformLabel = gameObject.transform.GetChild(0).GetComponent <Text>())); avatarInfoMenu.AddSimpleButton("", new Action(() => { }), new Action <GameObject>((gameObject) => releaseTypeLabel = gameObject.transform.GetChild(0).GetComponent <Text>())); avatarInfoMenu.AddSimpleButton("", new Action(() => { }), new Action <GameObject>((gameObject) => lastUpdatedLabel = gameObject.transform.GetChild(0).GetComponent <Text>())); avatarInfoMenu.AddSimpleButton("", new Action(() => { }), new Action <GameObject>((gameObject) => VersionLabel = gameObject.transform.GetChild(0).GetComponent <Text>())); }
public void OpenMenu() { customMenu.Show(); }