示例#1
0
文件: DungeonMap.cs 项目: nwrush/DnD
        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);
        }
示例#2
0
文件: Player.cs 项目: 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;
 }
示例#3
0
        public PlayerStatsPane(MainUI parent, Player p)
        {
            InitializeComponent();

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

            updateStats();
        }
示例#4
0
        public MonsterStatsPane(MainUI parent, Monster m)
        {
            InitializeComponent();

            ParentUI = parent;
            Monster = m;

            updateStats();
        }
示例#5
0
文件: ServerMap.cs 项目: nwrush/DnD
        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;
                    };
                }
            };
        }