Example #1
0
        private void AddModEntry(string modDisplayName, string modName, string recommendedBecause)
        {
            string fmtDisplayName = modDisplayName.Length > 28 ? modDisplayName.Substring(0, 26) : modDisplayName;

            if (fmtDisplayName.Length != modDisplayName.Length)
            {
                fmtDisplayName += "...";
            }

            Rectangle listRect = this.List.GetOuterDimensions().ToRectangle();
            var       uiItem   = new UIText(fmtDisplayName, 0.75f);

            this.List.Append(uiItem);

            Rectangle itemRect = uiItem.GetOuterDimensions().ToRectangle();

            uiItem.Top.Set(itemRect.Height * this.ModNameList.Count, 0f);

            this.List.Recalculate();

            Rectangle descRect = uiItem.GetOuterDimensions().ToRectangle();

            this.ModNameList.Add(modName);
            this.Descriptions[recommendedBecause] = descRect;
        }
Example #2
0
        private void AddLine(string text, float textScale = 1, bool large = false)
        {
            var uiText = new UIText(text, textScale, large);

            uiText.Top.Pixels   = _height;
            uiText.MarginBottom = 10;
            uiText.Recalculate();
            _height += uiText.GetOuterDimensions().Height;
            Append(uiText);
        }
Example #3
0
        private void AddControlLine(string control, string action)
        {
            var controlText = new UIText(control);

            controlText.Top.Pixels = _height;
            controlText.MarginTop  = 5;
            controlText.Recalculate();
            _height += controlText.GetOuterDimensions().Height;

            var actionText = new UIText(action);

            actionText.Top    = controlText.Top;
            actionText.HAlign = 1;

            Append(controlText);
            Append(actionText);
        }