private void neueKarteToolStripMenuItem_Click(object sender, EventArgs e) { NewMapForm newMapForm = new NewMapForm(this); newMapForm.StartPosition = FormStartPosition.CenterParent; newMapForm.ShowDialog(this); }
private void NewButton_Click(object sender, EventArgs e) { MEGameControl.MapState = MapState.Inactive; var newmap = new NewMapForm(); newmap.ShowDialog(); if (newmap.DialogResult == DialogResult.OK) { App.Info("Creating new map..."); MEGameControl.Map = new Map(newmap.MapSize); MEGameControl.DrawOffset = Vector2.Zero; MEGameControl.ActualMapName = newmap.MapName; MEGameControl.ActualMapSize = newmap.MapSize; App.Info($"- Name: {newmap.MapName}"); App.Info($"- Size: {(int)MEGameControl.ActualMapSize} x {(int)MEGameControl.ActualMapSize}"); App.Info("Creating new map... OK!\n"); } MEGameControl.MapState = MapState.Active; }
public NewConfig AskForNewMapConfig() { NewConfig result = new NewConfig(); result.State = false; NewMapForm f = new NewMapForm(); if (f.ShowDialog() == DialogResult.OK) { result = f.Config; } return(result); }
public Size AskUserNewMapSize() { var dialog = new NewMapForm(); var result = dialog.ShowDialog(this.owner); switch (result) { case DialogResult.OK: return(new Size(dialog.MapWidth, dialog.MapHeight)); case DialogResult.Cancel: return(Size.Empty); default: throw new ArgumentException("bad dialogresult"); } }
public void OnNewMapClicked() { NewMapForm newMapForm = new NewMapForm(); state = GameState.Frozen; newMapForm.ShowDialog(); if (newMapForm.DialogResult == System.Windows.Forms.DialogResult.OK) { map.Initialize(newMapForm.width, newMapForm.height, newMapForm.mapTileWidth, newMapForm.mapTileHeight, solid, empty); selectedTileNo = 0; Camera.Position = Vector2.Zero; if (tileSheet != null) { tileSet.Initialize(tileSheet, newMapForm.mapTileWidth, newMapForm.mapTileHeight, selectedImage); map.LoadTileSet(tileSheet); } } state = GameState.Active; }
public override void Effect() { Game1.state = State.FREEZE; NewMapForm newMap = new NewMapForm(); newMap.ShowDialog(); if (newMap.DialogResult == DialogResult.OK) { Game1.mapHeight = newMap.mapHeight; Game1.mapWidth = newMap.mapWidth; Game1.tileHeight = newMap.tileHeight; Game1.tileWidth = newMap.tileWidth; Game1.mapName = newMap.mapName; Game1.selectedTileNumb = 0; Game1.drawOffset = Vector2.Zero; Game1.map = new Map(Game1.mapWidth, Game1.mapHeight, Game1.tileWidth, Game1.tileHeight); if (Game1.tileSheet != null) { Game1.map.LoadTileSet(Game1.tileSheet); } prevClicked = false; } else { prevClicked = false; } Game1.state = State.PLAY; base.Effect(); }