Esempio n. 1
0
        public static void Init()
        {
            CurrentMenu.Text  = "Main Menu";
            CurrentMenu.Items = new List <DbgMenuItem>()
            {
                new DbgMenuItem()
                {
                    Text = "[DEBUG MENU MOSTLY SCRAPPED]"
                },
                new DbgMenuItem()
                {
                    Text  = "[Graphics Settings]",
                    Items = new List <DbgMenuItem>
                    {
                        new DbgMenuItemEnum <LODMode>("LOD Mode", v => GFX.LODMode = v, () => GFX.LODMode,
                                                      nameOverrides: new Dictionary <LODMode, string>
                        {
                            { LODMode.ForceFullRes, "Force Full Resolution" },
                            { LODMode.ForceLOD1, "Force LOD Level 1" },
                            { LODMode.ForceLOD2, "Force LOD Level 2" },
                        }),
                        new DbgMenuItemNumber("LOD1 Distance", 0, 10000, 1,
                                              (f) => GFX.LOD1Distance = f, () => GFX.LOD1Distance),
                        new DbgMenuItemNumber("LOD2 Distance", 0, 10000, 1,
                                              (f) => GFX.LOD2Distance = f, () => GFX.LOD2Distance),
                        new DbgMenuItemBool("Show Debug Primitive Nametags", "YES", "NO",
                                            (b) => DBG.ShowPrimitiveNametags = b, () => DBG.ShowPrimitiveNametags),
                        new DbgMenuItemBool("Simple Text Label Size", "YES", "NO",
                                            (b) => DBG.SimpleTextLabelSize = b, () => DBG.SimpleTextLabelSize),
                        new DbgMenuItemNumber("Debug Primitive Nametag Size", 0.01f, 5.0f, 0.01f,
                                              (v) => DBG.PrimitiveNametagSize = v, () => DBG.PrimitiveNametagSize),
                        new DbgMenuItemBool("Show Model Names", "YES", "NO",
                                            (b) => DBG.ShowModelNames = b, () => DBG.ShowModelNames),
                        new DbgMenuItemBool("Show Model Bounding Boxes", "YES", "NO",
                                            (b) => DBG.ShowModelBoundingBoxes = b, () => DBG.ShowModelBoundingBoxes),
                        new DbgMenuItemBool("Show Model Submesh Bounding Boxes", "YES", "NO",
                                            (b) => DBG.ShowModelSubmeshBoundingBoxes = b, () => DBG.ShowModelSubmeshBoundingBoxes),
                        new DbgMenuItemBool("Show Grid", "YES", "NO",
                                            (b) => DBG.ShowGrid = b, () => DBG.ShowGrid),
                        new DbgMenuItemBool("Textures", "ON", "OFF",
                                            (b) => GFX.EnableTextures = b, () => GFX.EnableTextures),
                        //new DbgMenuItemBool("Realtime Lighting", "ON", "OFF",
                        //    (b) => GFX.EnableLighting = b, () => GFX.EnableLighting),
                        //new DbgMenuItemBool("Enable Automatic Light Spin Test", "ON", "OFF",
                        //    (b) => GFX.TestLightSpin = b, () => GFX.TestLightSpin),
                        //new DbgMenuItemBool("Enable Headlight", "ON", "OFF",
                        //    (b) => GFX.EnableHeadlight = b, () => GFX.EnableHeadlight),
                        //new DbgMenuItemBool("Lightmapping", "ON", "OFF",
                        //    (b) => GFX.EnableLightmapping = b, () => GFX.EnableLightmapping),
                        new DbgMenuItemBool("Wireframe Mode", "ON", "OFF",
                                            (b) => GFX.Wireframe = b, () => GFX.Wireframe),
                        //new DbgMenuItemBool("View Frustum Culling (Experimental)", "ON", "OFF",
                        //    (b) => GFX.EnableFrustumCulling = b, () => GFX.EnableFrustumCulling),
                        new DbgMenuItemNumber("Vertical Field of View (Degrees)", 20, 150, 1,
                                              (f) => GFX.World.FieldOfView = f, () => GFX.World.FieldOfView,
                                              (f) => $"{((int)(Math.Round(f)))}"),
                        new DbgMenuItemNumber("Near Clip Distance", 0.0001f, 5, 0.0001f,
                                              (f) => GFX.World.NearClipDistance = f, () => GFX.World.NearClipDistance),
                        new DbgMenuItemNumber("Far Clip Distance", 100, 1000000, 100,
                                              (f) => GFX.World.FarClipDistance = f, () => GFX.World.FarClipDistance),
                        new DbgMenuItem()
                        {
                            Text  = "Reset All To Default",
                            Items = new List <DbgMenuItem>
                            {
                                new DbgMenuItem()
                                {
                                    Text = "Are you sure you want to reset all Graphics settings to default?"
                                },
                                new DbgMenuItem()
                                {
                                    Text        = "No",
                                    ClickAction = (m) => REQUEST_GO_BACK = true
                                },
                                new DbgMenuItem()
                                {
                                    Text        = "Yes",
                                    ClickAction = (m) =>
                                    {
                                        CFG.ResetGraphics();
                                        REQUEST_GO_BACK = true;
                                    }
                                }
                            }
                        },
                    }
                },
                new DbgMenuItem()
                {
                    Text  = "[Display Settings]",
                    Items = new List <DbgMenuItem>
                    {
                        new DbgMenuItemResolutionChange(),
                        new DbgMenuItemBool("Fullscreen", "YES", "NO", v => GFX.Display.Fullscreen = v, () => GFX.Display.Fullscreen),
                        new DbgMenuItemBool("Vsync", "ON", "OFF", v => GFX.Display.Vsync           = v, () => GFX.Display.Vsync),
                        //new DbgMenuItemBool("Simple MSAA", "ON", "OFF", v => GFX.Display.SimpleMSAA = v, () => GFX.Display.SimpleMSAA),
                        new DbgMenuItem()
                        {
                            Text  = "Reset All To Default",
                            Items = new List <DbgMenuItem>
                            {
                                new DbgMenuItem()
                                {
                                    Text = "Are you sure you want to reset all Display settings to default?"
                                },
                                new DbgMenuItem()
                                {
                                    Text        = "No",
                                    ClickAction = (m) => REQUEST_GO_BACK = true
                                },
                                new DbgMenuItem()
                                {
                                    Text        = "Yes",
                                    ClickAction = (m) =>
                                    {
                                        CFG.ResetDisplay();
                                        REQUEST_GO_BACK = true;
                                    }
                                }
                            }
                        },
                        new DbgMenuItem()
                        {
                            Text        = "Apply Changes",
                            ClickAction = (m) => GFX.Display.Apply(),
                        }
                    }
                },
                new DbgMenuItem()
                {
                    Text        = "Return Camera to Origin",
                    ClickAction = m => GFX.World.ResetCameraLocation()
                },
                new DbgMenuItem()
                {
                    Text  = "[Help]",
                    Items = new List <DbgMenuItem>
                    {
                        new DbgMenuItem()
                        {
                            Text  = "[Menu Overlay Controls (Gamepad)]",
                            Items = new List <DbgMenuItem>
                            {
                                new DbgMenuItem()
                                {
                                    Text = "Back: Toggle Menu (Active/Visible/Hidden)"
                                },
                                new DbgMenuItem()
                                {
                                    Text = "D-Pad Up/Down: Move Cursor Up/Down"
                                },
                                new DbgMenuItem()
                                {
                                    Text = "A: Enter/Activate (when applicable)"
                                },
                                new DbgMenuItem()
                                {
                                    Text = "B: Go Back (when applicable)"
                                },
                                new DbgMenuItem()
                                {
                                    Text = "D-Pad Left/Right: Decrease/Increase"
                                },
                                new DbgMenuItem()
                                {
                                    Text = "Start: Reset Value to Default"
                                },
                                new DbgMenuItem()
                                {
                                    Text = "Hold LB: Increase/Decrease 10x Faster"
                                },
                                new DbgMenuItem()
                                {
                                    Text = "Hold X: Increase/Decrease 100x Faster"
                                },
                                new DbgMenuItem()
                                {
                                    Text = "Hold RB + Move LS: Move Menu"
                                },
                                new DbgMenuItem()
                                {
                                    Text = "Hold RB + Move RS: Resize Menu"
                                },
                                new DbgMenuItem()
                                {
                                    Text = "Hold LB + Move or Resize Menu: Move or Resize Menu Faster"
                                },
                                new DbgMenuItem()
                                {
                                    Text = "Click RS: Toggle 3D Render Pause"
                                },
                            }
                        },
                        new DbgMenuItem()
                        {
                            Text  = "[General 3D Controls (Gamepad)]",
                            Items = new List <DbgMenuItem>
                            {
                                new DbgMenuItem()
                                {
                                    Text = "LS: Move Camera Laterally"
                                },
                                new DbgMenuItem()
                                {
                                    Text = "LT: Move Camera Directly Downward"
                                },
                                new DbgMenuItem()
                                {
                                    Text = "RT: Move Camera Directly Upward"
                                },
                                new DbgMenuItem()
                                {
                                    Text = "RS: Turn Camera"
                                },
                                new DbgMenuItem()
                                {
                                    Text = "Hold LB: Move Camera More Slowly"
                                },
                                new DbgMenuItem()
                                {
                                    Text = "Hold RB: Move Camera More Quickly"
                                },
                                new DbgMenuItem()
                                {
                                    Text = "Click LS and Hold: Turn Light With RS Instead of Camera"
                                },
                                new DbgMenuItem()
                                {
                                    Text = "Click RS: Reset Camera To Origin"
                                },
                            }
                        },
                        new DbgMenuItem()
                        {
                            Text  = "[Menu Overlay Controls (Mouse & Keyboard)]",
                            Items = new List <DbgMenuItem>
                            {
                                new DbgMenuItem()
                                {
                                    Text = "Tilde (~): Toggle Menu (Active/Visible/Hidden)"
                                },

                                new DbgMenuItem()
                                {
                                    Text = "Move Mouse Cursor: Move Cursor"
                                },
                                new DbgMenuItem()
                                {
                                    Text = "Hold Spacebar + Scroll Mouse Wheel: Change Values"
                                },
                                new DbgMenuItem()
                                {
                                    Text = "Mouse Wheel: Scroll Menu"
                                },
                                new DbgMenuItem()
                                {
                                    Text = "Enter/Left Click: Enter/Activate (when applicable)"
                                },
                                new DbgMenuItem()
                                {
                                    Text = "Backspace/Right Click: Go Back (when applicable)"
                                },
                                new DbgMenuItem()
                                {
                                    Text = "Up/Down: Move Cursor Up/Down"
                                },
                                new DbgMenuItem()
                                {
                                    Text = "Left/Right: Decrease/Increase"
                                },
                                new DbgMenuItem()
                                {
                                    Text = "Home/Middle Click: Reset Value to Default"
                                },
                                new DbgMenuItem()
                                {
                                    Text = "Hold Shift: Increase/Decrease 10x Faster"
                                },
                                new DbgMenuItem()
                                {
                                    Text = "Hold Ctrl: Increase/Decrease 100x Faster"
                                },
                                new DbgMenuItem()
                                {
                                    Text = "Pause Key: Toggle 3D Render Pause"
                                },
                            }
                        },
                        new DbgMenuItem()
                        {
                            Text  = "[General 3D Controls (Mouse & Keyboard)]",
                            Items = new List <DbgMenuItem>
                            {
                                new DbgMenuItem()
                                {
                                    Text = "WASD: Move Camera Laterally"
                                },
                                new DbgMenuItem()
                                {
                                    Text = "Q: Move Camera Directly Downward"
                                },
                                new DbgMenuItem()
                                {
                                    Text = "E: Move Camera Directly Upward"
                                },
                                new DbgMenuItem()
                                {
                                    Text = "Right Click + Move Mouse: Turn Camera"
                                },
                                new DbgMenuItem()
                                {
                                    Text = "Hold Shift: Move Camera More Slowly"
                                },
                                new DbgMenuItem()
                                {
                                    Text = "Hold Ctrl: Move Camera More Quickly"
                                },
                                new DbgMenuItem()
                                {
                                    Text = "Hold Spacebar: Turn Light With Mouse Instead of Camera"
                                },
                                new DbgMenuItem()
                                {
                                    Text = "R: Reset Camera To Origin"
                                },
                            }
                        },
                    }
                },
                new DbgMenuItem()
                {
                    Text  = "Exit",
                    Items = new List <DbgMenuItem>
                    {
                        new DbgMenuItem()
                        {
                            Text = "Are you sure you want to exit?"
                        },
                        new DbgMenuItem()
                        {
                            Text        = "No",
                            ClickAction = (m) => REQUEST_GO_BACK = true
                        },
                        new DbgMenuItem()
                        {
                            Text        = "Yes",
                            ClickAction = (m) => Main.REQUEST_EXIT = true
                        }
                    }
                },
            };
        }