Example #1
0
        private void UpdateWindow()
        {
            _buffCount = _buffList.Count;

            var baseImage    = 20;
            var heightOffset = 36;

            if (_buffCount > 0 && Settings.ExpandedBuffWindow)
            {
                var oldWidth = Size.Width;

                if (_buffCount <= 10)
                {
                    Index = baseImage + _buffCount - 1;
                }
                else if (_buffCount > 10)
                {
                    Index = baseImage + 10;
                }
                else if (_buffCount > 20)
                {
                    Index = baseImage + 11;
                }
                else if (_buffCount > 30)
                {
                    Index = baseImage + 12;
                }
                else if (_buffCount > 40)
                {
                    Index = baseImage + 13;
                }

                var newX = Location.X - Size.Width + oldWidth;
                var newY = heightOffset;
                Location = new Point(newX, newY);

                _buffCountLabel.Visible = false;

                _expandCollapseButton.Location = new Point(Size.Width - 15, 0);
                Size = new Size((_buffCount > 10 ? 10 : _buffCount) * 23, 24 + (_buffCount / 10) * 24);
            }
            else if (_buffCount > 0 && !Settings.ExpandedBuffWindow)
            {
                var oldWidth = Size.Width;

                Index = 20;

                var newX = Location.X - Size.Width + oldWidth;
                var newY = heightOffset;
                Location = new Point(newX, newY);

                _buffCountLabel.Visible  = true;
                _buffCountLabel.Text     = $"{_buffCount}";
                _buffCountLabel.Location = new Point(Size.Width / 2 - _buffCountLabel.Size.Width / 2, Size.Height / 2 - 10);
                _buffCountLabel.BringToFront();

                _expandCollapseButton.Location = new Point(Size.Width - 15, 0);
                Size = new Size(44, 34);
            }
        }
Example #2
0
        private void UpdateWindow()
        {
            _buffCount = _buffList.Count;

            var baseImage    = 20;
            var heightOffset = 0;

            //foreach (var dialog in GameScene.Scene.BuffDialogs)
            //{
            //    if (dialog.Category == Category) break;

            //    if (dialog.Buffs.Count > 0)
            //    {
            //        heightOffset += dialog.Size.Height;
            //    }
            //}

            if (_buffCount > 0 && Settings.ExpandedBuffWindow)
            {
                var oldWidth = Size.Width;

                if (_buffCount <= 10)
                {
                    Index = baseImage + _buffCount - 1;
                }
                else if (_buffCount > 10)
                {
                    Index = baseImage + 10;
                }
                else if (_buffCount > 20)
                {
                    Index = baseImage + 11;
                }
                else if (_buffCount > 30)
                {
                    Index = baseImage + 12;
                }
                else if (_buffCount > 40)
                {
                    Index = baseImage + 13;
                }

                var newX = Location.X - Size.Width + oldWidth;
                var newY = heightOffset;
                Location = new Point(newX, newY);

                _buffCountLabel.Visible = false;

                _expandCollapseButton.Location = new Point(Size.Width - 15, 0);
                Size = new Size((_buffCount > 10 ? 10 : _buffCount) * 23, 24 + (_buffCount / 10) * 24);
            }
            else if (_buffCount > 0 && !Settings.ExpandedBuffWindow)
            {
                var oldWidth = Size.Width;

                Index = 20;

                var newX = Location.X - Size.Width + oldWidth;
                var newY = heightOffset;
                Location = new Point(newX, newY);

                _buffCountLabel.Visible  = true;
                _buffCountLabel.Text     = $"{_buffCount}";
                _buffCountLabel.Location = new Point(Size.Width / 2 - _buffCountLabel.Size.Width / 2, Size.Height / 2 - 10);
                _buffCountLabel.BringToFront();

                _expandCollapseButton.Location = new Point(Size.Width - 15, 0);
                Size = new Size(44, 34);
            }
        }