Files
LuaCsForBarotraumaEP/Barotrauma/BarotraumaClient/ClientSource/Text/LocalizedString/WrappedLString.cs
Juan Pablo Arce 1fd2a51bbb Unstable v0.19.5.0
2022-09-14 12:48:12 -03:00

26 lines
832 B
C#

#nullable enable
namespace Barotrauma
{
public class WrappedLString : LocalizedString
{
private readonly LocalizedString nestedStr;
private readonly float lineLength;
private readonly GUIFont font;
private readonly float textScale;
public WrappedLString(LocalizedString text, float lineLength, GUIFont font, float textScale = 1.0f)
{
this.nestedStr = text;
this.lineLength = lineLength;
this.font = font;
this.textScale = textScale;
}
public override bool Loaded => nestedStr.Loaded;
public override void RetrieveValue()
{
cachedValue = ToolBox.WrapText(nestedStr.Value, lineLength, font.GetFontForStr(nestedStr.Value), textScale);
UpdateLanguage();
}
}
}