public override void Build(UIComponent parent,
                                   U.UBuilder builder)
        {
            StringBuilder text           = new StringBuilder();
            List <string> keybindStrings = this.keybindSetting_.ToLocalizedStringList();
            bool          firstShortcut  = true; // tracking | separators between multiple keybinds

            foreach (string keybindStr in keybindStrings)
            {
                if (!firstShortcut)
                {
                    text.Append("| ");
                }
                else
                {
                    firstShortcut = false;
                }

                text.Append(UConst.GetKeyboardShortcutColorTagOpener());
                text.Append(keybindStr);
                text.Append(UConst.KEYBOARD_SHORTCUT_CLOSING_TAG);
            }

            text.Append(" ");
            text.Append(this.localizedText_);

            builder.Label <U.ULabel>(
                parent,
                t: text.ToString(),
                stack: UStackMode.NewRowBelow,
                processMarkup: true);
        }
        public override void Build(UIComponent parent,
                                   U.UBuilder builder)
        {
            ULabel l = builder.Label <U.ULabel>(
                parent,
                this.localizedText_,
                stack: UStackMode.NewRowBelow,
                processMarkup: true);

            l.opacity = 0.8f;
        }
示例#3
0
        public override void Build(UIComponent parent,
                                   U.UBuilder builder)
        {
            // Capacity 9 will fit all modifiers and separators and the text
            StringBuilder text = new StringBuilder(capacity: 9);

            text.Append(UConst.GetKeyboardShortcutColorTagOpener());

            if (this.shift_)
            {
                text.Append(Translation.Options.Get("Shortcut.Modifier:Shift"));
                text.Append("+");
            }

            if (this.ctrl_)
            {
                text.Append(Translation.Options.Get("Shortcut.Modifier:Ctrl"));
                text.Append("+");
            }

            if (this.alt_)
            {
                text.Append(Translation.Options.Get("Shortcut.Modifier:Alt"));
                text.Append("+");
            }

            text.Append(TranslationForMouseButton(this.button_));
            text.Append(UConst.KEYBOARD_SHORTCUT_CLOSING_TAG + " ");
            text.Append(this.localizedText_);

            builder.Label <U.ULabel>(
                parent,
                t: text.ToString(),
                stack: UStackMode.NewRowBelow,
                processMarkup: true);
        }