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

◆ GetBackgroundTexture()

Texture2D Terraria.ModLoader.AccessorySlotLoader.GetBackgroundTexture ( int slot,
int context )
inlinepackage

Provides the Texture for a Modded Accessory Slot This probably will need optimization down the road.

Definition at line 464 of file AccessorySlotLoader.cs.

465 {
466 ModAccessorySlot thisSlot = Get(slot);
467 switch (context)
468 {
469 case -10:
470 {
471 if (ModContent.RequestIfExists(thisSlot.FunctionalBackgroundTexture, out Asset<Texture2D> funcTexture, AssetRequestMode.AsyncLoad))
472 {
473 return funcTexture.Value;
474 }
475 return TextureAssets.InventoryBack3.Value;
476 }
477 case -11:
478 {
479 if (ModContent.RequestIfExists(thisSlot.VanityBackgroundTexture, out Asset<Texture2D> vanityTexture, AssetRequestMode.AsyncLoad))
480 {
481 return vanityTexture.Value;
482 }
483 return TextureAssets.InventoryBack8.Value;
484 }
485 case -12:
486 {
487 if (ModContent.RequestIfExists(thisSlot.DyeBackgroundTexture, out Asset<Texture2D> dyeTexture, AssetRequestMode.AsyncLoad))
488 {
489 return dyeTexture.Value;
490 }
491 return TextureAssets.InventoryBack12.Value;
492 }
493 default:
494 return TextureAssets.InventoryBack3.Value;
495 }
496 }
static Asset< Texture2D > InventoryBack8
static Asset< Texture2D > InventoryBack3
static Asset< Texture2D > InventoryBack12
ModAccessorySlot Get(int id, Player player)

References Terraria.ModLoader.AccessorySlotLoader.Get(), Terraria.GameContent.TextureAssets.InventoryBack12, Terraria.GameContent.TextureAssets.InventoryBack3, and Terraria.GameContent.TextureAssets.InventoryBack8.

+ Here is the call graph for this function: