tModLoader v2024.11
A mod to make and play Terraria mods
IBestiaryInfoElement Interface Reference

Provides a bestiary UI element to show to the user in the bestiary. More...

Inherited by BestiaryPortraitBackgroundBasedOnWorldEvilProviderPreferenceInfoElement, BestiaryPortraitBackgroundProviderPreferenceInfoElement, BossBestiaryInfoElement, FilterProviderInfoElement, FlavorTextBestiaryInfoElement, IItemBestiaryInfoElement, IPreferenceProviderElement, ItemDropBestiaryInfoElement, ItemFromCatchingNPCBestiaryInfoElement, ModBestiaryInfoElement, MoonLordPortraitBackgroundProviderBestiaryInfoElement, NPCKillCounterInfoElement, NPCNetIdBestiaryInfoElement, NPCPortraitInfoElement, NPCStatsReportInfoElement, NamePlateInfoElement, RareSpawnBestiaryInfoElement, SearchAliasInfoElement, SpawnConditionDecorativeOverlayInfoElement, and UnlockProgressDisplayBestiaryInfoElement.

Public Member Functions

UIElement ProvideUIElement (BestiaryUICollectionInfo info)
 Use to create the UIElement for this bestiary entry. Called when the bestiary entry is clicked in-game. Use BestiaryUICollectionInfo.UnlockState to dynamically populate the UI according to how fully unlocked this particular bestiary entry is. Return null if no UIElement should be provided, which is usually the case for NPC never encountered. More...
 

Detailed Description

Provides a bestiary UI element to show to the user in the bestiary.

Member Function Documentation

◆ ProvideUIElement()

UIElement IBestiaryInfoElement.ProvideUIElement ( BestiaryUICollectionInfo  info)

Use to create the UIElement for this bestiary entry. Called when the bestiary entry is clicked in-game. Use BestiaryUICollectionInfo.UnlockState to dynamically populate the UI according to how fully unlocked this particular bestiary entry is. Return null if no UIElement should be provided, which is usually the case for NPC never encountered.

if (info.UnlockState == BestiaryEntryUnlockState.NotKnownAtAll_0) return null;

// other code creating and returning a UIElement showing info

Implemented in BestiaryPortraitBackgroundBasedOnWorldEvilProviderPreferenceInfoElement, BestiaryPortraitBackgroundProviderPreferenceInfoElement, BossBestiaryInfoElement, FilterProviderInfoElement, FlavorTextBestiaryInfoElement, ItemDropBestiaryInfoElement, ItemFromCatchingNPCBestiaryInfoElement, ModBestiaryInfoElement, MoonLordPortraitBackgroundProviderBestiaryInfoElement, NamePlateInfoElement, NPCKillCounterInfoElement, NPCNetIdBestiaryInfoElement, NPCPortraitInfoElement, NPCStatsReportInfoElement, RareSpawnBestiaryInfoElement, SearchAliasInfoElement, SpawnConditionDecorativeOverlayInfoElement, and UnlockProgressDisplayBestiaryInfoElement.