Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
NamePlateInfoElement.cs
Go to the documentation of this file.
3using Terraria.UI;
4
6
8{
9 private string _key;
10
11 private int _npcNetId;
12
13 public NamePlateInfoElement(string languageKey, int npcNetId)
14 {
15 _key = languageKey;
16 _npcNetId = npcNetId;
17 }
18
20 {
21 UIElement uIElement = ((info.UnlockState != 0) ? new UIText(Language.GetText(_key)) : new UIText("???"));
22 uIElement.HAlign = 0.5f;
23 uIElement.VAlign = 0.5f;
24 uIElement.Top = new StyleDimension(2f, 0f);
25 uIElement.IgnoresMouseInteraction = true;
26 UIElement uIElement2 = new UIElement();
27 uIElement2.Width = new StyleDimension(0f, 1f);
28 uIElement2.Height = new StyleDimension(24f, 0f);
29 uIElement2.Append(uIElement);
30 return uIElement2;
31 }
32
34 {
35 if (info.UnlockState == BestiaryEntryUnlockState.NotKnownAtAll_0)
36 {
37 return null;
38 }
39 return Language.GetText(_key).Value;
40 }
41}
UIElement ProvideUIElement(BestiaryUICollectionInfo info)
NamePlateInfoElement(string languageKey, int npcNetId)
string GetSearchString(ref BestiaryUICollectionInfo info)
static LocalizedText GetText(string key)
Definition Language.cs:10
void Append(UIElement element)
Definition UIElement.cs:166