2 using System.Collections.Generic;
15 public readonly
string mod;
19 public readonly
string Name;
27 public readonly Action<InfoType>
layer;
31 public bool visible =
true;
39 protected DrawLayer(
string mod,
string name, Action<InfoType> layer) {
71 while (parentLayer != null) {
72 if (!parentLayer.
visible || !layers.Contains((T)parentLayer)) {
75 parentLayer = parentLayer.
parent;
84 public virtual void Draw(ref InfoType drawInfo) {
97 public static readonly
PlayerLayer HairBack = CreateVanillaLayer(
"HairBack");
101 public static readonly
PlayerLayer MountBack = CreateVanillaLayer(
"MountBack");
105 public static readonly
PlayerLayer MiscEffectsBack = CreateVanillaLayer(
"MiscEffectsBack");
109 public static readonly
PlayerLayer BackAcc = CreateVanillaLayer(
"BackAcc");
117 public static readonly
PlayerLayer BalloonAcc = CreateVanillaLayer(
"BalloonAcc");
121 public static readonly
PlayerLayer Skin = CreateVanillaLayer(
"Skin");
129 public static readonly
PlayerLayer ShoeAcc = CreateVanillaLayer(
"ShoeAcc");
137 public static readonly
PlayerLayer HandOffAcc = CreateVanillaLayer(
"HandOffAcc");
141 public static readonly
PlayerLayer WaistAcc = CreateVanillaLayer(
"WaistAcc");
145 public static readonly
PlayerLayer NeckAcc = CreateVanillaLayer(
"NeckAcc");
153 public static readonly
PlayerLayer Hair = CreateVanillaLayer(
"Hair");
161 public static readonly
PlayerLayer FaceAcc = CreateVanillaLayer(
"FaceAcc");
165 public static readonly
PlayerLayer MountFront = CreateVanillaLayer(
"MountFront");
169 public static readonly
PlayerLayer ShieldAcc = CreateVanillaLayer(
"ShieldAcc");
173 public static readonly
PlayerLayer SolarShield = CreateVanillaLayer(
"SolarShield");
177 public static readonly
PlayerLayer HeldProjBack = CreateVanillaLayer(
"HeldProjBack");
181 public static readonly
PlayerLayer HeldItem = CreateVanillaLayer(
"HeldItem");
185 public static readonly
PlayerLayer Arms = CreateVanillaLayer(
"Arms");
189 public static readonly
PlayerLayer HandOnAcc = CreateVanillaLayer(
"HandOnAcc");
193 public static readonly
PlayerLayer HeldProjFront = CreateVanillaLayer(
"HeldProjFront");
197 public static readonly
PlayerLayer FrontAcc = CreateVanillaLayer(
"FrontAcc");
201 public static readonly
PlayerLayer MiscEffectsFront = CreateVanillaLayer(
"MiscEffectsFront");
209 public PlayerLayer(
string mod,
string name, Action<PlayerDrawInfo> layer)
210 : base(mod, name, layer) {
221 : base(mod, name, parent, layer) {
225 return new PlayerLayer(
"Terraria", name, _ => { });
262 : base(mod, name, layer) {
273 : base(mod, name, parent, layer) {
static PlayerHeadLayer CreateVanillaLayer(string name)
DrawLayer(string mod, string name, Action< InfoType > layer)
Creates a DrawLayer with the given mod name, identifier name, and drawing action. ...
readonly string Name
The name which identifies this DrawLayer.
DrawLayer(string mod, string name, DrawLayer< InfoType > parent, Action< InfoType > layer)
Creates a DrawLayer with the given mod name, identifier name, parent layer, and drawing action...
PlayerLayer(string mod, string name, Action< PlayerDrawInfo > layer)
Creates a PlayerLayer with the given mod name, identifier name, and drawing action.
This class represents a layer of the drawing of an object, using a certain type of InfoType to help w...
PlayerLayer(string mod, string name, PlayerLayer parent, Action< PlayerDrawInfo > layer)
Creates a PlayerLayer with the given mod name, identifier name, parent layer, and drawing action...
PlayerHeadLayer(string mod, string name, PlayerHeadLayer parent, Action< PlayerHeadDrawInfo > layer)
Creates a PlayerHeadLayer with the given mod name, identifier name, parent layer, and drawing action...
bool visible
Whether or not this DrawLayer should be drawn. For vanilla layers, this will be set to true before al...
readonly Action< InfoType > layer
The delegate of this method, which can either do the actual drawing or add draw data, depending on what kind of layer this is.
readonly string mod
The name of the mod to which this DrawLayer belongs.
This class represents a DrawLayer for the player's map icon, and uses PlayerDrawHeadInfo as its InfoT...
readonly DrawLayer< InfoType > parent
The parent of this DrawLayer. If the parent is not drawn, this layer will not be drawn either...
PlayerHeadLayer(string mod, string name, Action< PlayerHeadDrawInfo > layer)
Creates a PlayerHeadLayer with the given mod name, identifier name, and drawing action.
static PlayerLayer CreateVanillaLayer(string name)
This class represents a DrawLayer for the player, and uses PlayerDrawInfo as its InfoType. Drawing should be done by adding Terraria.DataStructures.DrawData objects to Main.playerDrawData.
virtual void Draw(ref InfoType drawInfo)
Invokes this DrawLayer's layer action.