public void LoadConfigSettings() { if (ControlSettings.Mappings == null) { ControlSettings.Load(); } this["Rotate Camera"] = ControlSettings.Mappings.CameraMode; this["Back"] = ControlSettings.Mappings.Back; this["Forward"] = ControlSettings.Mappings.Forward; this["Left"] = ControlSettings.Mappings.Left; this["Right"] = ControlSettings.Mappings.Right; this["Slice Up"] = ControlSettings.Mappings.SliceUp; this["Slice Down"] = ControlSettings.Mappings.SliceDown; this["Goto Slice"] = ControlSettings.Mappings.SliceSelected; this["Un-Slice"] = ControlSettings.Mappings.Unslice; this["God Mode"] = ControlSettings.Mappings.GodMode; this["Time +"] = ControlSettings.Mappings.TimeForward; this["Time -"] = ControlSettings.Mappings.TimeBackward; this["Toggle GUI"] = ControlSettings.Mappings.ToggleGUI; this["Toggle Map"] = ControlSettings.Mappings.Map; this["Pause"] = ControlSettings.Mappings.Pause; this["Jump"] = ControlSettings.Mappings.Jump; this["Rotate Object Left"] = ControlSettings.Mappings.RotateObjectLeft; this["Rotate Object Right"] = ControlSettings.Mappings.RotateObjectRight; this["Select All Dwarves"] = ControlSettings.Mappings.SelectAllDwarves; this["Fly"] = ControlSettings.Mappings.Fly; this["Xray"] = ControlSettings.Mappings.Xray; }
protected override void LoadContent() { LogSentryBreadcrumb("Loading", "LoadContent was called.", BreadcrumbLevel.Info); AssetManager.Initialize(Content, GraphicsDevice, GameSettings.Current); //DwarfSprites.LayerLibrary.ConvertTestPSD(); // Prepare GemGui if (GumInputMapper == null) { GumInputMapper = new Gui.Input.GumInputMapper(Window.Handle); GumInput = new Gui.Input.Input(GumInputMapper); } GuiSkin = new RenderData(GraphicsDevice, Content); // Create console. ConsoleGui = new Gui.Root(GuiSkin); ConsoleGui.RootItem.AddChild(new Gui.Widgets.AutoGridPanel { Rows = 2, Columns = 4, AutoLayout = AutoLayout.DockFill }); ConsoleGui.RootItem.Layout(); if (_logwriter != null) { _logwriter.SetConsole(GetConsoleTile("LOG")); } Console.Out.WriteLine("Console created."); if (SoundManager.Content == null) { SoundManager.Content = Content; SoundManager.LoadDefaultSounds(); } if (GameStateManager.StateStackIsEmpty) { LogSentryBreadcrumb("GameState", "There was nothing in the state stack. Starting over."); if (GameSettings.Current.DisplayIntro) { GameStateManager.PushState(new IntroState(this)); } else { GameStateManager.PushState(new MainMenuState(this)); } } ControlSettings.Load(); Drawer2D.Initialize(Content, GraphicsDevice); ScreenSaver = new Terrain2D(this); base.LoadContent(); }
protected override void LoadContent() { #if SHARP_RAVEN try { #endif // Prepare GemGui GumInputMapper = new Gui.Input.GumInputMapper(Window.Handle); GumInput = new Gui.Input.Input(GumInputMapper); // Register all bindable actions with the input system. GumInput.AddAction("TEST", Gui.Input.KeyBindingType.Pressed); GumSkin = new RenderData(GraphicsDevice, Content, "newgui/xna_draw", "Content/newgui/sheets.txt"); if (SoundManager.Content == null) { SoundManager.Content = Content; SoundManager.LoadDefaultSounds(); #if XNA_BUILD //SoundManager.SetActiveSongs(ContentPaths.Music.dwarfcorp, ContentPaths.Music.dwarfcorp_2, // ContentPaths.Music.dwarfcorp_3, ContentPaths.Music.dwarfcorp_4, ContentPaths.Music.dwarfcorp_5); #endif } if (GameSettings.Default.DisplayIntro) { StateManager.PushState(new IntroState(this, StateManager)); } else { StateManager.PushState(new MainMenuState(this, StateManager)); } BiomeLibrary.InitializeStatics(); Embarkment.Initialize(); VoxelChunk.InitializeStatics(); ControlSettings.Load(); Drawer2D.Initialize(Content, GraphicsDevice); ResourceLibrary.Initialize(); base.LoadContent(); #if SHARP_RAVEN } catch (Exception exception) { if (ravenClient != null) { ravenClient.Capture(new SentryEvent(exception)); } throw; } #endif }
protected override void LoadContent() { #if SHARP_RAVEN && !DEBUG try { #endif AssetManager.Initialize(Content, GraphicsDevice, GameSettings.Default); //var palette = TextureTool.ExtractPaletteFromDirectoryRecursive("Entities/Dwarf"); //var paletteTexture = TextureTool.Texture2DFromMemoryTexture(GraphicsDevice, TextureTool.MemoryTextureFromPalette(palette)); //paletteTexture.SaveAsPng(System.IO.File.OpenWrite("palette.png"), paletteTexture.Width, paletteTexture.Height); // Prepare GemGui if (GumInputMapper == null) { GumInputMapper = new Gui.Input.GumInputMapper(Window.Handle); GumInput = new Gui.Input.Input(GumInputMapper); } // Register all bindable actions with the input system. //GumInput.AddAction("TEST", Gui.Input.KeyBindingType.Pressed); GuiSkin = new RenderData(GraphicsDevice, Content); // Create console. ConsoleGui = new Gui.Root(GuiSkin); ConsoleGui.RootItem.AddChild(new Gui.Widgets.AutoGridPanel { Rows = 2, Columns = 4, AutoLayout = AutoLayout.DockFill }); ConsoleGui.RootItem.Layout(); if (_logwriter != null) { _logwriter.SetConsole(GetConsoleTile("LOG")); } Console.Out.WriteLine("Console created."); if (SoundManager.Content == null) { SoundManager.Content = Content; SoundManager.LoadDefaultSounds(); #if XNA_BUILD //SoundManager.SetActiveSongs(ContentPaths.Music.dwarfcorp, ContentPaths.Music.dwarfcorp_2, // ContentPaths.Music.dwarfcorp_3, ContentPaths.Music.dwarfcorp_4, ContentPaths.Music.dwarfcorp_5); #endif } if (StateManager.StateStack.Count == 0) { if (GameSettings.Default.DisplayIntro) { StateManager.PushState(new IntroState(this, StateManager)); } else { StateManager.PushState(new MainMenuState(this, StateManager)); } } BiomeLibrary.InitializeStatics(); EmbarkmentLibrary.InitializeDefaultLibrary(); VoxelChunk.InitializeStatics(); ControlSettings.Load(); Drawer2D.Initialize(Content, GraphicsDevice); ResourceLibrary.Initialize(); base.LoadContent(); #if SHARP_RAVEN && !DEBUG } catch (Exception exception) { if (ravenClient != null) { ravenClient.Capture(new SentryEvent(exception)); } throw; } #endif }
protected override void LoadContent() { // Prepare GemGui GumInputMapper = new Gum.Input.GumInputMapper(Window.Handle); GumInput = new Gum.Input.Input(GumInputMapper); // Register all bindable actions with the input system. GumInput.AddAction("TEST", Gum.Input.KeyBindingType.Pressed); GumSkin = new RenderData(GraphicsDevice, Content, "newgui/xna_draw", "Content/newgui/sheets.txt"); if (SoundManager.Content == null) { SoundManager.Content = Content; SoundManager.LoadDefaultSounds(); #if XNA_BUILD SoundManager.SetActiveSongs(ContentPaths.Music.dwarfcorp, ContentPaths.Music.dwarfcorp_2, ContentPaths.Music.dwarfcorp_3, ContentPaths.Music.dwarfcorp_4, ContentPaths.Music.dwarfcorp_5); #endif } // The thing keeping this from working is that some states are tied tightly to the play state. // Ideally the solution is to stop caching these at all, so there's no point in trying to make // an implementation work just to throw it out. /* * foreach (var type in System.Reflection.Assembly.GetExecutingAssembly().GetTypes()) * { * if (type.IsSubclassOf(typeof(GameState))) * { * var instance = Activator.CreateInstance(type, this, StateManager); * StateManager.States.Add(type.Name, instance as GameState); * } * } */ /* * PlayState playState = new PlayState(this, StateManager); * StateManager.States["IntroState"] = new IntroState(this, StateManager); * StateManager.States["PlayState"] = playState; * StateManager.States["MainMenuState"] = new MainMenuState(this, StateManager); * StateManager.States["NewGameChooseWorldState"] = new NewGameChooseWorldState(this, StateManager); * StateManager.States["NewGameCreateDebugWorldState"] = new NewGameCreateDebugWorldState(this, StateManager); * StateManager.States["WorldSetupState"] = new WorldSetupState(this, StateManager); * StateManager.States["WorldGeneratorState"] = new WorldGeneratorState(this, StateManager); * StateManager.States["OptionsState"] = new OptionsState(this, StateManager); * StateManager.States["NewOptionsState"] = new NewOptionsState(this, StateManager); * StateManager.States["EconomyState"] = new EconomyState(this, StateManager); * StateManager.States["CompanyMakerState"] = new CompanyMakerState(this, StateManager); * StateManager.States["WorldLoaderState"] = new WorldLoaderState(this, StateManager); * StateManager.States["GameLoaderState"] = new GameLoaderState(this, StateManager); * StateManager.States["LoseState"] = new LoseState(this, StateManager, playState); * StateManager.States["LoadState"] = new LoadState(this, StateManager); */ if (GameSettings.Default.DisplayIntro) { StateManager.PushState(new IntroState(this, StateManager)); } else { StateManager.PushState(new MainMenuState(this, StateManager)); } BiomeLibrary.InitializeStatics(); Embarkment.Initialize(); VoxelChunk.InitializeStatics(); ControlSettings.Load(); Drawer2D.Initialize(Content, GraphicsDevice); ResourceLibrary.Initialize(); base.LoadContent(); }