tModLoader v2024.11
A mod to make and play Terraria mods
NPCStatsReportInfoElement Class Reference

Inherits IBestiaryInfoElement, and IUpdateBeforeSorting.

Public Member Functions

 NPCStatsReportInfoElement (int npcNetId)
 
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...
 
delegate void StatAdjustmentStep (NPCStatsReportInfoElement element)
 
void UpdateBeforeSorting ()
 
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...
 
void UpdateBeforeSorting ()
 

Public Attributes

int Damage
 
int Defense
 
float KnockbackResist
 
int LifeMax
 
float MonetaryValue
 
int NpcId
 

Events

StatAdjustmentStep OnRefreshStats
 

Member Function Documentation

◆ ProvideUIElement()

UIElement NPCStatsReportInfoElement.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

Implements IBestiaryInfoElement.

◆ UpdateBeforeSorting()

void NPCStatsReportInfoElement.UpdateBeforeSorting ( )

Implements IUpdateBeforeSorting.