Beispiel #1
0
    public LogbookKeyButton(LogbookKeyTranslations translations, Rectangle rect) : base(rect)
    {
        AddStyle("logbook-key-button");

        _translations = translations;

        _title           = new WidgetText();
        _title.Text      = " ";
        _title.X         = 5;
        _title.Y         = 2;
        _title.FixedSize = new Size(rect.Width, _title.GetPreferredSize().Height);
        AddContent(_title);

        var currentY = _title.GetPreferredSize().Height + 1;

        _acquiredLabel   = new WidgetText();
        _acquiredLabel.X = 5;
        _acquiredLabel.Y = currentY;
        AddContent(_acquiredLabel);

        var innerRectangle = new WidgetRectangle();

        innerRectangle.X         = 1;
        innerRectangle.Y         = 1;
        innerRectangle.FixedSize = new Size(rect.Width - 2, rect.Height - 2);
        innerRectangle.Pen       = new PackedLinearColorA(0xFF909090);
        AddContent(innerRectangle);

        _outerRectangle     = new WidgetRectangle();
        _outerRectangle.Pen = PackedLinearColorA.White;
        AddContent(_outerRectangle);
    }
Beispiel #2
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);
    }