TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches
Terraria.ModLoader.AccessorySlotLoader Class Reference

This serves as a central place to store equipment slots and their corresponding textures. You will use this to obtain the IDs for your equipment textures. More...

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

Public Member Functions

 AccessorySlotLoader ()
 
ModAccessorySlot Get (int id, Player player)
 
new ModAccessorySlot Get (int id)
 
void DrawAccSlots (int num20)
 
bool Draw (int skip, bool modded, int slot, Color color)
 Draws Vanilla and Modded Accessory Slots.
 
AccessorySlotType ContextToEnum (int context)
 
bool ModdedIsItemSlotUnlockedAndUsable (int index, Player player)
 
void CustomUpdateEquips (int index, Player player)
 
bool ModdedCanSlotBeShown (int index)
 
bool IsHidden (int index)
 
bool CanAcceptItem (int index, Item checkItem, int context)
 
void OnHover (int index, int context)
 
bool ModSlotCheck (Item checkItem, int slot, int context)
 Checks if the provided item can go in to the provided slot. Includes checking if the item already exists in either of Player.Armor or ModSlotPlayer.exAccessorySlot Invokes directly ItemSlot.AccCheck & ModSlot.CanAcceptItem.
 
void ModifyDefaultSwapSlot (Item item, ref int accSlotToSwapTo)
 After checking for empty slots in ItemSlot.AccessorySwap, this allows for changing what the target slot will be if the accessory isn't already equipped. DOES NOT affect vanilla behavior of swapping items like for like where existing in a slot.
 
bool PreferredGolfBall (ref int projType)
 Mirrors Player.GetPreferredGolfBallToUse. Provides the golf ball projectile from an accessory slot.
 
int Register (T obj)
 

Static Public Attributes

const int MaxVanillaSlotCount = 7
 
static string[] scrollStackLang
 

Protected Member Functions

int Reserve ()
 

Package Functions

int GetAccessorySlotPerColumn ()
 
void DrawScrollSwitch ()
 
void DrawScrollbar (int accessoryPerColumn, int slotsToRender, int scrollIncrement)
 
bool SetDrawLocation (int trueSlot, int skip, ref int xLoc, ref int yLoc)
 Applies Xloc and Yloc data for the slot, based on ModAccessorySlotPlayer.scrollSlots.
 
bool DrawVisibility (ref bool visbility, int context, int xLoc, int yLoc, out int xLoc2, out int yLoc2, out Texture2D value4)
 Is run in AccessorySlotLoader.Draw. Creates & sets up Hide Visibility Button.
 
void DrawSlot (Item[] items, int context, int slot, bool flag3, int xLoc, int yLoc, bool skipCheck=false)
 Is run in AccessorySlotLoader.Draw. Generates a significant amount of functionality for the slot, despite being named drawing because vanilla. At the end, calls this.DrawRedirect to enable custom drawing.
 
void DrawRedirect (Item[] inv, int context, int slot, Vector2 location, bool isHovered)
 
Texture2D GetBackgroundTexture (int slot, int context)
 Provides the Texture for a Modded Accessory Slot This probably will need optimization down the road.
 
void DrawSlotTexture (Texture2D value6, Vector2 position, Rectangle rectangle, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth, int slot, int context)
 
void Initialize (int vanillaCount)
 Initializes the loader based on the vanilla count of the ModType.
 
virtual void ResizeArrays ()
 
virtual void Unload ()
 
override void Unload ()
 

Static Package Functions

static ModAccessorySlotPlayer ModSlotPlayer (Player player)
 

Package Attributes

List< T > list
 

Properties

static Player Player [get]
 
static int DrawVerticalAlignment [get, private set]
 The variable known as num20 used to align all equipment slot drawing in Main. Represents the y position where equipment slots start to be drawn from.
 
static Vector2 DefenseIconPosition [get, private set]
 The variable that determines where the DefenseIcon will be drawn, after considering all slot information.
 
int VanillaCount [get, set]
 
int TotalCount [get, set]
 

Private Member Functions

ModAccessorySlot GetIdCorrected (int id)
 
void ILoader. ResizeArrays ()
 
void ILoader. Unload ()
 

Private Attributes

int slotDrawLoopCounter
 

Detailed Description

This serves as a central place to store equipment slots and their corresponding textures. You will use this to obtain the IDs for your equipment textures.

Definition at line 20 of file AccessorySlotLoader.cs.


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