Client LuaCsForBarotrauma
LimitLString.cs
1
#nullable enable
2
namespace
Barotrauma
3
{
4
public
class
LimitLString
:
LocalizedString
5
{
6
private
readonly
LocalizedString
nestedStr;
7
private
readonly
GUIFont
font;
8
private
readonly
int
maxWidth;
9
10
private
ScalableFont
? cachedFont =
null
;
11
12
public
LimitLString
(
LocalizedString
text,
GUIFont
font,
int
maxWidth)
13
{
14
this.nestedStr = text;
15
this.font = font;
16
this.maxWidth = maxWidth;
17
}
18
19
public
override
bool
Loaded
=> nestedStr.Loaded;
20
protected
override
bool
MustRetrieveValue
()
21
{
22
return
base.MustRetrieveValue() || cachedFont != font.Value || cachedFont?.
Size
!= font.Size;
23
}
24
25
public
override
void
RetrieveValue
()
26
{
27
cachedValue
= font.Value !=
null
28
? ToolBox.LimitString(nestedStr.Value, font.Value, maxWidth)
29
: nestedStr.Value;
30
cachedFont = font.Value;
31
UpdateLanguage
();
32
}
33
}
34
}
Barotrauma.GUIFont
Definition:
GUIPrefab.cs:231
Barotrauma.LimitLString
Definition:
LimitLString.cs:5
Barotrauma.LimitLString.MustRetrieveValue
override bool MustRetrieveValue()
Definition:
LimitLString.cs:20
Barotrauma.LimitLString.RetrieveValue
override void RetrieveValue()
Definition:
LimitLString.cs:25
Barotrauma.LimitLString.Loaded
override bool Loaded
Definition:
LimitLString.cs:19
Barotrauma.LimitLString.LimitLString
LimitLString(LocalizedString text, GUIFont font, int maxWidth)
Definition:
LimitLString.cs:12
Barotrauma.LocalizedString
Definition:
LocalizedString.cs:8
Barotrauma.LocalizedString.cachedValue
string cachedValue
Definition:
LocalizedString.cs:19
Barotrauma.LocalizedString.UpdateLanguage
void UpdateLanguage()
Definition:
LocalizedString.cs:33
Barotrauma.ScalableFont
Definition:
ScalableFont.cs:16
Barotrauma.ScalableFont.Size
uint Size
Definition:
ScalableFont.cs:48
Barotrauma
Definition:
AchievementManager.cs:12
Barotrauma
BarotraumaClient
ClientSource
Text
LocalizedString
LimitLString.cs
Generated by
1.9.1