tModLoader v0.11.8.9
A mod to make and play Terraria mods
Terraria.ModLoader.UgBgStyleLoader Class Reference

This serves as the central class from which ModUgBgStyle functions are supported and carried out. More...

+ Collaboration diagram for Terraria.ModLoader.UgBgStyleLoader:

Static Public Member Functions

static void ChooseStyle (ref int style)
 
static void FillTextureArray (int style, int[] textureSlots)
 
static ModUgBgStyle GetUgBgStyle (int style)
 Returns the ModUgBgStyle object with the given ID. More...
 

Static Public Attributes

const int vanillaUgBgStyleCount = 18
 

Static Private Attributes

static int nextUgBgStyle = vanillaUgBgStyleCount
 

Detailed Description

This serves as the central class from which ModUgBgStyle functions are supported and carried out.

Definition at line 13 of file BackgroundStyleLoaders.cs.

Member Function Documentation

◆ ChooseStyle()

static void Terraria.ModLoader.UgBgStyleLoader.ChooseStyle ( ref int  style)
static

Definition at line 41 of file BackgroundStyleLoaders.cs.

41 {
42 if (!GlobalBgStyleLoader.loaded) {
43 return;
44 }
45 foreach (var ugBgStyle in ugBgStyles) {
46 if (ugBgStyle.ChooseBgStyle()) {
47 style = ugBgStyle.Slot;
48 }
49 }
50 foreach (var hook in GlobalBgStyleLoader.HookChooseUgBgStyle) {
51 hook(ref style);
52 }
53 }

◆ FillTextureArray()

static void Terraria.ModLoader.UgBgStyleLoader.FillTextureArray ( int  style,
int[]  textureSlots 
)
static

Definition at line 55 of file BackgroundStyleLoaders.cs.

55 {
56 if (!GlobalBgStyleLoader.loaded) {
57 return;
58 }
59 var ugBgStyle = GetUgBgStyle(style);
60 if (ugBgStyle != null) {
61 ugBgStyle.FillTextureArray(textureSlots);
62 }
63 foreach (var hook in GlobalBgStyleLoader.HookFillUgTextureArray) {
64 hook(style, textureSlots);
65 }
66 }
static ModUgBgStyle GetUgBgStyle(int style)
Returns the ModUgBgStyle object with the given ID.

References Terraria.ModLoader.UgBgStyleLoader.GetUgBgStyle().

+ Here is the call graph for this function:

◆ GetUgBgStyle()

static ModUgBgStyle Terraria.ModLoader.UgBgStyleLoader.GetUgBgStyle ( int  style)
static

Returns the ModUgBgStyle object with the given ID.

Definition at line 28 of file BackgroundStyleLoaders.cs.

28 {
29 return style >= vanillaUgBgStyleCount && style < nextUgBgStyle
30 ? ugBgStyles[style - vanillaUgBgStyleCount] : null;
31 }

References Terraria.ModLoader.UgBgStyleLoader.nextUgBgStyle, and Terraria.ModLoader.UgBgStyleLoader.vanillaUgBgStyleCount.

Referenced by Terraria.ModLoader.UgBgStyleLoader.FillTextureArray().

+ Here is the caller graph for this function:

Member Data Documentation

◆ nextUgBgStyle

int Terraria.ModLoader.UgBgStyleLoader.nextUgBgStyle = vanillaUgBgStyleCount
staticprivate

◆ vanillaUgBgStyleCount

const int Terraria.ModLoader.UgBgStyleLoader.vanillaUgBgStyleCount = 18
static