Ejemplo n.º 1
0
        public override void OnApplicationStart()
        {
            Logger = new MelonLogger.Instance("DisableControllerOverlay", ConsoleColor.DarkYellow);

            cat = MelonPreferences.CreateCategory("DisableControllerOverlay", "DisableControllerOverlay");
            disableToolTipsOnLoad = MelonPreferences.CreateEntry("DisableControllerOverlay", nameof(disableToolTipsOnLoad), true, "Disable Controller Tooltips on Game Load");
            disableToolTips       = MelonPreferences.CreateEntry("DisableControllerOverlay", nameof(disableToolTips), true, "Disable Controller Tooltips");
            disableMeshOnly       = MelonPreferences.CreateEntry("DisableControllerOverlay", nameof(disableMeshOnly), true, "Disable Controller Mesh Only");

            disableToolTips.OnValueChanged += disableChange;
            disableMeshOnly.OnValueChanged += disableChange;

            var toolTipsMenu = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescriptionCustom.QuickMenu1Column5Row);

            ExpansionKitApi.GetExpandedMenu(ExpandedMenu.UiElementsQuickMenu).AddSimpleButton("Controller Tooltips", () => toolTipsMenu.Show());
            toolTipsMenu.AddLabel("Controller Tooltips");
            toolTipsMenu.AddToggleButton("Disable Controller Tooltips", (action) =>
            {
                disableToolTips.Value = !disableToolTips.Value;
            }, () => disableToolTips.Value);
            toolTipsMenu.AddToggleButton("Disable Controller Mesh Only", (action) =>
            {
                disableMeshOnly.Value = !disableMeshOnly.Value;
            }, () => disableMeshOnly.Value);
            toolTipsMenu.AddToggleButton("Disable on Game Load", (action) =>
            {
                disableToolTipsOnLoad.Value = !disableToolTipsOnLoad.Value;
            }, () => disableToolTipsOnLoad.Value);
            toolTipsMenu.AddSimpleButton("Close", () => toolTipsMenu.Hide());
        }
Ejemplo n.º 2
0
        public static void RegisterSettings(ICustomShowableLayoutedMenu parent, Action on_exit)
        {
            parent.AddButtonToggleListItem("World Sound", "Settings", () => {
                var sound_menu = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescription.WideSlimList);

                sound_menu.AddHeader("World Audio Settings");
                sound_menu.AddDropdownListItem("Preset", typeof(Preset), (value) => {
                    if ((Preset)value == Preset.Custom)
                    {
                        return;
                    }
                    s_AudioConfig = PresetAudioConfigs[value - 1];
                    s_Enabled     = true;
                    ApplySettingsToAll();
                    sound_menu.Hide();
                    on_exit();
                }, (int)Preset.Custom);

                sound_menu.AddCategoryHeader("Player voice");
                sound_menu.AddSliderListItem("Gain", (val) => { s_AudioConfig.voice_gain = val; }, () => s_AudioConfig.voice_gain, 0, 24);
                sound_menu.AddFloatDiffListItem("Far", (val) => { s_AudioConfig.voice_distance_far = val; }, () => s_AudioConfig.voice_distance_far);
                sound_menu.AddFloatDiffListItem("Near", (val) => { s_AudioConfig.voice_distance_near = val; }, () => s_AudioConfig.voice_distance_near);
                sound_menu.AddFloatDiffListItem("Volumetric Radius", (val) => { s_AudioConfig.voice_volumetric_radius = val; }, () => s_AudioConfig.voice_volumetric_radius);
                sound_menu.AddToggleListItem("Lowpass", (val) => { s_AudioConfig.voice_lowpass = val; }, () => s_AudioConfig.voice_lowpass, false);

                sound_menu.AddSimpleButton("Apply to all", ApplySettingsToAll);

                sound_menu.AddSimpleButton("Back", () => { sound_menu.Hide(); on_exit(); });
                sound_menu.Show();
            }, (enable) => {
                s_Enabled = enable;
            }, () => s_Enabled, false);
        }
Ejemplo n.º 3
0
        private void MainMenu()
        {
            var settings_menu = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescription.WideSlimList);

            settings_menu.AddHeader("World Cleanup");

            /* Light shadows */
            if (s_Lights.Count() > 0)
            {
                settings_menu.AddButtonToggleListItem("Shadows", $"Lights: {s_Lights.Count()}", () =>
                {
                    var shadows_menu = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescription.WideSlimList);
                    foreach (var light in s_Lights)
                    {
                        shadows_menu.AddDropdownListItem(light.Item1.name, typeof(LightShadows), (state) => { light.Item1.shadows = (LightShadows)state; }, (int)light.Item1.shadows);
                    }
                    shadows_menu.AddSimpleButton("Back", MainMenu);
                    shadows_menu.Show();
                }, (restore) =>
                {
                    foreach (var(light, original) in s_Lights)
                    {
                        light.shadows = restore ? original : LightShadows.None;
                    }
                    Settings.s_DisableLights.Value = !restore;
                }, () => !Settings.s_DisableLights.Value, false);
Ejemplo n.º 4
0
        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();
        }
Ejemplo n.º 5
0
        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();
        }
Ejemplo n.º 6
0
        private static void StoredColorsMenu()
        {//type T|F - Pos|Rot
            var storedMenu = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescriptionCustom.QuickMenu3ColumnsSlim);

            foreach (KeyValuePair <int, System.Tuple <float, float, float> > slot in SaveSlots.GetSavedColors())
            {
                string label = $"Slot: {slot.Key}\nR:{Utils.NumFormat(slot.Value.Item1)}\nG:{Utils.NumFormat(slot.Value.Item2)}\nB:{Utils.NumFormat(slot.Value.Item3)}";
                storedMenu.AddLabel(label);
                storedMenu.AddSimpleButton($"Load", () =>
                {
                    colorList["Red"]   = slot.Value.Item1;
                    colorList["Green"] = slot.Value.Item2;
                    colorList["Blue"]  = slot.Value.Item3;
                    storedMenu.Hide();
                    ColorMenuAdj(); //Return to previous on load
                });
                storedMenu.AddSimpleButton($"Save", () =>
                {
                    SaveSlots.Store(slot.Key, new System.Tuple <float, float, float>(colorList["Red"], colorList["Green"], colorList["Blue"]));
                    storedMenu.Hide();
                    StoredColorsMenu();
                });
            }
            storedMenu.AddSimpleButton("<-Back", (() =>
            {
                ColorMenuAdj();
            }));
            string current = $"Current:\nR:{Utils.NumFormat(colorList["Red"])}\nG:{Utils.NumFormat(colorList["Green"])}\nB:{Utils.NumFormat(colorList["Blue"])}";

            storedMenu.AddLabel(current);

            storedMenu.Show();
        }
Ejemplo n.º 7
0
        public static void SetName(bool cas)
        {
            var chars = "abcdefghijklmnopqrstuvwxyz-_ ".ToCharArray();
            var menu  = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescriptionCustom.QuickMenu3Column10Row);

            menu.AddSimpleButton("<-Back", () => { LightDetailsMenu(); });
            menu.AddLabel(Main.Config.name, (button) => butt = button.transform);;
            menu.AddSimpleButton("BackSpace", () => {
                if (Main.Config.name.Length > 0)
                {
                    Main.Config.name = Main.Config.name.Remove(Main.Config.name.Length - 1, 1);
                }
                butt.GetComponentInChildren <Text>().text = Main.Config.name;
            });

            foreach (char c in chars)
            {
                var s = cas ? c.ToString().ToUpper() : c.ToString();
                menu.AddSimpleButton(s, () => {
                    Main.Config.name += s;
                    butt.GetComponentInChildren <Text>().text = Main.Config.name;
                });
            }

            menu.AddSimpleButton("Toggle Case", () => { SetName(!cas); });
            menu.Show();
        }
Ejemplo n.º 8
0
        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();
        }
Ejemplo n.º 9
0
        //private IEnumerator SetupUI()//I want the button to be last on the list
        //{
        //    while (QuickMenu.prop_QuickMenu_0 == null) yield return null;
        //    yield return new WaitForSeconds(10f);
        //    MelonLogger.Msg($"Adding QM button late and reloading the menu");
        //    ExpansionKitApi.GetExpandedMenu(ExpandedMenu.QuickMenu).AddSimpleButton("Local Camera", () => ToggleCamMenu());
        //    MelonPreferences.Save();
        //}

        public void ToggleCamMenu()
        {
            var localcamMenu = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescriptionCustom.QuickMenu);

            buttonList.Clear();
            localcamMenu.AddSimpleButton("Local Camera\n-----\nClose menu", () => localcamMenu.Hide());
            localcamMenu.AddSimpleButton($"Camera is\n{(_localCam != null ? "Enabled" : "Disabled") }", (() => ToggleCamera()), (button) => buttonList["toggleBut"] = button.transform);
            localcamMenu.AddToggleButton($"Hide Camera", ((action) => HideMesh()), () => hideCam);

            localcamMenu.AddSimpleButton("Larger", (() => CamScale(1)));
            localcamMenu.AddSimpleButton("Smaller", (() => CamScale(-1)));
            localcamMenu.AddSimpleButton("Reset", (() => CamScale(0)));

            localcamMenu.AddSimpleButton("Zoom+", (() => CamFov(-1)));
            localcamMenu.AddSimpleButton("Zoom-", (() => CamFov(1)));
            localcamMenu.AddSimpleButton("Reset", (() => CamFov(0)));

            localcamMenu.AddSimpleButton("Selfie Stick", (() => Stick(true)));
            localcamMenu.AddSimpleButton("Rotate to Head", (() => RotateHead()));
            localcamMenu.AddToggleButton($"Follow Tracking Space", ((action) => TrackingSpace()), () => parentTracking.Value);

            localcamMenu.AddToggleButton($"Pickupable", ((action) => CamPickup()), () => _pickupable);

            localcamMenu.Show();
        }
Ejemplo n.º 10
0
        private static void SavedPrefSlots()
        {//pickupOrient;pickupable;lightType;lightRange;lightSpotAngle;lightColor;lightIntensity;lightBounceIntensity;lightShadows;name;
            var storedMenu = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescriptionCustom.QuickMenu6Columns);

            foreach (KeyValuePair <int, (bool, bool, LightType, float, float, Color, float, float, LightShadows, float, string, bool)> slot in SaveSlots.GetSavedPrefs())
            {
                string label = $"Slot: {slot.Key}\n{slot.Value.Item11}\n{slot.Value.Item3}\nR:{slot.Value.Item6.r} G:{slot.Value.Item6.g} B:{slot.Value.Item6.b}\nInten:{slot.Value.Item7}\nHidden:{slot.Value.Item12}";//\nUp:{Utils.NumberFormat(slot.Value.Item1)}\nForward:{Utils.NumberFormat(slot.Value.Item2)}\nSide:{Utils.NumberFormat(slot.Value.Item3)}"
                storedMenu.AddLabel(label);
                storedMenu.AddSimpleButton($"Load", () =>
                {
                    Main.Config.name                 = slot.Value.Item11;
                    Main.Config.pickupOrient         = slot.Value.Item1;
                    Main.Config.pickupable           = slot.Value.Item2;
                    Main.Config.lightType            = slot.Value.Item3;
                    Main.Config.lightRange           = slot.Value.Item4;
                    Main.Config.lightSpotAngle       = slot.Value.Item5;
                    Main.Config.lightColor           = slot.Value.Item6;
                    Main.Config.lightIntensity       = slot.Value.Item7;
                    Main.Config.lightBounceIntensity = slot.Value.Item8;
                    Main.Config.lightShadows         = slot.Value.Item9;
                    Main.Config.lightShadowStr       = slot.Value.Item10;
                    Main.Config.hideMeshRender       = slot.Value.Item12;

                    SavedPrefSlots();
                });
                storedMenu.AddSimpleButton($"Save", () =>
                {
                    var menu2 = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescriptionCustom.QuickMenu1ColumnWideSlim);
                    menu2.AddLabel($"Are you sure you want to save to slot:\n{slot.Key} | {slot.Value.Item11}");
                    menu2.AddSimpleButton($"Yes", () =>
                    {
                        SaveSlots.StorePrefs(slot.Key, (Main.Config.pickupOrient, Main.Config.pickupable, Main.Config.lightType, Main.Config.lightRange, Main.Config.lightSpotAngle, Main.Config.lightColor, Main.Config.lightIntensity, Main.Config.lightBounceIntensity, Main.Config.lightShadows, Main.Config.lightShadowStr, Main.Config.name, Main.Config.hideMeshRender));
                        SavedPrefSlots();
                    });
                    menu2.AddSimpleButton($"No", () =>
                    {
                        SavedPrefSlots();
                    });
                    menu2.Show();
                });

                if (slot.Key == 4)
                {
                    storedMenu.AddSimpleButton("<-Back", (() =>
                    {
                        LightTypeMenu();
                    }));
                    string current = CurrentConfig();
                    storedMenu.AddLabel(current);
                    storedMenu.AddSimpleButton($"-Update Active Light-", () =>
                    {
                        Main.UpdateLight(Main.activeLight);
                    });
                }
            }

            storedMenu.Show();
        }
Ejemplo n.º 11
0
        public override void OnApplicationStart()
        {
            Logger = new MelonLogger.Instance("NearClipPlaneAdj", ConsoleColor.DarkYellow);

            MelonPreferences.CreateCategory("NearClipAdj", "NearClipPlane Adjuster");
            changeClipOnLoad = MelonPreferences.CreateEntry <bool>("NearClipAdj", "changeClipOnLoad", true, "Change NearClip on world load");
            UIX_butts_QM     = MelonPreferences.CreateEntry("NearClipAdj", "UIX_butts_QM", true, "Place buttons in Settings QM instead of Settings Big Menu");
            keybindsEnabled  = MelonPreferences.CreateEntry <bool>("NearClipAdj", "Keyboard", true, "Keyboard Shortcuts: '[' - 0.0001, ']' - 0.05");

            changeUIcam    = MelonPreferences.CreateEntry <bool>("NearClipAdj", "changeUIcam", true, "Change UI Camera Nearclip");
            smallerDefault = MelonPreferences.CreateEntry <bool>("NearClipAdj", "SmallerDefault", false, "Smaller Default Nearclip on World Change - 0.001 vs 0.01");
            raiseNearClip  = MelonPreferences.CreateEntry <bool>("NearClipAdj", "RaiseOnQuickMenu", false, "If using smaller Default Nearclip (0.001) raise to 0.01 when Quick Menu opens.");

            AMAPI_en               = MelonPreferences.CreateEntry <bool>("NearClipAdj", "AMAPI_en", true, "Action Menu API Support (Requires Restart)");
            amapi_ModsFolder       = MelonPreferences.CreateEntry("NearClipAdj", "amapi_ModsFolder", false, "Place Action Menu in 'Mods' Sub Menu instead of 'Config' menu (Restert Required)");
            defaultChangeBlackList = MelonPreferences.CreateEntry("NearClipAdj", "defaultChangeBlackList", true, "Check a blacklist for worlds to not auto change the NearClip on (Restart Required to Enable)");

            ExpansionKitApi.GetExpandedMenu(ExpandedMenu.SettingsMenu).AddSimpleButton("Nearplane-0.05", (() => ChangeNearClipPlane(.05f, true)), (butt) => { n05 = butt; butt.SetActive(!UIX_butts_QM.Value); });
            ExpansionKitApi.GetExpandedMenu(ExpandedMenu.SettingsMenu).AddSimpleButton("Nearplane-0.01", (() => ChangeNearClipPlane(.01f, true)), (butt) => { n01 = butt; butt.SetActive(!UIX_butts_QM.Value); });
            ExpansionKitApi.GetExpandedMenu(ExpandedMenu.SettingsMenu).AddSimpleButton("Nearplane-0.001", (() => ChangeNearClipPlane(.001f, true)), (butt) => { n001 = butt; butt.SetActive(!UIX_butts_QM.Value); });
            ExpansionKitApi.GetExpandedMenu(ExpandedMenu.SettingsMenu).AddSimpleButton("Nearplane-0.0001", (() => ChangeNearClipPlane(.0001f, true)), (butt) => { n0001 = butt; butt.SetActive(!UIX_butts_QM.Value); });

            var clips = new float[] {
                .05f,
                .01f,
                .001f,
                .0001f,
            };

            var Menu = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescriptionCustom.QuickMenu1Column6Row);

            ExpansionKitApi.GetExpandedMenu(ExpandedMenu.UiElementsQuickMenu).AddSimpleButton("Near Clipping Plane Distance", () => Menu.Show(), (butt) => { QMbutt = butt; butt.SetActive(UIX_butts_QM.Value); });
            Menu.AddLabel("Near Clipping Plane Distance");
            foreach (var clip in clips)
            {
                Menu.AddSimpleButton($"Nearplane-{clip}", (() => ChangeNearClipPlane(clip, true)));
            }
            Menu.AddSimpleButton("Close", () => Menu.Hide());

            Logger.Msg("Registering components...");
            ClassInjector.RegisterTypeInIl2Cpp <EnableDisableListener>();
            MelonCoroutines.Start(OnLoad());

            if (MelonHandler.Mods.Any(m => m.Info.Name == "ActionMenuApi") && AMAPI_en.Value)
            {
                CustomActionMenu.InitUi();
            }
            else
            {
                Logger.Msg("ActionMenuApi is missing, or setting is toggled off in Mod Settings - Not adding controls to ActionMenu");
            }

            if (defaultChangeBlackList.Value)
            {
                GetBlackList();
            }
        }
Ejemplo n.º 12
0
        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();
        }
Ejemplo n.º 13
0
 private void loadCamMenu()
 {
     if (settings.Resolutions.Count <= 6)
     {
         camMenu = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescription.QuickMenu3Columns);
     }
     else
     {
         camMenu = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescription.QuickMenu4Columns);
     }
     addResButtons();
     addSettingsBackButtons();
 }
Ejemplo n.º 14
0
        private static void LightTypeMenu()
        {
            var menu = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescriptionCustom.QuickMenu1ColumnWideSlim);

            menu.AddLabel($"Local Light Menu");
            menu.AddSimpleButton($"Light Config", () =>
            {
                LightDetailsMenu();
            });
            menu.AddSimpleButton($"Create", () =>
            {
                Main.CreateLight();
            });
            menu.AddSimpleButton($"Update Active Light", () =>
            {
                Main.UpdateLight(Main.activeLight);
            });
            menu.AddSimpleButton($"Update Specific Light", () =>
            {
                SelectSpecific();
            });
            menu.AddSimpleButton($"Delete All Lights", () =>
            {
                var menu2 = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescriptionCustom.QuickMenu1ColumnWideSlim);
                menu2.AddLabel("-Confirm-\nDelete All Lights");
                menu2.AddSimpleButton($"Yes", () =>
                {
                    Main.CleanupVisObjects();
                    LightTypeMenu();
                });
                menu2.AddSimpleButton($"No", () =>
                {
                    LightTypeMenu();
                });
                menu2.Show();
            });
            menu.AddSimpleButton($"Save/Load Light Options", () =>
            {
                SavedPrefSlots();
            });

            menu.AddSimpleButton($"Close", () =>
            {
                menu.Hide();
            });

            menu.Show();
        }
Ejemplo n.º 15
0
        public override void OnApplicationStart()
        {
            var customMenu = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescription.QuickMenu3Columns);

            ExpansionKitApi.GetExpandedMenu(ExpandedMenu.CameraQuickMenu).AddSimpleButton("CameraMinus", () => customMenu.Show());

            customMenu.AddToggleButton("Camera lens visible", ToggleLens, GetLensState);
            customMenu.AddSimpleButton("Enlarge camera", Enlarge);
            customMenu.AddSimpleButton("Shrink camera", Shrink);

            customMenu.AddSimpleButton("Reset zoom", ZoomReset);
            customMenu.AddSimpleButton("Zoom in", ZoomIn);
            customMenu.AddSimpleButton("Zoom out", ZoomOut);

            customMenu.AddSpacer();
            customMenu.AddSpacer();
            customMenu.AddSimpleButton("Back", () => customMenu.Hide());
        }
Ejemplo n.º 16
0
        private static void SelectSpecific()
        {
            var menu = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescriptionCustom.QuickMenu5ColumnWide);

            float i = 0;

            foreach (var obj in Main.lightList)
            {
                if (!obj?.Equals(null) ?? false)
                {
                    i++;
                    menu.AddSimpleButton("-Set as Active-\n" + Main.LightDetailsString(obj), () => Main.activeLight = obj);//$"{obj.name}");
                    menu.AddSimpleButton($"Update with Current Settings", () =>
                    {
                        Main.UpdateLight(obj);
                        SelectSpecific();//LAZY
                    });
                    menu.AddSimpleButton($"Load Light's Settings", () =>
                    {
                        Main.LoadLightSettings(obj);
                        SelectSpecific();
                    });
                    menu.AddToggleButton("Pickupable", (action) =>
                    {
                        obj.GetOrAddComponent <VRC_Pickup>().pickupable = !obj.GetOrAddComponent <VRC_Pickup>().pickupable;
                    }, () => obj.GetOrAddComponent <VRC_Pickup>().pickupable);
                    menu.AddSimpleButton($"Delete", () =>
                    {
                        Main.CleanupOneObject(obj);
                        SelectSpecific();
                    });
                }
            }
            menu.AddSimpleButton("<-Back", (() =>
            {
                LightTypeMenu();
            }));
            menu.AddLabel(CurrentConfig());

            menu.Show();
        }
Ejemplo n.º 17
0
        private static void CamSettingsMenu()
        {
            var menu = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescription.QuickMenu3Columns);

            menu.AddToggleButton("Hide Camera Indicators", (action) => hideCams.Value     = !hideCams.Value, () => hideCams.Value);
            menu.AddToggleButton("Hide Camera Nameplate", (action) => hideNameplate.Value = !hideNameplate.Value, () => hideNameplate.Value);
            menu.AddToggleButton("Shrink Indicators, do not hide entirely", (action) => shrinkCams.Value = !shrinkCams.Value, () => shrinkCams.Value);

            menu.AddToggleButton("Hide Camera Texture", (action) => hideCamTex.Value     = !hideCamTex.Value, () => hideCamTex.Value);
            menu.AddToggleButton("Less glossiness on Cameras", (action) => noGloss.Value = !noGloss.Value, () => noGloss.Value);
            menu.AddToggleButton("Recolor Cameras", (action) => recolorCams.Value        = !recolorCams.Value, () => recolorCams.Value);

            menu.AddSimpleButton($"Close", () =>
            {
                menu.Hide();
            });
            menu.AddSpacer();
            menu.AddSimpleButton($"Color (R,G,B):\n{camColor.Value.r * 100}, {camColor.Value.g * 100}, {camColor.Value.b * 100}", () => ColorMenuAdj());

            menu.Show();
        }
Ejemplo n.º 18
0
        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();
        }
Ejemplo n.º 19
0
        // 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();
        }
Ejemplo n.º 20
0
        private static void QuickMenuOptions3()
        {
            var mirrorMenu = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescriptionCustom.QuickMenu3Column_Longer);

            mirrorMenu.AddToggleButton("Cal Mirror", (action) =>
            {
                if (Utils.GetVRCPlayer() != null)
                {
                    if (Main._mirrorCal != null)
                    {
                        Main.ToggleMirrorCal(false);
                    }
                    else
                    {
                        Main.waitForMeasureRoutine = MelonCoroutines.Start(Main.WaitForMeasure());
                    }
                }
                //Main.ToggleMirrorCal(true);
            }, () => Main._mirrorCal != null);
            mirrorMenu.AddSimpleButton(StateText(Main._cal_MirrorState.Value), () =>
            {
                ToggleMirrorState(ref Main._cal_MirrorState);
                Main main = new Main(); main.OnPreferencesSaved();
                mirrorMenu.Hide(); QuickMenuOptions3();
            });
            mirrorMenu.AddLabel("Updates to mirror aren't live - Must toggle");
            //
            mirrorMenu.AddLabel($"Distance scale: {Main._cal_MirrorDistanceScale.Value}");
            mirrorMenu.AddSimpleButton("+", () =>
            {
                Main._cal_MirrorDistanceScale.Value = Main._cal_MirrorDistanceScale.Value + Main._mirrorDistAdj;
                Main main = new Main(); main.OnPreferencesSaved();
                mirrorMenu.Hide(); QuickMenuOptions3();
            });
            mirrorMenu.AddSimpleButton("-", () =>
            {
                Main._cal_MirrorDistanceScale.Value = Main._cal_MirrorDistanceScale.Value - Main._mirrorDistAdj;
                Main main = new Main(); main.OnPreferencesSaved();
                mirrorMenu.Hide(); QuickMenuOptions3();
            });
            //
            mirrorMenu.AddLabel($"Size scale: {Main._cal_MirrorScale.Value}");
            mirrorMenu.AddSimpleButton("Larger", () =>
            {
                Main._cal_MirrorScale.Value += .25f;
                Main main = new Main(); main.OnPreferencesSaved();
                mirrorMenu.Hide(); QuickMenuOptions3();
            });
            mirrorMenu.AddSimpleButton("Smaller", () =>
            {
                if (Main._cal_MirrorScale.Value > .25)
                {
                    Main._cal_MirrorScale.Value -= .25f;
                    Main main = new Main(); main.OnPreferencesSaved();
                    mirrorMenu.Hide(); QuickMenuOptions3();
                }
            });
            //

            mirrorMenu.AddToggleButton($"Enable Mirror when Calibrating", (action) =>
            {
                Main._cal_enable.Value = !Main._cal_enable.Value;
                Main main = new Main(); main.OnPreferencesSaved();
                mirrorMenu.Hide(); QuickMenuOptions3();
            }, () => Main._cal_enable.Value);

            mirrorMenu.AddToggleButton($"Always in front", (action) =>
            {
                Main._cal_AlwaysInFront.Value = !Main._cal_AlwaysInFront.Value;
                Main main = new Main(); main.OnPreferencesSaved();
                mirrorMenu.Hide(); QuickMenuOptions3();
            }, () => Main._cal_AlwaysInFront.Value);
            mirrorMenu.AddSpacer();

            mirrorMenu.AddToggleButton($"Delay mirror by {Main._cal_DelayMirrorTime.Value} seconds", (action) =>
            {
                Main._cal_DelayMirror.Value = !Main._cal_DelayMirror.Value;
                Main main = new Main(); main.OnPreferencesSaved();
                mirrorMenu.Hide(); QuickMenuOptions3();
            }, () => Main._cal_DelayMirror.Value);
            mirrorMenu.AddSimpleButton("+", () =>
            {
                Main._cal_DelayMirrorTime.Value = Main._cal_DelayMirrorTime.Value + .2f;
                Main main = new Main(); main.OnPreferencesSaved();
                mirrorMenu.Hide(); QuickMenuOptions3();
            });
            mirrorMenu.AddSimpleButton("-", () =>
            {
                Main._cal_DelayMirrorTime.Value = Main._cal_DelayMirrorTime.Value - .2f;
                Main main = new Main(); main.OnPreferencesSaved();
                mirrorMenu.Hide(); QuickMenuOptions3();
            });

            //mirrorMenu.AddSpacer();



            mirrorMenu.AddSimpleButton($"Close", () =>
            {
                mirrorMenu.Hide();
            });
            mirrorMenu.AddSimpleButton($"Page 1", () =>
            {
                mirrorMenu.Hide();
                QuickMenuOptions();
            });
            mirrorMenu.AddSpacer();
            mirrorMenu.Show();
        }
Ejemplo n.º 21
0
        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();
        }
Ejemplo n.º 22
0
        private static void LightDetailsMenu()
        {
            var menu = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescriptionCustom.QuickMenu2ColumnWide);

            menu.AddSimpleButton($"LightType:\n{Main.lightType.Value}", () =>
            {
                var menu2 = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescriptionCustom.QuickMenu1ColumnWideSlim);
                menu2.AddLabel($"LightType: {Main.lightType.Value}");
                menu2.AddSimpleButton($"Spot", () =>
                {
                    Main.lightType.Value = LightType.Spot;
                    Main.UpdateLight();
                    LightDetailsMenu();
                });
                menu2.AddSimpleButton($"Point", () =>
                {
                    Main.lightType.Value = LightType.Point;
                    Main.UpdateLight();
                    LightDetailsMenu();
                });
                menu2.AddSimpleButton($"Directional", () =>
                {
                    Main.lightType.Value = LightType.Directional;
                    Main.UpdateLight();
                    LightDetailsMenu();
                });
                menu2.AddSimpleButton($"<-Back", () =>
                {
                    LightDetailsMenu();
                });
                menu2.Show();
            });

            menu.AddSimpleButton($"Range(Spot|Point):\n{Main.lightRange.Value}", () =>
            {
                var menu2 = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescriptionCustom.QuickMenu1ColumnWideSlim);
                menu2.AddLabel($"Range(Spot|Point): {Utils.NumFormat(Main.lightRange.Value)}", (button) => butt = button.transform);
                menu2.AddSimpleButton($"++", () =>
                {
                    Main.lightRange.Value += 2f;
                    butt.GetComponentInChildren <Text>().text = $"Range(Spot|Point): {Utils.NumFormat(Main.lightRange.Value)}";
                    Main.UpdateLight();
                });
                menu2.AddSimpleButton($"+", () =>
                {
                    Main.lightRange.Value += .5f;
                    butt.GetComponentInChildren <Text>().text = $"Range(Spot|Point): {Utils.NumFormat(Main.lightRange.Value)}";
                    Main.UpdateLight();
                });
                menu2.AddSimpleButton($"20", () =>
                {
                    Main.lightRange.Value = 20f;
                    butt.GetComponentInChildren <Text>().text = $"Range(Spot|Point): {Utils.NumFormat(Main.lightRange.Value)}";
                    Main.UpdateLight();
                });
                menu2.AddSimpleButton($"-", () =>
                {
                    Main.lightRange.Value -= .5f;
                    butt.GetComponentInChildren <Text>().text = $"Range(Spot|Point): {Utils.NumFormat(Main.lightRange.Value)}";
                    Main.UpdateLight();
                });
                menu2.AddSimpleButton($"--", () =>
                {
                    Main.lightRange.Value -= 2f;
                    butt.GetComponentInChildren <Text>().text = $"Range(Spot|Point): {Utils.NumFormat(Main.lightRange.Value)}";
                    Main.UpdateLight();
                });
                menu2.AddSimpleButton($"<-Back", () =>
                {
                    LightDetailsMenu();
                });
                menu2.Show();
            });

            menu.AddSimpleButton($"Spot Angle: \n{Utils.NumFormat(Main.lightSpotAngle.Value)}", () =>
            {
                var menu2 = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescriptionCustom.QuickMenu1ColumnWideSlim);
                menu2.AddLabel($"Spot Angle: {Utils.NumFormat(Main.lightSpotAngle.Value)}", (button) => butt = button.transform);
                menu2.AddSimpleButton($"++", () =>
                {
                    Main.lightSpotAngle.Value += 5f;
                    butt.GetComponentInChildren <Text>().text = $"Spot Angle: {Utils.NumFormat(Main.lightSpotAngle.Value)}";
                    Main.UpdateLight();
                });
                menu2.AddSimpleButton($"+", () =>
                {
                    Main.lightSpotAngle.Value += 2f;
                    butt.GetComponentInChildren <Text>().text = $"Spot Angle: {Utils.NumFormat(Main.lightSpotAngle.Value)}";
                    Main.UpdateLight();
                });
                menu2.AddSimpleButton($"120", () =>
                {
                    Main.lightSpotAngle.Value = 120f;
                    butt.GetComponentInChildren <Text>().text = $"Spot Angle: {Utils.NumFormat(Main.lightSpotAngle.Value)}";
                    Main.UpdateLight();
                });
                menu2.AddSimpleButton($"-", () =>
                {
                    Main.lightSpotAngle.Value -= 2f;
                    butt.GetComponentInChildren <Text>().text = $"Spot Angle: {Utils.NumFormat(Main.lightSpotAngle.Value)}";
                    Main.UpdateLight();
                });
                menu2.AddSimpleButton($"--", () =>
                {
                    Main.lightSpotAngle.Value -= 5f;
                    butt.GetComponentInChildren <Text>().text = $"Spot Angle: {Utils.NumFormat(Main.lightSpotAngle.Value)}";
                    Main.UpdateLight();
                });
                menu2.AddSimpleButton($"<-Back", () =>
                {
                    LightDetailsMenu();
                });
                menu2.Show();
            });

            //Color
            menu.AddSimpleButton($"Color (R,G,B):\n{Main.lightColor.Value.r}, {Main.lightColor.Value.g}, {Main.lightColor.Value.b}", () =>
            {
                ColorMenuAdj();
            });

            menu.AddSimpleButton($"Light Intensity:\n{Utils.NumFormat(Main.lightIntensity.Value)}", () =>
            {
                var menu2 = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescriptionCustom.QuickMenu1ColumnWideSlim);
                menu2.AddLabel($"Light Intensity: {Utils.NumFormat(Main.lightIntensity.Value)}", (button) => butt = button.transform);
                menu2.AddSimpleButton($"++", () =>
                {
                    Main.lightIntensity.Value += .25f;
                    butt.GetComponentInChildren <Text>().text = $"Light Intensity: {Utils.NumFormat(Main.lightIntensity.Value)}";
                    Main.UpdateLight();
                });
                menu2.AddSimpleButton($"+", () =>
                {
                    Main.lightIntensity.Value += .1f;
                    butt.GetComponentInChildren <Text>().text = $"Light Intensity: {Utils.NumFormat(Main.lightIntensity.Value)}";
                    Main.UpdateLight();
                });
                menu2.AddSimpleButton($"1", () =>
                {
                    Main.lightIntensity.Value = 1f;
                    butt.GetComponentInChildren <Text>().text = $"Light Intensity: {Utils.NumFormat(Main.lightIntensity.Value)}";
                    Main.UpdateLight();
                });
                menu2.AddSimpleButton($"-", () =>
                {
                    Main.lightIntensity.Value -= .1f;
                    butt.GetComponentInChildren <Text>().text = $"Light Intensity: {Utils.NumFormat(Main.lightIntensity.Value)}";
                    Main.UpdateLight();
                });
                menu2.AddSimpleButton($"--", () =>
                {
                    Main.lightIntensity.Value -= .25f;
                    butt.GetComponentInChildren <Text>().text = $"Light Intensity: {Utils.NumFormat(Main.lightIntensity.Value)}";
                    Main.UpdateLight();
                });
                menu2.AddSimpleButton($"<-Back", () =>
                {
                    LightDetailsMenu();
                });
                menu2.Show();
            });

            menu.AddToggleButton("Enabled", (action) =>
            {
                Main.ToggleLight();
            }, () => (!Main.flash?.Equals(null) ?? false));

            menu.AddSimpleButton($"Close", () => menu.Hide());

            menu.AddSimpleButton($"-Reset to-\n-Defaults-", () =>
            {///Update all these
                Main.lightType.Value      = LightType.Spot;
                Main.lightRange.Value     = 20;
                Main.lightSpotAngle.Value = 120;
                Main.lightColor.Value     = Color.white;
                Main.lightIntensity.Value = 1;
                LightDetailsMenu();
                Main.UpdateLight();
            });
            menu.Show();
        }
Ejemplo n.º 23
0
        private static void LightDetailsMenu()
        {
            var menu = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescriptionCustom.QuickMenu2ColumnWideSlim);

            menu.AddToggleButton("Pickup Snaps to Hand", (action) =>
            {
                Main.Config.pickupOrient = !Main.Config.pickupOrient;
            }, () => Main.Config.pickupOrient);

            menu.AddToggleButton("Pickupable", (action) =>
            {
                Main.Config.pickupable = !Main.Config.pickupable;
            }, () => Main.Config.pickupable);

            menu.AddSimpleButton($"LightType:\n{Main.Config.lightType}", () =>
            {
                var menu2 = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescriptionCustom.QuickMenu1ColumnWideSlim);
                menu2.AddLabel($"LightType: {Main.Config.lightType}");
                menu2.AddSimpleButton($"Directional", () =>
                {
                    Main.Config.lightType = LightType.Directional;
                    LightDetailsMenu();
                });
                menu2.AddSimpleButton($"Spot", () =>
                {
                    Main.Config.lightType = LightType.Spot;
                    LightDetailsMenu();
                });
                menu2.AddSimpleButton($"Point", () =>
                {
                    Main.Config.lightType = LightType.Point;
                    LightDetailsMenu();
                });
                menu2.AddSimpleButton($"<-Back", () =>
                {
                    LightDetailsMenu();
                });
                menu2.Show();
            });

            menu.AddSimpleButton($"Range(Spot|Point):\n{Main.Config.lightRange}", () =>
            {
                var menu2 = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescriptionCustom.QuickMenu1ColumnWideSlim);
                menu2.AddLabel($"Range(Spot|Point): {Utils.NumFormat(Main.Config.lightRange)}", (button) => butt = button.transform);
                menu2.AddSimpleButton($"++", () =>
                {
                    Main.Config.lightRange += 2f;
                    butt.GetComponentInChildren <Text>().text = $"Range(Spot|Point): {Utils.NumFormat(Main.Config.lightRange)}";
                });
                menu2.AddSimpleButton($"+", () =>
                {
                    Main.Config.lightRange += .5f;
                    butt.GetComponentInChildren <Text>().text = $"Range(Spot|Point): {Utils.NumFormat(Main.Config.lightRange)}";
                });
                menu2.AddSimpleButton($"10", () =>
                {
                    Main.Config.lightRange = 10f;
                    butt.GetComponentInChildren <Text>().text = $"Range(Spot|Point): {Utils.NumFormat(Main.Config.lightRange)}";
                });
                menu2.AddSimpleButton($"-", () =>
                {
                    Main.Config.lightRange -= .5f;
                    butt.GetComponentInChildren <Text>().text = $"Range(Spot|Point): {Utils.NumFormat(Main.Config.lightRange)}";
                });
                menu2.AddSimpleButton($"--", () =>
                {
                    Main.Config.lightRange -= 2f;
                    butt.GetComponentInChildren <Text>().text = $"Range(Spot|Point): {Utils.NumFormat(Main.Config.lightRange)}";
                });
                menu2.AddSimpleButton($"<-Back", () =>
                {
                    LightDetailsMenu();
                });
                menu2.Show();
            });

            menu.AddSimpleButton($"Spot Angle: \n{Utils.NumFormat(Main.Config.lightSpotAngle)}", () =>
            {
                var menu2 = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescriptionCustom.QuickMenu1ColumnWideSlim);
                menu2.AddLabel($"Spot Angle: {Utils.NumFormat(Main.Config.lightSpotAngle)}", (button) => butt = button.transform);
                menu2.AddSimpleButton($"++", () =>
                {
                    Main.Config.lightSpotAngle += 5f;
                    butt.GetComponentInChildren <Text>().text = $"Spot Angle: {Utils.NumFormat(Main.Config.lightSpotAngle)}";
                });
                menu2.AddSimpleButton($"+", () =>
                {
                    Main.Config.lightSpotAngle += 2f;
                    butt.GetComponentInChildren <Text>().text = $"Spot Angle: {Utils.NumFormat(Main.Config.lightSpotAngle)}";
                });
                menu2.AddSimpleButton($"30", () =>
                {
                    Main.Config.lightSpotAngle = 30f;
                    butt.GetComponentInChildren <Text>().text = $"Spot Angle: {Utils.NumFormat(Main.Config.lightSpotAngle)}";
                });
                menu2.AddSimpleButton($"-", () =>
                {
                    Main.Config.lightSpotAngle -= 2f;
                    butt.GetComponentInChildren <Text>().text = $"Spot Angle: {Utils.NumFormat(Main.Config.lightSpotAngle)}";
                });
                menu2.AddSimpleButton($"--", () =>
                {
                    Main.Config.lightSpotAngle -= 5f;
                    butt.GetComponentInChildren <Text>().text = $"Spot Angle: {Utils.NumFormat(Main.Config.lightSpotAngle)}";
                });
                menu2.AddSimpleButton($"<-Back", () =>
                {
                    LightDetailsMenu();
                });
                menu2.Show();
            });

            //Color
            menu.AddSimpleButton($"Color (R,G,B):\n{Main.Config.lightColor.r}, {Main.Config.lightColor.g}, {Main.Config.lightColor.b}", () =>
            {
                ColorMenuAdj();
            });

            menu.AddSimpleButton($"Light Intensity:\n{Utils.NumFormat(Main.Config.lightIntensity)}", () =>
            {
                var menu2 = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescriptionCustom.QuickMenu1ColumnWideSlim);
                menu2.AddLabel($"Light Intensity: {Utils.NumFormat(Main.Config.lightIntensity)}", (button) => butt = button.transform);
                menu2.AddSimpleButton($"++", () =>
                {
                    Main.Config.lightIntensity += .25f;
                    butt.GetComponentInChildren <Text>().text = $"Light Intensity: {Utils.NumFormat(Main.Config.lightIntensity)}";
                });
                menu2.AddSimpleButton($"+", () =>
                {
                    Main.Config.lightIntensity += .1f;
                    butt.GetComponentInChildren <Text>().text = $"Light Intensity: {Utils.NumFormat(Main.Config.lightIntensity)}";
                });
                menu2.AddSimpleButton($"1", () =>
                {
                    Main.Config.lightIntensity = 1f;
                    butt.GetComponentInChildren <Text>().text = $"Light Intensity: {Utils.NumFormat(Main.Config.lightIntensity)}";
                });
                menu2.AddSimpleButton($"-", () =>
                {
                    Main.Config.lightIntensity -= .1f;
                    butt.GetComponentInChildren <Text>().text = $"Light Intensity: {Utils.NumFormat(Main.Config.lightIntensity)}";
                });
                menu2.AddSimpleButton($"--", () =>
                {
                    Main.Config.lightIntensity -= .25f;
                    butt.GetComponentInChildren <Text>().text = $"Light Intensity: {Utils.NumFormat(Main.Config.lightIntensity)}";
                });
                menu2.AddSimpleButton($"<-Back", () =>
                {
                    LightDetailsMenu();
                });
                menu2.Show();
            });

            //shadows
            menu.AddSimpleButton($"Shadows:\n{Main.Config.lightShadows}", () =>
            {
                var menu2 = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescriptionCustom.QuickMenu1ColumnWideSlim);
                menu2.AddLabel($"Shadows: {Main.Config.lightShadows}");
                menu2.AddSimpleButton($"Hard", () =>
                {
                    Main.Config.lightShadows = LightShadows.Hard;
                    LightDetailsMenu();
                });
                menu2.AddSimpleButton($"Soft", () =>
                {
                    Main.Config.lightShadows = LightShadows.Soft;
                    LightDetailsMenu();
                });
                menu2.AddSimpleButton($"None", () =>
                {
                    Main.Config.lightShadows = LightShadows.None;
                    LightDetailsMenu();
                });
                menu2.AddSimpleButton($"<-Back", () =>
                {
                    LightDetailsMenu();
                });
                menu2.Show();
            });

            menu.AddSimpleButton($"Shadow Cust Res:\n{Main.Config.lightShadowCustRes}", () =>
            {
                var menu2 = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescriptionCustom.QuickMenu1ColumnWideSlim);
                menu2.AddLabel($"Shadow Cust Res: {Main.Config.lightShadowCustRes}", (button) => butt = button.transform);
                menu2.AddSimpleButton($"+", () =>
                {
                    Main.Config.lightShadowCustRes            = Main.Config.lightShadowCustRes < 8192 ? Main.Config.lightShadowCustRes * 2 : Main.Config.lightShadowCustRes;
                    butt.GetComponentInChildren <Text>().text = $"Shadow Cust Res: {Main.Config.lightShadowCustRes}";
                });
                menu2.AddSimpleButton($"2048", () =>
                {
                    Main.Config.lightShadowCustRes            = 2048;
                    butt.GetComponentInChildren <Text>().text = $"Shadow Cust Res: {Main.Config.lightShadowCustRes}";
                });
                menu2.AddSimpleButton($"-", () =>
                {
                    Main.Config.lightShadowCustRes            = Main.Config.lightShadowCustRes > 2 ? Main.Config.lightShadowCustRes / 2 : Main.Config.lightShadowCustRes;
                    butt.GetComponentInChildren <Text>().text = $"Shadow Cust Res: {Main.Config.lightShadowCustRes}";
                });
                menu2.AddSimpleButton($"<-Back", () =>
                {
                    LightDetailsMenu();
                });
                menu2.Show();
            });

            menu.AddSimpleButton($"Shadow Str:\n{Utils.NumFormat(Main.Config.lightShadowStr)}", () =>
            {
                var menu2 = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescriptionCustom.QuickMenu1ColumnWideSlim);
                menu2.AddLabel($"Shadow Str: {Utils.NumFormat(Main.Config.lightShadowStr)}", (button) => butt = button.transform);
                menu2.AddSimpleButton($"++", () =>
                {
                    Main.Config.lightShadowStr += .2f;
                    butt.GetComponentInChildren <Text>().text = $"Shadow Str: {Utils.NumFormat(Main.Config.lightShadowStr)}";
                });
                menu2.AddSimpleButton($"+", () =>
                {
                    Main.Config.lightShadowStr += .1f;
                    butt.GetComponentInChildren <Text>().text = $"Shadow Str: {Utils.NumFormat(Main.Config.lightShadowStr)}";
                });
                menu2.AddSimpleButton($"1", () =>
                {
                    Main.Config.lightShadowStr = 1f;
                    butt.GetComponentInChildren <Text>().text = $"Shadow Str: {Utils.NumFormat(Main.Config.lightShadowStr)}";
                });
                menu2.AddSimpleButton($"-", () =>
                {
                    Main.Config.lightShadowStr -= .1f;
                    butt.GetComponentInChildren <Text>().text = $"Shadow Str: {Utils.NumFormat(Main.Config.lightShadowStr)}";
                });
                menu2.AddSimpleButton($"--", () =>
                {
                    Main.Config.lightShadowStr -= .2f;
                    butt.GetComponentInChildren <Text>().text = $"Shadow Str: {Utils.NumFormat(Main.Config.lightShadowStr)}";
                });
                menu2.AddSimpleButton($"<-Back", () =>
                {
                    LightDetailsMenu();
                });
                menu2.Show();
            });

            menu.AddSimpleButton($"Name:\n{Main.Config.name}", () =>
            {
                SetName(true);
            });
            menu.AddToggleButton("Hide Mesh", (action) =>
            {
                Main.Config.hideMeshRender = !Main.Config.hideMeshRender;
            }, () => Main.Config.hideMeshRender);

            //create
            menu.AddSimpleButton($"-Create-", () =>
            {
                Main.CreateLight();
            });
            menu.AddSimpleButton($"-Update Active Light-", () =>
            {
                Main.UpdateLight(Main.activeLight);
            });
            menu.AddSimpleButton($"<-Back", () =>
            {
                LightTypeMenu();
            });
            menu.AddSimpleButton($"-Reset to-\n-Defaults-", () =>
            {
                Main.Config.name                 = "DefaultName";
                Main.Config.pickupOrient         = false;
                Main.Config.pickupable           = true;
                Main.Config.lightType            = LightType.Point;
                Main.Config.lightRange           = 10;
                Main.Config.lightSpotAngle       = 30;
                Main.Config.lightColor           = Color.white;
                Main.Config.lightIntensity       = 1;
                Main.Config.lightBounceIntensity = 1;
                Main.Config.lightShadows         = LightShadows.None;
                Main.Config.lightShadowStr       = 1;
                Main.Config.lightShadowCustRes   = 2048;
                LightDetailsMenu();
            });
            menu.Show();
        }
Ejemplo n.º 24
0
        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();
        }
Ejemplo n.º 25
0
        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();
        }
Ejemplo n.º 26
0
        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();
        }
Ejemplo n.º 27
0
        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();
        }
Ejemplo n.º 28
0
        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();
        }
Ejemplo n.º 29
0
        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();
        }
Ejemplo n.º 30
0
        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();
        }