TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ DrawSelf()

override void Terraria.ModLoader.Config.UI.ItemDefinitionOptionElement.DrawSelf ( SpriteBatch spriteBatch)
inlineprotected

Definition at line 26 of file ItemDefinitionOptionElement.cs.

27 {
28 //IL_0020: Unknown result type (might be due to invalid IL or missing references)
29 //IL_002e: Unknown result type (might be due to invalid IL or missing references)
30 //IL_0038: Unknown result type (might be due to invalid IL or missing references)
31 //IL_00c5: Unknown result type (might be due to invalid IL or missing references)
32 //IL_00ca: Unknown result type (might be due to invalid IL or missing references)
33 //IL_00b5: Unknown result type (might be due to invalid IL or missing references)
34 //IL_00ba: Unknown result type (might be due to invalid IL or missing references)
35 //IL_00cc: Unknown result type (might be due to invalid IL or missing references)
36 //IL_00d1: Unknown result type (might be due to invalid IL or missing references)
37 //IL_00ea: Unknown result type (might be due to invalid IL or missing references)
38 //IL_00f3: Unknown result type (might be due to invalid IL or missing references)
39 //IL_014e: Unknown result type (might be due to invalid IL or missing references)
40 //IL_0159: Unknown result type (might be due to invalid IL or missing references)
41 //IL_015e: Unknown result type (might be due to invalid IL or missing references)
42 //IL_0162: Unknown result type (might be due to invalid IL or missing references)
43 //IL_0167: Unknown result type (might be due to invalid IL or missing references)
44 //IL_016e: Unknown result type (might be due to invalid IL or missing references)
45 //IL_0173: Unknown result type (might be due to invalid IL or missing references)
46 //IL_0178: Unknown result type (might be due to invalid IL or missing references)
47 //IL_017a: Unknown result type (might be due to invalid IL or missing references)
48 //IL_0181: Unknown result type (might be due to invalid IL or missing references)
49 //IL_018b: Unknown result type (might be due to invalid IL or missing references)
50 //IL_0190: Unknown result type (might be due to invalid IL or missing references)
51 //IL_0195: Unknown result type (might be due to invalid IL or missing references)
52 //IL_0197: Unknown result type (might be due to invalid IL or missing references)
53 //IL_0199: Unknown result type (might be due to invalid IL or missing references)
54 //IL_01ac: Unknown result type (might be due to invalid IL or missing references)
55 //IL_01b1: Unknown result type (might be due to invalid IL or missing references)
56 //IL_01ba: Unknown result type (might be due to invalid IL or missing references)
57 //IL_01bc: Unknown result type (might be due to invalid IL or missing references)
58 //IL_01c4: Unknown result type (might be due to invalid IL or missing references)
59 //IL_01c6: Unknown result type (might be due to invalid IL or missing references)
60 //IL_01d1: Unknown result type (might be due to invalid IL or missing references)
61 //IL_01d6: Unknown result type (might be due to invalid IL or missing references)
62 //IL_01db: Unknown result type (might be due to invalid IL or missing references)
63 //IL_0268: Unknown result type (might be due to invalid IL or missing references)
64 //IL_026a: Unknown result type (might be due to invalid IL or missing references)
65 //IL_0272: Unknown result type (might be due to invalid IL or missing references)
66 //IL_0274: Unknown result type (might be due to invalid IL or missing references)
67 //IL_027f: Unknown result type (might be due to invalid IL or missing references)
68 //IL_0284: Unknown result type (might be due to invalid IL or missing references)
69 //IL_0289: Unknown result type (might be due to invalid IL or missing references)
70 //IL_01eb: Unknown result type (might be due to invalid IL or missing references)
71 //IL_01ed: Unknown result type (might be due to invalid IL or missing references)
72 //IL_01fa: Unknown result type (might be due to invalid IL or missing references)
73 //IL_01fc: Unknown result type (might be due to invalid IL or missing references)
74 //IL_0206: Unknown result type (might be due to invalid IL or missing references)
75 //IL_021e: Unknown result type (might be due to invalid IL or missing references)
76 //IL_0223: Unknown result type (might be due to invalid IL or missing references)
77 //IL_02ab: Unknown result type (might be due to invalid IL or missing references)
78 //IL_02ba: Unknown result type (might be due to invalid IL or missing references)
79 //IL_02c5: Unknown result type (might be due to invalid IL or missing references)
80 //IL_02ca: Unknown result type (might be due to invalid IL or missing references)
81 //IL_02d4: Unknown result type (might be due to invalid IL or missing references)
82 //IL_02de: Unknown result type (might be due to invalid IL or missing references)
83 //IL_02ed: Unknown result type (might be due to invalid IL or missing references)
84 //IL_0231: Unknown result type (might be due to invalid IL or missing references)
85 //IL_0233: Unknown result type (might be due to invalid IL or missing references)
86 //IL_0240: Unknown result type (might be due to invalid IL or missing references)
87 //IL_0245: Unknown result type (might be due to invalid IL or missing references)
88 //IL_024f: Unknown result type (might be due to invalid IL or missing references)
89 if (Item != null)
90 {
91 CalculatedStyle dimensions = GetInnerDimensions();
92 spriteBatch.Draw(base.BackgroundTexture.Value, dimensions.Position(), (Rectangle?)null, Color.White, 0f, Vector2.Zero, base.Scale, (SpriteEffects)0, 0f);
93 if (!Item.IsAir || base.Unloaded)
94 {
95 int type = (base.Unloaded ? ModContent.ItemType<UnloadedItem>() : Item.type);
96 Main.instance.LoadItem(Item.type);
97 Texture2D itemTexture = TextureAssets.Item[type].Value;
98 Rectangle rectangle2 = ((Main.itemAnimations[type] == null) ? itemTexture.Frame() : Main.itemAnimations[type].GetFrame(itemTexture));
99 Color newColor = Color.White;
100 float pulseScale = 1f;
102 int height = rectangle2.Height;
103 int width = rectangle2.Width;
104 float drawScale = 1f;
106 if ((float)width > availableWidth || (float)height > availableWidth)
107 {
108 drawScale = ((width <= height) ? (availableWidth / (float)height) : (availableWidth / (float)width));
109 }
110 drawScale *= base.Scale;
111 Vector2 vector = base.BackgroundTexture.Size() * base.Scale;
112 Vector2 position2 = dimensions.Position() + vector / 2f - rectangle2.Size() * drawScale / 2f;
113 Vector2 origin = rectangle2.Size() * (pulseScale / 2f - 0.5f);
114 if (ItemLoader.PreDrawInInventory(Item, spriteBatch, position2, rectangle2, Item.GetAlpha(newColor), Item.GetColor(Color.White), origin, drawScale * pulseScale))
115 {
116 spriteBatch.Draw(itemTexture, position2, (Rectangle?)rectangle2, Item.GetAlpha(newColor), 0f, origin, drawScale * pulseScale, (SpriteEffects)0, 0f);
117 if (Item.color != Color.Transparent)
118 {
119 spriteBatch.Draw(itemTexture, position2, (Rectangle?)rectangle2, Item.GetColor(Color.White), 0f, origin, drawScale * pulseScale, (SpriteEffects)0, 0f);
120 }
121 }
122 ItemLoader.PostDrawInInventory(Item, spriteBatch, position2, rectangle2, Item.GetAlpha(newColor), Item.GetColor(Color.White), origin, drawScale * pulseScale);
123 if (ItemID.Sets.TrapSigned[type])
124 {
125 spriteBatch.Draw(TextureAssets.Wire.Value, dimensions.Position() + new Vector2(40f, 40f) * base.Scale, (Rectangle?)new Rectangle(4, 58, 8, 8), Color.White, 0f, new Vector2(4f), 1f, (SpriteEffects)0, 0f);
126 }
127 }
128 }
129 if (base.IsMouseHovering)
130 {
131 UIModConfig.Tooltip = base.Tooltip;
132 }
133 }
static Asset< Texture2D >[] Item
static Asset< Texture2D > Wire
static bool[] TrapSigned
If true for a given item type (F:Terraria.Item.type), then that item will have a small wire icon (F:T...
Definition ItemID.cs:1313
Color GetColor(Color newColor)
Definition Item.cs:49459
bool IsAir
Definition Item.cs:965
Color GetAlpha(Color newColor)
Definition Item.cs:49238
Color color
Draws the item sprite with a colored tint. Gel and Sharkfin use this to spawn different colored items...
Definition Item.cs:506
int type
The Item ID of this item. The Item ID is a unique number assigned to each Item loaded into the game....
Definition Item.cs:345
static void GetItemLight(ref Color currentColor, Item item, bool outInTheWorld=false)
Definition ItemSlot.cs:3284

References Terraria.Item.color, Terraria.ModLoader.Config.UI.DefinitionOptionElement< ItemDefinition >.DefaultBackgroundTexture, Terraria.Item.GetAlpha(), Terraria.Item.GetColor(), Terraria.UI.ItemSlot.GetItemLight(), Terraria.Main.instance, Terraria.Item.IsAir, Terraria.GameContent.TextureAssets.Item, Terraria.Main.itemAnimations, Terraria.ModLoader.ItemLoader.PostDrawInInventory(), Terraria.ModLoader.ItemLoader.PreDrawInInventory(), Terraria.ID.ItemID.Sets.TrapSigned, Terraria.Item.type, and Terraria.GameContent.TextureAssets.Wire.

+ Here is the call graph for this function: