Terraria ModLoader  0.10.1.5
A framework for 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...
 

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

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  }
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.
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  }

Member Data Documentation

int Terraria.ModLoader.UgBgStyleLoader.nextUgBgStyle = vanillaUgBgStyleCount
staticprivate

Definition at line 16 of file BackgroundStyleLoaders.cs.

const int Terraria.ModLoader.UgBgStyleLoader.vanillaUgBgStyleCount = 18

Definition at line 15 of file BackgroundStyleLoaders.cs.