Example #1
0
        private void RestartGeneration()
        {
            if (Generator != null)
            {
                Generator.Abort();
            }

            if (Settings.Natives != null)
            {
                Settings.Natives.Clear();
            }

            Generator = new OverworldGenerator(Settings, true);
            if (Preview != null)
            {
                Preview.SetGenerator(Generator, Settings);
            }

            GuiRoot.RootItem.GetChild(0).Text = Settings.Name;
            GuiRoot.RootItem.GetChild(0).Invalidate();
            GuiRoot.MousePointer      = new MousePointer("mouse", 15.0f, 16, 17, 18, 19, 20, 21, 22, 23);
            Preview.Hidden            = true;
            GenerationProgress.Hidden = false;
            PoliticsToggle.Hidden     = true;

            Generator.Generate();
        }
Example #2
0
        public override void OnEnter()
        {
            TutorialManager          = new Tutorial.TutorialManager();
            IsInitialized            = true;
            DwarfTime.LastTime.Speed = 1.0f;

            IndicatorManager.SetupStandards();

            DwarfGame.GumInputMapper.GetInputQueue();
            GuiRoot = new Gui.Root(DwarfGame.GuiSkin);

            Tip = GuiRoot.RootItem.AddChild(new Gui.Widget
            {
                Font                = "font10",
                TextColor           = new Vector4(1, 1, 1, 1),
                MinimumSize         = new Point(0, 64),
                TextHorizontalAlign = Gui.HorizontalAlign.Center,
                TextVerticalAlign   = Gui.VerticalAlign.Center,
                Text                = "Press any key to jump!",
                AutoLayout          = Gui.AutoLayout.DockBottom,
                Background          = new Gui.TileReference("basic", 0),
                BackgroundColor     = new Vector4(0, 0, 0, 0.5f),
                InteriorMargin      = new Gui.Margin(0, 0, 15, 15)
            });

            LoadTicker = GuiRoot.RootItem.AddChild(new Gui.Widgets.InfoTicker
            {
                Font       = "font8",
                AutoLayout = Gui.AutoLayout.DockFill,
                TextColor  = new Vector4(1, 1, 1, 1)
            }) as Gui.Widgets.InfoTicker;

            GuiRoot.RootItem.Layout();

            if (LoadType == LoadTypes.GenerateOverworld)
            {
                Generator = new OverworldGenerator(Settings, true);
                Generator.Generate();
            }
            else
            {
                CreateWorld();
            }

            base.OnEnter();
        }