TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ FullName

string Terraria.NPC.FullName
get

The FULL name of this NPC.
If the NPC doesn't have a given name, this will just return the type name. A Stylist without a given name will always return "Stylist" here.
If the NPC does have a given name, this will return the NPC's full name; given name first, then type name.
Full name with a given name is given in the format of "X the Y", where X is their given name and Y is their type name.
For example, a Stylist might return "Scarlett the Stylist" here; with Scarlett being her given name, and Stylist being her type name.

Definition at line 1430 of file NPC.cs.

1431 {
1432 get
1433 {
1434 if (!HasGivenName)
1435 {
1436 return TypeName;
1437 }
1438 return Language.GetTextValue("Game.NPCTitle", _givenName, TypeName);
1439 }
1440 }
static string GetTextValue(string key)
Retrieves the text value for a specified localization key. The text returned will be for the currentl...
Definition Language.cs:35
Contains methods to access or retrieve localization values. The Localization Guideteaches more about ...
Definition Language.cs:12
bool HasGivenName
Whether or not this NPC has a given name.
Definition NPC.cs:1445
string TypeName
The TYPE name of this NPC. Type names are the base titles given to any NPC, and are typically shared...
Definition NPC.cs:1421
string _givenName
Definition NPC.cs:606

Referenced by Terraria.Lang.GetNPCHouseBannerText().