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

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.

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

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

+ Here is the caller graph for this function:

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

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.

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

47  {
48  return false;
49  }

+ Here is the caller graph for this function:

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

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

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

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

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.

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

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

+ Here is the caller graph for this function:

Property Documentation

Mod Terraria.ModLoader.ModWaterStyle.mod
getset

The mod that added this style of water.

Definition at line 13 of file ModWaterStyle.cs.

Referenced by Terraria.ModLoader.Mod.AddWaterStyle(), and Terraria.ModLoader.Mod.AutoloadWaterStyle().

string Terraria.ModLoader.ModWaterStyle.Name
getset

The internal name of this water style.

Definition at line 21 of file ModWaterStyle.cs.

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