TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches
Terraria.ModLoader.ModAccessorySlot Class Referenceabstract

A ModAccessorySlot instance represents a net new accessory slot instance. You can store fields in the ModAccessorySlot class. More...

+ Inheritance diagram for Terraria.ModLoader.ModAccessorySlot:
+ Collaboration diagram for Terraria.ModLoader.ModAccessorySlot:

Public Member Functions

virtual bool PreDraw (AccessorySlotType context, Item item, Vector2 position, bool isHovered)
 Allows drawing prior to vanilla ItemSlot.Draw code. Return false to NOT call ItemSlot.Draw.
 
virtual void PostDraw (AccessorySlotType context, Item item, Vector2 position, bool isHovered)
 
virtual void ApplyEquipEffects ()
 Override to replace the vanilla effect behavior of the slot with your own. By default calls: Player.VanillaUpdateEquips(FunctionalItem), Player.ApplyEquipFunctional(FunctionalItem, ShowVisuals), Player.ApplyEquipVanity(VanityItem)
 
virtual bool CanAcceptItem (Item checkItem, AccessorySlotType context)
 Override to set conditions on what can be placed in the slot. Default is to return false only when item property FitsAccessoryVanity says can't go in to a vanity slot. Return false to prevent the item going in slot. Return true for dyes, if you want dyes. Example: only wings can go in slot. Receives data:
 
virtual bool ModifyDefaultSwapSlot (Item item, int accSlotToSwapTo)
 After checking for empty slots in ItemSlot.AccessorySwap, this allows for changing what the default target slot (accSlotToSwapTo) will be. DOES NOT affect vanilla behavior of swapping items like for like where existing in a slot Return true to set this slot as the default targeted slot.
 
virtual bool IsHidden ()
 Override to control whether or not drawing will be skipped during the given frame. NOTE: Nothing will be drawn, nor will subsequent drawing hooks be called on this slot for the frame while true.
 
virtual bool IsEnabled ()
 Override to set conditions on when the slot is valid for stat/vanity calculations and player usage. Example: the demonHeart is consumed and in Expert mode in Vanilla.
 
virtual bool IsVisibleWhenNotEnabled ()
 Override to change the condition on when the slot is visible, but otherwise non-functional for stat/vanity calculations. Defaults to check 'property' IsEmpty.
 
virtual void OnMouseHover (AccessorySlotType context)
 Allows you to do stuff while the player is hovering over this slot.
 
virtual void Load ()
 Allows you to perform one-time loading tasks. Beware that mod content has not finished loading here, things like ModContent lookup tables or ID Sets are not fully populated.
 
virtual bool IsLoadingEnabled (Mod mod)
 Allows you to stop M:Terraria.ModLoader.Mod.AddContent(Terraria.ModLoader.ILoadable) from actually adding this content. Useful for items that can be disabled by a config.
 
virtual void SetupContent ()
 If you make a new ModType, seal this override, and call M:Terraria.ModLoader.ModType.SetStaticDefaults in it.
 
virtual void SetStaticDefaults ()
 Allows you to modify the properties after initial loading has completed.
 
virtual void Unload ()
 Allows you to safely unload things you added in M:Terraria.ModLoader.ModType.Load.
 
string PrettyPrintName ()
 
virtual TModType Clone (TEntity newEntity)
 Create a copy of this instanced global. Called when an entity is cloned.
 
virtual TModType NewInstance (TEntity entity)
 Create a new instance of this ModType for a specific entity.
 

Protected Member Functions

override void Register ()
 
virtual void InitTemplateInstance ()
 Create dummy objects for instanced mod-types.
 
override void InitTemplateInstance ()
 Create dummy objects for instanced mod-types.
 
virtual void ValidateType ()
 Check for the correct overrides of different hook methods and fields and properties.
 
TEntity CreateTemplateEntity ()
 

Properties

int Type [get, set]
 
static Player Player [get]
 
ModAccessorySlotPlayer ModSlotPlayer [get]
 
virtual ? Vector2 CustomLocation [get]
 
virtual string DyeBackgroundTexture [get]
 
virtual string VanityBackgroundTexture [get]
 
virtual string FunctionalBackgroundTexture [get]
 
virtual string DyeTexture [get]
 
virtual string VanityTexture [get]
 
virtual string FunctionalTexture [get]
 
virtual bool DrawFunctionalSlot [get]
 
virtual bool DrawVanitySlot [get]
 
virtual bool DrawDyeSlot [get]
 
Item FunctionalItem [get, set]
 
Item VanityItem [get, set]
 
Item DyeItem [get, set]
 
bool HideVisuals [get, set]
 
bool IsEmpty [get]
 
Mod Mod [get, set]
 The mod this belongs to.
 
virtual string Name [get]
 The internal name of this.
 
string FullName [get]
 The internal name of this, including the mod it is from.
 
TEntity Entity [get, set]
 
virtual bool IsCloneable [get]
 Whether or not this type is cloneable. Cloning is supported if
all reference typed fields in each sub-class which doesn't override Clone are marked with [CloneByReference].
 
virtual bool CloneNewInstances [get]
 Whether to create new instances of this mod type via M:Terraria.ModLoader.ModType`2.Clone(`0) or via the default constructor Defaults to false (default constructor).
 

Private Member Functions

void ILoadable. Load (Mod mod)
 Called when loading the type.
 

Private Attributes

bool? _isCloneable
 

Detailed Description

A ModAccessorySlot instance represents a net new accessory slot instance. You can store fields in the ModAccessorySlot class.

Definition at line 9 of file ModAccessorySlot.cs.


The documentation for this class was generated from the following file: