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

◆ TryGivingEntryFlavorTextIfItIsMissing()

void Terraria.GameContent.Bestiary.BestiaryDatabaseNPCsPopulator.TryGivingEntryFlavorTextIfItIsMissing ( BestiaryEntry entry)
inlineprivate

Definition at line 674 of file BestiaryDatabaseNPCsPopulator.cs.

675 {
676 if (entry.Info.Any((IBestiaryInfoElement x) => x is FlavorTextBestiaryInfoElement))
677 {
678 return;
679 }
680 SpawnConditionBestiaryInfoElement spawnConditionBestiaryInfoElement = null;
681 int? num = null;
682 foreach (IBestiaryInfoElement item in entry.Info)
683 {
684 if (item is BestiaryPortraitBackgroundProviderPreferenceInfoElement bestiaryPortraitBackgroundProviderPreferenceInfoElement && bestiaryPortraitBackgroundProviderPreferenceInfoElement.GetPreferredProvider() is SpawnConditionBestiaryInfoElement spawnConditionBestiaryInfoElement2)
685 {
687 break;
688 }
689 if (item is SpawnConditionBestiaryInfoElement { DisplayTextPriority: var displayTextPriority } spawnConditionBestiaryInfoElement3 && (!num.HasValue || displayTextPriority >= num))
690 {
693 }
694 }
696 {
697 string displayNameKey = spawnConditionBestiaryInfoElement.GetDisplayNameKey();
698 string text = "Bestiary_BiomeText.biome_";
699 string text2 = displayNameKey.Substring(displayNameKey.IndexOf('.') + 1);
700 text += text2;
701 entry.Info.Add(new FlavorTextBestiaryInfoElement(text));
702 }
703 }
void Add(TKey key, TValue value)

References System.Collections.Generic.Dictionary< TKey, TValue >.Add().

Referenced by Terraria.GameContent.Bestiary.BestiaryDatabaseNPCsPopulator.ModifyEntriesThatNeedIt().