Ejemplo n.º 1
0
    public SkillButton(Rectangle rect) : base(rect)
    {
        _skillNameLabel   = new WidgetText("", "char-ui-skill-button");
        _skillNameLabel.X = 4;
        _skillNameLabel.Y = -1;
        AddContent(_skillNameLabel);

        // Rectangle surrounding the bonus
        var bonusBox = new WidgetRectangle();

        bonusBox.Pen       = new PackedLinearColorA(0xFF80A0C0);
        bonusBox.X         = rect.Width - 38;
        bonusBox.Y         = 1;
        bonusBox.FixedSize = new Size(30, rect.Height - 2);
        AddContent(bonusBox);

        _skillBonusLabel           = new WidgetText("", "char-ui-skill-button");
        _skillBonusLabel.X         = bonusBox.X;
        _skillBonusLabel.Y         = _skillNameLabel.Y;
        _skillBonusLabel.FixedSize = bonusBox.FixedSize;
        _skillBonusLabel.AddStyle("char-ui-skill-value");
        AddContent(_skillBonusLabel);

        SetClickHandler(ShowBonusDetails);
    }