Beispiel #1
0
        internal static Label MakeSingleColorLabel(IUIService uiService, IFontService fontService, string friendlyName, Color?FGColor, float fontSize, FontStyle style, Color?BGColor = null)
        {
            // Single Color
            FGColor = TQColorHelper.GetColorFromTaggedString(friendlyName)?.Color() ?? FGColor ?? TQColor.White.Color();            // Color Tag take précédence
            var txt = TQColorHelper.RemoveLeadingColorTag(friendlyName);
            var row = new Label()
            {
                Text      = txt,
                ForeColor = FGColor.Value,
                Font      = fontService.GetFontAlbertusMTLight(fontSize, style, uiService.Scale),
                AutoSize  = true,
                Anchor    = AnchorStyles.Left,
                BackColor = BGColor ?? Color.Transparent,

                //BackColor = Color.Red,
                BorderStyle = BorderStyle.None,                // BorderStyle.FixedSingle
                Margin      = new Padding(0),
            };

            if (BGColor.HasValue)
            {
                row.BackColor = BGColor.Value;
            }

            return(row);
        }
Beispiel #2
0
        public Result(string container, string containerName, int sackNumber, SackType sackType, Item item)
        {
            this.Container     = container ?? throw new ArgumentNullException(nameof(container));
            this.ContainerName = containerName ?? throw new ArgumentNullException(nameof(containerName));
            this.SackNumber    = sackNumber;
            this.SackType      = sackType;
            this.Item          = item ?? throw new ArgumentNullException(nameof(item));
            this.ItemName      = TQColorHelper.RemoveLeadingColorTag(ItemProvider.ToFriendlyName(item));
            ItemStyle computedItemStyle = item.ItemStyle;

            this.ItemStyle = ItemStyleHelper.Translate(computedItemStyle);
            this.Color     = ItemGfxHelper.Color(computedItemStyle);
            var requirementVariables = ItemProvider.GetRequirementVariables(item).Values;

            this.RequiredLevel = GetRequirement(requirementVariables, "levelRequirement");
        }