public DungeonMap(MainUI parent) { InitializeComponent(); this.ParentUI = parent; this.Shown += (object sender, EventArgs e) => { this.Left = ParentUI.Left + ParentUI.Width; this.Top = ParentUI.Top + (ParentUI.Height - this.Height) / 2; }; this.Grid = new DnDTile[100, 100]; mapPanel.Width = GRIDSIZE * 100; mapPanel.Height = GRIDSIZE * 100; mapPanel.Paint += MakeGridSquares; mapPanel.Paint += DrawObjects; this.ClientSize = new Size(361, 361); //Scroll to the middle of the map using (Control c = new Control() { Parent = container, Height = 1, Top = container.ClientSize.Height / 2 + (GRIDSIZE * 50), Width = 1, Left = container.ClientSize.Width / 2 + (GRIDSIZE * 50) }) { container.ScrollControlIntoView(c); } mapPanel.Left = -(GRIDSIZE * 50); mapPanel.Top = -(GRIDSIZE * 50); }
public PlayerStatsPane GetPane(MainUI parent) { if (pane == null || pane.ParentForm != parent) { if (pane != null) { pane.Dispose(); } pane = new PlayerStatsPane(parent, this); } return pane; }
public PlayerStatsPane(MainUI parent, Player p) { InitializeComponent(); this.Player = p; this.ParentUI = parent; updateStats(); }
public MonsterStatsPane(MainUI parent, Monster m) { InitializeComponent(); ParentUI = parent; Monster = m; updateStats(); }
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; }; } }; }