Example #1
0
        public void MakeDebugWorldMenu()
        {
            GuiRoot.RootItem.Clear();

            var frame = MakeMenuFrame("DEBUG WORLDS");

            MakeMenuItem(frame, "Hills", "Create a hilly world.", (sender, args) =>
            {
                Overworld.CreateHillsLand(Game.GraphicsDevice);
                StateManager.ClearState();
                WorldGenerationSettings settings = new WorldGenerationSettings()
                {
                    ExistingFile = null,
                    ColonySize   = new Point3(8, 1, 8),
                    WorldScale   = 2.0f,
                    WorldOrigin  = new Vector2(Overworld.Map.GetLength(0) / 2.0f,
                                               Overworld.Map.GetLength(1) / 2.0f) * 0.5f
                };
                StateManager.PushState(new LoadState(Game, StateManager, settings));
            });

            MakeMenuItem(frame, "Cliffs", "Create a cliff-y world.", (sender, args) =>
            {
                Overworld.CreateCliffsLand(Game.GraphicsDevice);
                StateManager.ClearState();
                WorldGenerationSettings settings = new WorldGenerationSettings()
                {
                    ExistingFile = null,
                    ColonySize   = new Point3(8, 1, 8),
                    WorldScale   = 2.0f,
                    WorldOrigin  = new Vector2(Overworld.Map.GetLength(0) / 2.0f,
                                               Overworld.Map.GetLength(1) / 2.0f) * 0.5f
                };
                StateManager.PushState(new LoadState(Game, StateManager, settings));
            });

            MakeMenuItem(frame, "Flat", "Create a flat world.", (sender, args) =>
            {
                Overworld.CreateUniformLand(Game.GraphicsDevice);
                StateManager.ClearState();
                WorldGenerationSettings settings = new WorldGenerationSettings()
                {
                    ExistingFile = null,
                    ColonySize   = new Point3(8, 1, 8),
                    WorldScale   = 2.0f,
                    WorldOrigin  = new Vector2(Overworld.Map.GetLength(0) / 2.0f,
                                               Overworld.Map.GetLength(1) / 2.0f) * 0.5f
                };
                StateManager.PushState(new LoadState(Game, StateManager, settings));
            });

            MakeMenuItem(frame, "Ocean", "Create an ocean world", (sender, args) =>
            {
                Overworld.CreateOceanLand(Game.GraphicsDevice, 0.17f);
                StateManager.ClearState();
                WorldGenerationSettings settings = new WorldGenerationSettings()
                {
                    ExistingFile = null,
                    ColonySize   = new Point3(8, 1, 8),
                    WorldScale   = 2.0f,
                    WorldOrigin  = new Vector2(Overworld.Map.GetLength(0) / 2.0f,
                                               Overworld.Map.GetLength(1) / 2.0f) * 0.5f
                };
                StateManager.PushState(new LoadState(Game, StateManager, settings));
            });

            MakeMenuItem(frame, "Back", "Go back to the main menu.", (sender, args) => StateManager.PopState());

            GuiRoot.RootItem.Layout();
        }
Example #2
0
        public void OnItemClicked(ListItem item)
        {
            switch (item.Label)
            {
            case "Continue Game":
                StateManager.PopState();
                break;

            case "New Game":
                PlayItems();
                StateManager.PushState("CompanyMakerState");
                MaintainState = true;
                break;

            case "Quit":
                Game.Exit();
                break;

            case "Generate World":
                MaintainState = true;
                StateManager.PushState("WorldSetupState");
                break;

            case "Options":
                MaintainState = true;
                StateManager.PushState("OptionsState");
                break;

            case "Back":
                DefaultItems();
                break;

            case "Debug World":
                DebugWorldItems();
                break;

            case "Flat World":
            {
                MaintainState = false;
                Overworld.CreateUniformLand(Game.GraphicsDevice);
                StateManager.PushState("PlayState");
                PlayState.WorldSize = new Point3(8, 1, 8);
                GUI.MouseMode       = GUISkin.MousePointer.Wait;

                IsGameRunning = true;
            }
            break;

            case "Hills World":
            {
                MaintainState = false;
                Overworld.CreateHillsLand(Game.GraphicsDevice);
                StateManager.PushState("PlayState");
                PlayState.WorldSize = new Point3(8, 1, 8);
                GUI.MouseMode       = GUISkin.MousePointer.Wait;

                IsGameRunning = true;
            }
            break;

            case "Cliffs World":
            {
                MaintainState = false;
                Overworld.CreateCliffsLand(Game.GraphicsDevice);
                StateManager.PushState("PlayState");
                PlayState.WorldSize = new Point3(8, 1, 8);
                GUI.MouseMode       = GUISkin.MousePointer.Wait;

                IsGameRunning = true;
            }
            break;

            case "Ocean World":
            {
                MaintainState = false;
                Overworld.CreateOceanLand(Game.GraphicsDevice);
                StateManager.PushState("PlayState");
                PlayState.WorldSize = new Point3(8, 1, 8);
                GUI.MouseMode       = GUISkin.MousePointer.Wait;

                IsGameRunning = true;
            }
            break;

            case "Load World":
                MaintainState = true;
                StateManager.PushState("WorldLoaderState");
                break;

            case "Load Game":
                MaintainState = true;
                StateManager.PushState("GameLoaderState");
                break;
            }
        }
Example #3
0
        public void MakeDebugWorldMenu()
        {
            GuiRoot.RootItem.Clear();

            var frame = MakeMenuFrame("DEBUG WORLDS");

            MakeMenuItem(frame, "Hills", "Create a hilly world.", (sender, args) =>
            {
                MaintainState = false;
                Overworld.CreateHillsLand(Game.GraphicsDevice);
                StateManager.PushState("PlayState");
                PlayState.WorldSize = new Point3(8, 1, 8);
                //GUI.MouseMode = GUISkin.MousePointer.Wait;

                IsGameRunning = true;
            });

            MakeMenuItem(frame, "Cliffs", "Create a cliff-y world.", (sender, args) =>
            {
                MaintainState = false;
                Overworld.CreateCliffsLand(Game.GraphicsDevice);
                StateManager.PushState("PlayState");
                PlayState.WorldSize = new Point3(8, 1, 8);
                //GUI.MouseMode = GUISkin.MousePointer.Wait;
                PlayState.Natives      = new List <Faction>();
                FactionLibrary library = new FactionLibrary();
                library.Initialize(null, "fake", "fake", null, Color.Blue);
                for (int i = 0; i < 10; i++)
                {
                    PlayState.Natives.Add(library.GenerateFaction(i, 10));
                }

                IsGameRunning = true;
            });

            MakeMenuItem(frame, "Flat", "Create a flat world.", (sender, args) =>
            {
                MaintainState = false;
                Overworld.CreateUniformLand(Game.GraphicsDevice);
                StateManager.PushState("PlayState");
                PlayState.WorldSize = new Point3(8, 1, 8);
                //GUI.MouseMode = GUISkin.MousePointer.Wait;

                IsGameRunning = true;
            });

            MakeMenuItem(frame, "Ocean", "Create an ocean world", (sender, args) =>
            {
                MaintainState = false;
                Overworld.CreateOceanLand(Game.GraphicsDevice);
                StateManager.PushState("PlayState");
                PlayState.WorldSize = new Point3(8, 1, 8);
                //GUI.MouseMode = GUISkin.MousePointer.Wait;

                IsGameRunning = true;
            });

            MakeMenuItem(frame, "Back", "Go back to the main menu.", (sender, args) => MakeDefaultMenu());

            GuiRoot.RootItem.Layout();
        }
Example #4
0
        public void OnItemClicked(ListItem item)
        {
            switch (item.Label)
            {
            case "Continue Game":
                StateManager.PopState();
                break;

            case "New Game":
                PlayItems();
                StateManager.PushState("CompanyMakerState");
                MaintainState = true;
                break;

            case "Quit":
                Game.Exit();
                break;

            case "Generate World":
                MaintainState = true;
                StateManager.PushState("WorldGeneratorState");
                break;

            case "Options":
                MaintainState = true;
                StateManager.PushState("OptionsState");
                break;

            case "Back":
                DefaultItems();
                break;

            case "Debug World":
                DebugWorldItems();
                break;

            case "Flat World":
            {
                MaintainState = false;
                Overworld.CreateUniformLand(Game.GraphicsDevice);
                StateManager.PushState("PlayState");
                PlayState.WorldSize = new Point3(8, 1, 8);
                GUI.MouseMode       = GUISkin.MousePointer.Wait;

                IsGameRunning = true;
            }
            break;

            case "Hills World":
            {
                MaintainState = false;
                Overworld.CreateHillsLand(Game.GraphicsDevice);
                StateManager.PushState("PlayState");
                PlayState.WorldSize = new Point3(8, 1, 8);
                GUI.MouseMode       = GUISkin.MousePointer.Wait;

                IsGameRunning = true;
            }
            break;

            case "Cliffs World":
            {
                MaintainState = false;
                Overworld.CreateCliffsLand(Game.GraphicsDevice);
                StateManager.PushState("PlayState");
                PlayState.WorldSize = new Point3(8, 1, 8);
                GUI.MouseMode       = GUISkin.MousePointer.Wait;
                PlayState.Natives   = new List <Faction>();
                FactionLibrary library = new FactionLibrary();
                library.Initialize(null, "fake", "fake", null, Color.Blue);
                for (int i = 0; i < 10; i++)
                {
                    PlayState.Natives.Add(library.GenerateFaction(i, 10));
                }

                IsGameRunning = true;
            }
            break;

            case "Ocean World":
            {
                MaintainState = false;
                Overworld.CreateOceanLand(Game.GraphicsDevice);
                StateManager.PushState("PlayState");
                PlayState.WorldSize = new Point3(8, 1, 8);
                GUI.MouseMode       = GUISkin.MousePointer.Wait;

                IsGameRunning = true;
            }
            break;

            case "Load World":
                MaintainState = true;
                StateManager.PushState("WorldLoaderState");
                break;

            case "Load Game":
                MaintainState = true;
                StateManager.PushState("GameLoaderState");
                break;
            }
        }