private void newToolStripMenuItem_Click(object sender, EventArgs e) { Game.UpdateLoadMsg("Loading Map..."); MainPanel.EnterLoadPhase(Game.GameLoadState.Loading); Logic.Gameplay.Processor.StartMap("", Logic.Gameplay.Processor.Seed); Logic.Display.Screen.ForceReady(); RefreshTitle(); LoadMapProperties(); SetupLayerVisibility(); if (MainPanel.CurrentMapLayerEditor != null) { MainPanel.CurrentMapLayerEditor.LoadLayers(); } MainPanel.EnterLoadPhase(Game.GameLoadState.Loaded); }
private void btnReloadTiles_Click(object sender, EventArgs e) { Game.UpdateLoadMsg("Reloading Tiles..."); MainPanel.EnterLoadPhase(Game.GameLoadState.Loading); lock (drawLock) { tiles = new List <Image>(); for (int i = 0; i < 10; i++) { tiles.Add(new Bitmap(Paths.TilesPath + "Tiles" + i + ".png")); } } RefreshTileset(); Conversion.CompileAllTiles(Paths.TilesPath, Paths.CachedGFXPath + "Tile"); TextureManager.NeedTileReload = true; MainPanel.EnterLoadPhase(Game.GameLoadState.Loaded); }
private void openToolStripMenuItem_Click(object sender, EventArgs e) { DialogResult result = openFileDialog.ShowDialog(); if (result == System.Windows.Forms.DialogResult.OK) { Game.UpdateLoadMsg("Loading Map..."); MainPanel.EnterLoadPhase(Game.GameLoadState.Loading); fileName = openFileDialog.FileName; Logic.Gameplay.Processor.StartMap(fileName, Logic.Gameplay.Processor.Seed); Logic.Display.Screen.ForceReady(); RefreshTitle(); LoadMapProperties(); SetupLayerVisibility(); if (MainPanel.CurrentMapLayerEditor != null) { MainPanel.CurrentMapLayerEditor.LoadLayers(); } MainPanel.EnterLoadPhase(Game.GameLoadState.Loaded); } }
private void resizeMapToolStripMenuItem_Click(object sender, EventArgs e) { MapResizeWindow window = new MapResizeWindow(Processor.CurrentMap.Width, Processor.CurrentMap.Height); if (window.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Game.UpdateLoadMsg("Resizing Map..."); MainPanel.EnterLoadPhase(Game.GameLoadState.Loading); Loc2D diff = Operations.GetResizeOffset(Processor.CurrentMap.Width, Processor.CurrentMap.Height, window.Width, window.Height, Operations.ReverseDir(window.ResizeDir)); Processor.FocusedCharacter.CharLoc += diff; if (Processor.FocusedCharacter.CharLoc.X < 0) { Processor.FocusedCharacter.CharLoc.X = 0; } else if (Processor.FocusedCharacter.CharLoc.X >= window.Width) { Processor.FocusedCharacter.CharLoc.X = window.Width - 1; } if (Processor.FocusedCharacter.CharLoc.Y < 0) { Processor.FocusedCharacter.CharLoc.Y = 0; } else if (Processor.FocusedCharacter.CharLoc.Y >= window.Height) { Processor.FocusedCharacter.CharLoc.Y = window.Height - 1; } PMDToolkit.Logic.Display.Screen.AddResult(new PMDToolkit.Logic.Results.Loc(Processor.FocusedCharIndex, Processor.FocusedCharacter.CharLoc)); Processor.CurrentMap.Resize(window.Width, window.Height, Operations.ReverseDir(window.ResizeDir)); PMDToolkit.Logic.Display.Screen.AddResult(new PMDToolkit.Logic.Results.SetMap(Processor.CurrentMap, 0)); MainPanel.EnterLoadPhase(Game.GameLoadState.Loaded); } }