public void CreateShipLabels(int i)
        {
            var       y      = ShipListPanel.LineHeight * i + 1;
            const int height = ShipListPanel.LabelHeight;
            var       labels = new ShipLabels
            {
                Fleet     = new ShipLabel.Fleet(new Point(1, 2)),
                Name      = new ShipLabel.Name(new Point(10, 2), ShipNameWidth.ShipList),
                Hp        = new ShipLabel.Hp(new Point(126, 0), ShipListPanel.LineHeight),
                Cond      = new ShipLabel.Cond(new Point(127, 0), ShipListPanel.LineHeight),
                Level     = new ShipLabel.Level(new Point(152, 2), height),
                Exp       = new ShipLabel.Exp(new Point(174, 2), height),
                BackPanel = new Panel
                {
                    Location = new Point(0, y),
                    Size     = new Size(ListForm.PanelWidth, ShipListPanel.LineHeight),
                    Anchor   = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top
                }
            };

            SetAnchorRight(labels.Hp, labels.Cond, labels.Level, labels.Exp);
            _labelList.Add(labels);
            labels.Arrange(_shipListPanel, CustomColors.ColumnColors.BrightFirst(i));
            labels.Scale();
            _shipListPanel.SetHpPercent(labels.Hp);
        }
Beispiel #2
0
 public void Create(Control parent, ShipListPanels panels)
 {
     _toolTip = panels._toolTip;
     parent.SuspendLayout();
     CreateHeader(parent, panels._hpToggle);
     for (var i = 0; i < _combinedLines.Length; i++)
     {
         var x      = PanelWidth / 2 * (i / ShipInfo.MemberCount);
         var y      = Top + LineHeight * (i % ShipInfo.MemberCount + 1);
         var labels = _combinedLines[i] = new ShipLabels
         {
             Name       = new ShipLabel.Name(new Point(x + 2, y + 2), ShipNameWidth.Combined),
             Hp         = new ShipLabel.Hp(new Point(x + 88, y), LineHeight),
             Cond       = new ShipLabel.Cond(new Point(x + 85, y), LineHeight),
             BackGround = new Label {
                 Location = new Point(x, y), Size = new Size(PanelWidth / 2, LineHeight)
             }
         };
         labels.Arrange(parent, CustomColors.ColumnColors.DarkFirst(i));
         labels.SetClickHandler(panels._onClick);
         labels.SetTag(i);
         var hpLabel = _combinedLines[i].Hp;
         panels._hpToggle.AddHpLabel(hpLabel);
     }
     parent.ResumeLayout();
 }
 private void CreateLabels()
 {
     _phaseLabel = new Label
     {
         Location = new Point(4, TopMargin),
         Size     = new Size(31, LabelHeight + 2)
     };
     _phaseLabel.Click += PhaseLabelClick;
     Controls.Add(_phaseLabel);
     _rankLabel = new Label
     {
         Location = new Point(37, TopMargin),
         Size     = new Size(42, LabelHeight)
     };
     Controls.Add(_rankLabel);
     _supportLabel = new Label
     {
         Location = new Point(77, TopMargin),
         AutoSize = true
     };
     Controls.Add(_supportLabel);
     _cellLabel = new Label
     {
         Location = new Point(0, TopMargin),
         AutoSize = true
     };
     Controls.Add(_cellLabel);
     for (var i = 0; i < 13; i++)
     {
         var friend = new ShipLabels
         {
             Name      = new ShipLabel.Name(new Point(1, LabelMargin), ShipNameWidth.BattleResult),
             Hp        = new ShipLabel.Hp(new Point(101, 0), LineHeight),
             BackPanel = new Panel
             {
                 Location  = new Point(0, LineHeight * i + 38),
                 Size      = new Size(0, LineHeight),
                 BackColor = CustomColors.ColumnColors.DarkFirst(i),
                 Visible   = false
             }
         };
         _friendLabels.Add(friend);
         friend.Arrange(this, CustomColors.ColumnColors.DarkFirst(i));
         _hpLabels.Add(friend.Hp);
         friend.Hp.Click += HpLabelClickHandler;
         var enemy = new ShipLabels
         {
             Name = new ShipLabel.Name(new Point(EnemyNameLeft, LabelMargin), ShipNameWidth.Max),
             Hp   = new ShipLabel.Hp
             {
                 Location    = new Point(119, 0),
                 AutoSize    = true,
                 MinimumSize = new Size(0, LineHeight),
                 TextAlign   = ContentAlignment.MiddleLeft
             }
         };
         _enemyLabels.Add(enemy);
         enemy.Arrange(friend.BackPanel, CustomColors.ColumnColors.DarkFirst(i));
     }
 }
Beispiel #4
0
 public void Create(Control parent, ShipListPanels panels)
 {
     _toolTip = panels._toolTip;
     parent.SuspendLayout();
     _akashiTimerLabels.Create(parent);
     CreateHeader(parent, panels._hpToggle);
     for (var i = 0; i < _shipLines.Length; i++)
     {
         var y      = Top + _lineHeight * (i + 1);
         var labels = _shipLines[i] = new ShipLabels
         {
             Name       = new ShipLabel.Name(new Point(2, y + 2), ShipNameWidth.MainPanel),
             Hp         = new ShipLabel.Hp(new Point(129, y), _lineHeight),
             Cond       = new ShipLabel.Cond(new Point(131, y), _lineHeight),
             Level      = new ShipLabel.Level(new Point(155, y + 2), LabelHeight),
             Exp        = new ShipLabel.Exp(new Point(176, y + 2), LabelHeight),
             BackGround = new Label {
                 Location = new Point(0, y), Size = new Size(PanelWidth, _lineHeight)
             }
         };
         labels.Arrange(parent, CustomColors.ColumnColors.DarkFirst(i));
         labels.SetClickHandler(panels._onClick);
         labels.SetTag(i);
         panels._hpToggle.AddHpLabel(labels.Hp);
     }
     parent.ResumeLayout();
 }
        public void CreateComponents(int i)
        {
            var y      = ShipListPanel.LineHeight * i + 1;
            var labels = new ShipLabels
            {
                Fleet     = new ShipLabel.Fleet(new Point(1, 2)),
                Name      = new ShipLabel.Name(new Point(10, 2), ShipNameWidth.GroupConfig),
                Level     = new ShipLabel.Level(new Point(90, 2), ShipListPanel.LabelHeight),
                BackPanel = new Panel
                {
                    Location = new Point(0, y),
                    Size     = new Size(ListForm.PanelWidth, ShipListPanel.LineHeight),
                    Anchor   = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top
                }
            };
            var cb = new CheckBox[GroupCount];

            for (var j = 0; j < cb.Length; j++)
            {
                cb[j] = new CheckBox
                {
                    Location  = new Point(125 + j * 24, 2),
                    FlatStyle = FlatStyle.Flat,
                    Size      = new Size(12, 11),
                    Tag       = i * 10 + j
                };
                cb[j].CheckedChanged += checkboxGroup_CheckedChanged;
            }
            SetAnchorRight(cb.Concat(new Control[] { labels.Level }).ToArray());
            _labelList.Add(labels);
            _checkBoxesList.Add(cb);
            labels.Arrange(_shipListPanel, CustomColors.ColumnColors.BrightFirst(i));
            labels.BackPanel.Controls.AddRange(cb);
            labels.Scale();
        }