public override string GetDescriptionPart() { if (socketedThings.Count <= 0) { return(null); } StringBuilder builder = new StringBuilder(); builder.AppendLine("RunesSocketableLabel".Translate()); if (SocketProps.bonusSockets > 0) { builder.AppendLine(" " + "RunesSocketableBonusSockets".Translate() + ": " + SocketProps.bonusSockets); } if (SlotsFromQuality != 0) { builder.AppendLine(" " + "RunesSocketableSlotsQuality".Translate() + ": " + GenText.ToStringByStyle(SlotsFromQuality, ToStringStyle.Integer, ToStringNumberSense.Offset)); } builder.AppendLine(" " + "RunesSocketableTotalAmountOfSockets".Translate() + ": " + TotalAmountOfSlots); builder.AppendLine(" " + "RunesSocketableFreeSockets".Translate() + ": " + FreeSlots); if (SocketedRunes.Count() > 0) { builder.AppendLine(); builder.AppendLine(); } foreach (RuneComp rune in SocketedRunes) { builder.AppendLine(rune.GetRuneDescription()); } return(builder.ToString()); }
public override string TransformLabel(string label) { if (socketedThings.Count <= 0) { return(base.TransformLabel(label)); } var runePrefixes = SocketedRunes?.Where(rune => rune.RuneProps.prefix != null); var runeSufffixes = SocketedRunes?.Where(rune => rune.RuneProps.suffix != null); if (runePrefixes != null) { RuneComp resultRune = runePrefixes.OrderByDescending(rune => rune.RuneProps.labelPower).FirstOrDefault(); if (resultRune != null) { label = resultRune.RuneProps.prefix + " " + label; } } if (runePrefixes != null) { RuneComp resultRune = runeSufffixes.OrderByDescending(rune => rune.RuneProps.labelPower).FirstOrDefault(); if (resultRune != null) { if (label.Contains('(')) { label = label.Insert(label.LastIndexOf('(') - 1, " " + resultRune.RuneProps.suffix); } else { label = label + resultRune.RuneProps.suffix; } } } return(label); }