Exemple #1
0
        private void Refresh()
        {
            _flow.Controls.Clear();

            foreach (var item in GameLogic.Player.Items)
            {
                if (item.Equipped)
                {
                    continue;
                }

                var button = new ActionButton(item);
                button.Size       = new Point(40, 40);
                button.Style      = "button";
                button.MouseDrag += button_MouseDrag;

                _flow.Controls.Add(button);
            }
        }
Exemple #2
0
        public ActionBar()
        {
            Size = new Point(44, 44);
            Dock = DockStyle.Bottom;

            var frame = new Frame();

            frame.Dock     = DockStyle.CenterX;
            frame.AutoSize = AutoSize.Horizontal;
            Controls.Add(frame);

            for (var i = 0; i < 8; i++)
            {
                var button = new ActionButton();
                button.Size      = new Point(40, 40);
                button.Style     = "button";
                button.Dock      = DockStyle.Left;
                button.Margin    = new Margin(2);
                button.AllowDrop = true;
                button.DragDrop += button_DragDrop;
                frame.Controls.Add(button);
            }
        }
Exemple #3
0
        public CharacterSheet()
        {
            Resizable     = true;
            Size          = new Point(400, 300);
            Position      = new Point(100, 100);
            Titlebar.Text = "Character";

            _split      = new SplitContainer();
            _split.Dock = DockStyle.Fill;
            Controls.Add(_split);

            _stats      = new ScrollView();
            _stats.Dock = DockStyle.Fill;
            _split.SplitFrame1.Controls.Add(_stats);

            _paperdoll      = new Frame();
            _paperdoll.Dock = DockStyle.Fill;
            _split.SplitFrame2.Controls.Add(_paperdoll);

            var image = new ImageControl {
                Texture = "paperdoll.jpg"
            };

            image.Dock = DockStyle.Fill;
            _paperdoll.Controls.Add(image);

            //top = new Frame { Size = new Point(44, 44), Dock = DockStyle.Top }; paperdoll.Controls.Add(top);
            //bottom = new Frame { Size = new Point(44, 44), Dock = DockStyle.Bottom }; paperdoll.Controls.Add(bottom);
            _left = new Frame {
                Size = new Point(44, 44), Dock = DockStyle.Left
            };
            _paperdoll.Controls.Add(_left);
            _right = new Frame {
                Size = new Point(44, 44), Dock = DockStyle.Right
            };
            _paperdoll.Controls.Add(_right);

            var i = 0;

            foreach (var pair in GameLogic.Player.ItemSlots)
            {
                var button = new ActionButton();
                button.Size      = new Point(40, 40);
                button.Style     = "button";
                button.Dock      = DockStyle.Top;
                button.Margin    = new Margin(2);
                button.AllowDrop = true;
                button.DragDrop += button_DragDrop;
                button.Tooltip   = pair.Key.ToString();
                button.Tag       = pair.Value;

                if (i < 6)
                {
                    _left.Controls.Add(button);
                }
                else
                {
                    _right.Controls.Add(button);
                }

                i++;
            }
        }