private void worldPicture_OnClicked(int picture) { if (Games.Count > picture) { SelectedDescriptor = Games[picture]; UpdateSelection(); } }
public void DeleteDescriptor(GameLoadDescriptor selectedDescriptor) { Games.Remove(selectedDescriptor); int cols = Math.Max(scroller.LocalBounds.Width / 256, 1); CreateGamePictures(scrollGrid, cols); PropertiesPanel.ClearChildren(); System.IO.Directory.Delete(selectedDescriptor.FileName, true); }
public override void OnEnter() { DefaultFont = Game.Content.Load <SpriteFont>(ContentPaths.Fonts.Default); GUI = new DwarfGUI(Game, DefaultFont, Game.Content.Load <SpriteFont>(ContentPaths.Fonts.Title), Game.Content.Load <SpriteFont>(ContentPaths.Fonts.Small), Input); Input = new InputManager(); CreateGUI(); SelectedDescriptor = null; IsInitialized = true; base.OnEnter(); }
public void LoadDescriptor(GameLoadDescriptor descriptor) { lock (descriptor.Lock) { if (!descriptor.IsLoaded) { return; } PlayState state = (PlayState)(StateManager.States["PlayState"]); state.ExistingFile = descriptor.FileName; GUI.MouseMode = GUISkin.MousePointer.Wait; JoinThreads(); StateManager.PopState(); StateManager.PushState("PlayState"); Games.Clear(); } }
public void LoadWorlds() { ExitThreads = false; try { System.IO.DirectoryInfo savedirectory = System.IO.Directory.CreateDirectory(DwarfGame.GetGameDirectory() + ProgramData.DirChar + SaveDirectory); foreach (System.IO.DirectoryInfo file in savedirectory.EnumerateDirectories()) { GameLoadDescriptor descriptor = new GameLoadDescriptor { FileName = file.FullName }; Games.Add(descriptor); } } catch (System.IO.IOException exception) { Console.Error.WriteLine(exception.Message); } }
public void LoadDescriptor(GameLoadDescriptor descriptor) { lock (descriptor.Lock) { if (!descriptor.IsLoaded) { return; } GUI.MouseMode = GUISkin.MousePointer.Wait; JoinThreads(); StateManager.ClearState(); StateManager.PushState(new LoadState(Game, Game.StateManager, new WorldSettings() { ExistingFile = descriptor.FileName, Name = descriptor.FileName })); Games.Clear(); } }