Client LuaCsForBarotrauma
BarotraumaClient/ClientSource/Items/Components/Quality.cs
1 using Microsoft.Xna.Framework;
2 using System;
3 using System.Collections.Generic;
4 using System.Xml.Linq;
5 
7 {
8  partial class Quality : ItemComponent
9  {
10  public override void AddTooltipInfo(ref LocalizedString name, ref LocalizedString description)
11  {
12  foreach (var statValue in statValues)
13  {
14  int roundedValue = (int)Math.Round(statValue.Value * qualityLevel * 100);
15  if (roundedValue == 0) { return; }
16  string colorStr = XMLExtensions.ColorToString(GUIStyle.Green);
17  description += $"\n ‖color:{colorStr}‖{roundedValue.ToString("+0;-#")}%‖color:end‖ {TextManager.Get("qualitystattypenames." + statValue.Key.ToString()).Fallback(statValue.Key.ToString())}";
18  }
19  }
20  }
21 }
override void AddTooltipInfo(ref LocalizedString name, ref LocalizedString description)