tModLoader v0.11.8.9
A mod to make and play Terraria mods
Terraria.ModLoader.ModWaterStyle Class Referenceabstract

Represents a style of water that gets drawn, based on factors such as the background. This is used to determine the color of the water, as well as other things as determined by the hooks below. More...

+ Collaboration diagram for Terraria.ModLoader.ModWaterStyle:

Public Member Functions

virtual bool Autoload (ref string name, ref string texture, ref string blockTexture)
 Allows you to automatically add a ModWaterStyle instead of using Mod.AddWaterStyle. Return true to allow autoloading; by default returns the mod's autoload property. Name is initialized to the overriding class name, and texture is initialized to the namespace and overriding class name with periods replaced with slashes. BlockTexture is initialized to texture with "_Block" added at the end. Use this to either force or stop an autoload, change the name that identifies this type of ModWaterStyle, and/or change the texture paths used by this ModWaterStyle. More...
 
virtual Color BiomeHairColor ()
 Allows you to change the hair color resulting from the biome hair dye when this water style is in use. More...
 
abstract int ChooseWaterfallStyle ()
 The ID of the waterfall style the game should use when this water style is in use. More...
 
virtual bool ChooseWaterStyle ()
 Whether the conditions have been met for this water style to be used. Typically Main.bgStyle is checked to determine whether a water style should be used. Returns false by default. More...
 
abstract int GetDropletGore ()
 The ID of the gore that represents droplets of water falling down from a block. More...
 
abstract int GetSplashDust ()
 The ID of the dust that is created when anything splashes in water. More...
 
virtual void LightColorMultiplier (ref float r, ref float g, ref float b)
 Allows you to modify the light levels of the tiles behind the water. The light color components will be multiplied by the parameters. More...
 

Properties

Mod mod [get, set]
 The mod that added this style of water. More...
 
string Name [get, set]
 The internal name of this water style. More...
 
int Type [get, set]
 The ID of the water style. More...
 

Detailed Description

Represents a style of water that gets drawn, based on factors such as the background. This is used to determine the color of the water, as well as other things as determined by the hooks below.

Definition at line 8 of file ModWaterStyle.cs.

Member Function Documentation

◆ Autoload()

virtual bool Terraria.ModLoader.ModWaterStyle.Autoload ( ref string  name,
ref string  texture,
ref string  blockTexture 
)
virtual

Allows you to automatically add a ModWaterStyle instead of using Mod.AddWaterStyle. Return true to allow autoloading; by default returns the mod's autoload property. Name is initialized to the overriding class name, and texture is initialized to the namespace and overriding class name with periods replaced with slashes. BlockTexture is initialized to texture with "_Block" added at the end. Use this to either force or stop an autoload, change the name that identifies this type of ModWaterStyle, and/or change the texture paths used by this ModWaterStyle.

Definition at line 40 of file ModWaterStyle.cs.

40 {
41 return mod.Properties.Autoload;
42 }
ModProperties Properties
Definition: Mod.cs:52
Mod mod
The mod that added this style of water.
bool Autoload
Whether or not this mod will autoload content by default. Autoloading content means you do not need t...

References Terraria.ModLoader.ModProperties.Autoload, Terraria.ModLoader.ModWaterStyle.mod, and Terraria.ModLoader.Mod.Properties.

Referenced by Terraria.ModLoader.Mod.AutoloadWaterStyle().

+ Here is the caller graph for this function:

◆ BiomeHairColor()

virtual Color Terraria.ModLoader.ModWaterStyle.BiomeHairColor ( )
virtual

Allows you to change the hair color resulting from the biome hair dye when this water style is in use.

Definition at line 78 of file ModWaterStyle.cs.

78 {
79 return new Color(28, 216, 94);
80 }

◆ ChooseWaterfallStyle()

abstract int Terraria.ModLoader.ModWaterStyle.ChooseWaterfallStyle ( )
pure virtual

The ID of the waterfall style the game should use when this water style is in use.

Referenced by Terraria.ModLoader.WaterStyleLoader.DrawWaterfall().

+ Here is the caller graph for this function:

◆ ChooseWaterStyle()

virtual bool Terraria.ModLoader.ModWaterStyle.ChooseWaterStyle ( )
virtual

Whether the conditions have been met for this water style to be used. Typically Main.bgStyle is checked to determine whether a water style should be used. Returns false by default.

Definition at line 47 of file ModWaterStyle.cs.

47 {
48 return false;
49 }

Referenced by Terraria.ModLoader.WaterStyleLoader.ChooseWaterStyle().

+ Here is the caller graph for this function:

◆ GetDropletGore()

abstract int Terraria.ModLoader.ModWaterStyle.GetDropletGore ( )
pure virtual

The ID of the gore that represents droplets of water falling down from a block.

◆ GetSplashDust()

abstract int Terraria.ModLoader.ModWaterStyle.GetSplashDust ( )
pure virtual

The ID of the dust that is created when anything splashes in water.

◆ LightColorMultiplier()

virtual void Terraria.ModLoader.ModWaterStyle.LightColorMultiplier ( ref float  r,
ref float  g,
ref float  b 
)
virtual

Allows you to modify the light levels of the tiles behind the water. The light color components will be multiplied by the parameters.

Definition at line 69 of file ModWaterStyle.cs.

69 {
70 r = 0.88f;
71 g = 0.96f;
72 b = 1.015f;
73 }

Referenced by Terraria.ModLoader.WaterStyleLoader.LightColorMultiplier().

+ Here is the caller graph for this function:

Property Documentation

◆ mod

Mod Terraria.ModLoader.ModWaterStyle.mod
getset

The mod that added this style of water.

Definition at line 13 of file ModWaterStyle.cs.

13 {
14 get;
15 internal set;
16 }

Referenced by Terraria.ModLoader.ModWaterStyle.Autoload().

◆ Name

string Terraria.ModLoader.ModWaterStyle.Name
getset

The internal name of this water style.

Definition at line 21 of file ModWaterStyle.cs.

21 {
22 get;
23 internal set;
24 }

Referenced by Terraria.ModLoader.Mod.AutoloadWaterStyle().

◆ Type

int Terraria.ModLoader.ModWaterStyle.Type
getset