Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
Arquivo: Player.cs Projeto: nwrush/DnD
 public PlayerStatsPane GetPane(MainUI parent)
 {
     if (pane == null || pane.ParentForm != parent) {
         if (pane != null) { pane.Dispose(); }
         pane = new PlayerStatsPane(parent, this);
     }
     return pane;
 }
Exemplo n.º 3
0
        public PlayerStatsPane(MainUI parent, Player p)
        {
            InitializeComponent();

            this.Player = p;
            this.ParentUI = parent;

            updateStats();
        }
Exemplo n.º 4
0
        public MonsterStatsPane(MainUI parent, Monster m)
        {
            InitializeComponent();

            ParentUI = parent;
            Monster = m;

            updateStats();
        }
Exemplo n.º 5
0
        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;
                    };
                }
            };
        }