public ServerMap(MainUI parent) : base(parent) { InitializeComponent(); mapPanel.Paint += DrawSelectedTile; contextMenu.ItemClicked += (object sender, ToolStripItemClickedEventArgs e) => { if (e.ClickedItem == addMonsterButton) { AddMonsterDialogue amd = new AddMonsterDialogue(); amd.SpawnPoint = PointToGrid(lastClick); amd.Show(); amd.FormClosing += (object sender2, FormClosingEventArgs e2) => { this.AddMonster(amd.Result); e2.Cancel = false; }; } }; }
private void newMonsterToolStripMenuItem_Click(object sender, EventArgs e) { AddMonsterDialogue amd = new AddMonsterDialogue(); amd.SpawnPoint = selectedTile; amd.Show(); amd.FormClosing += (object sender2, FormClosingEventArgs e2) => { this.AddMonster(amd.Result); e2.Cancel = false; }; }