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

◆ DrawItemTextPopups()

static void Terraria.Main.DrawItemTextPopups ( float scaleTarget)
inlinestaticprivate

Definition at line 78993 of file Main.cs.

78994 {
78995 //IL_0052: Unknown result type (might be due to invalid IL or missing references)
78996 //IL_0057: Unknown result type (might be due to invalid IL or missing references)
78997 //IL_005a: Unknown result type (might be due to invalid IL or missing references)
78998 //IL_0066: Unknown result type (might be due to invalid IL or missing references)
78999 //IL_0127: Unknown result type (might be due to invalid IL or missing references)
79000 //IL_012c: Unknown result type (might be due to invalid IL or missing references)
79001 //IL_0155: Unknown result type (might be due to invalid IL or missing references)
79002 //IL_015f: Unknown result type (might be due to invalid IL or missing references)
79003 //IL_0164: Unknown result type (might be due to invalid IL or missing references)
79004 //IL_016f: Unknown result type (might be due to invalid IL or missing references)
79005 //IL_0179: Unknown result type (might be due to invalid IL or missing references)
79006 //IL_017e: Unknown result type (might be due to invalid IL or missing references)
79007 //IL_0188: Unknown result type (might be due to invalid IL or missing references)
79008 //IL_0192: Unknown result type (might be due to invalid IL or missing references)
79009 //IL_0197: Unknown result type (might be due to invalid IL or missing references)
79010 //IL_01b3: Unknown result type (might be due to invalid IL or missing references)
79011 //IL_01b5: Unknown result type (might be due to invalid IL or missing references)
79012 //IL_0217: Unknown result type (might be due to invalid IL or missing references)
79013 //IL_021e: Unknown result type (might be due to invalid IL or missing references)
79014 //IL_0229: Unknown result type (might be due to invalid IL or missing references)
79015 //IL_0230: Unknown result type (might be due to invalid IL or missing references)
79016 //IL_0235: Unknown result type (might be due to invalid IL or missing references)
79017 //IL_0261: Unknown result type (might be due to invalid IL or missing references)
79018 //IL_0263: Unknown result type (might be due to invalid IL or missing references)
79019 //IL_02d7: Unknown result type (might be due to invalid IL or missing references)
79020 //IL_02d9: Unknown result type (might be due to invalid IL or missing references)
79021 //IL_040a: Unknown result type (might be due to invalid IL or missing references)
79022 //IL_0414: Unknown result type (might be due to invalid IL or missing references)
79023 //IL_041c: Unknown result type (might be due to invalid IL or missing references)
79024 //IL_0421: Unknown result type (might be due to invalid IL or missing references)
79025 //IL_0429: Unknown result type (might be due to invalid IL or missing references)
79026 //IL_02f0: Unknown result type (might be due to invalid IL or missing references)
79027 //IL_02f2: Unknown result type (might be due to invalid IL or missing references)
79028 //IL_0346: Unknown result type (might be due to invalid IL or missing references)
79029 //IL_0350: Unknown result type (might be due to invalid IL or missing references)
79030 //IL_0358: Unknown result type (might be due to invalid IL or missing references)
79031 //IL_035d: Unknown result type (might be due to invalid IL or missing references)
79032 //IL_035f: Unknown result type (might be due to invalid IL or missing references)
79033 //IL_0366: Unknown result type (might be due to invalid IL or missing references)
79034 //IL_0371: Unknown result type (might be due to invalid IL or missing references)
79035 //IL_03ad: Unknown result type (might be due to invalid IL or missing references)
79036 //IL_03b7: Unknown result type (might be due to invalid IL or missing references)
79037 //IL_03bf: Unknown result type (might be due to invalid IL or missing references)
79038 //IL_03c4: Unknown result type (might be due to invalid IL or missing references)
79039 //IL_03cc: Unknown result type (might be due to invalid IL or missing references)
79040 //IL_0475: Unknown result type (might be due to invalid IL or missing references)
79041 //IL_047f: Unknown result type (might be due to invalid IL or missing references)
79042 //IL_048c: Unknown result type (might be due to invalid IL or missing references)
79043 //IL_0493: Unknown result type (might be due to invalid IL or missing references)
79044 //IL_0498: Unknown result type (might be due to invalid IL or missing references)
79045 //IL_04d1: Unknown result type (might be due to invalid IL or missing references)
79046 //IL_04d3: Unknown result type (might be due to invalid IL or missing references)
79047 //IL_04e6: Unknown result type (might be due to invalid IL or missing references)
79048 //IL_04fc: Unknown result type (might be due to invalid IL or missing references)
79049 //IL_0501: Unknown result type (might be due to invalid IL or missing references)
79050 //IL_0510: Unknown result type (might be due to invalid IL or missing references)
79051 //IL_0518: Unknown result type (might be due to invalid IL or missing references)
79052 //IL_0524: Unknown result type (might be due to invalid IL or missing references)
79053 //IL_052e: Unknown result type (might be due to invalid IL or missing references)
79054 //IL_0547: Unknown result type (might be due to invalid IL or missing references)
79055 //IL_0549: Unknown result type (might be due to invalid IL or missing references)
79056 //IL_055c: Unknown result type (might be due to invalid IL or missing references)
79057 //IL_0572: Unknown result type (might be due to invalid IL or missing references)
79058 //IL_0577: Unknown result type (might be due to invalid IL or missing references)
79059 //IL_0586: Unknown result type (might be due to invalid IL or missing references)
79060 //IL_058e: Unknown result type (might be due to invalid IL or missing references)
79061 //IL_059a: Unknown result type (might be due to invalid IL or missing references)
79062 //IL_05a4: Unknown result type (might be due to invalid IL or missing references)
79063 //IL_049f: Unknown result type (might be due to invalid IL or missing references)
79064 //IL_04a9: Unknown result type (might be due to invalid IL or missing references)
79065 //IL_04ae: Unknown result type (might be due to invalid IL or missing references)
79066 Vector2 origin = default(Vector2);
79067 Color color = default(Color);
79068 Vector2 vector2 = default(Vector2);
79069 for (int i = 0; i < 20; i++)
79070 {
79071 PopupText popupText = Main.popupText[i];
79072 if (!popupText.active)
79073 {
79074 continue;
79075 }
79076 string text = popupText.name;
79077 if (popupText.stack > 1)
79078 {
79079 text = text + " (" + popupText.stack + ")";
79080 }
79081 Vector2 vector = FontAssets.MouseText.Value.MeasureString(text);
79082 ((Vector2)(ref origin))._002Ector(vector.X * 0.5f, vector.Y * 0.5f);
79083 float num = popupText.scale / scaleTarget;
79084 int num5 = (int)(255f - 255f * num);
79085 float num6 = (int)((Color)(ref popupText.color)).R;
79086 float num7 = (int)((Color)(ref popupText.color)).G;
79087 float num8 = (int)((Color)(ref popupText.color)).B;
79088 float num9 = (int)((Color)(ref popupText.color)).A;
79089 num6 *= num * popupText.alpha * 0.3f;
79090 num8 *= num * popupText.alpha * 0.3f;
79091 num7 *= num * popupText.alpha * 0.3f;
79092 num9 *= num * popupText.alpha;
79093 ((Color)(ref color))._002Ector((int)num6, (int)num7, (int)num8, (int)num9);
79094 Color color2 = Color.Black;
79095 float num10 = 1f;
79096 Texture2D texture2D = null;
79097 switch (popupText.context)
79098 {
79099 case PopupTextContext.ItemPickupToVoidContainer:
79100 color2 = new Color(127, 20, 255) * 0.4f;
79101 num10 = 0.8f;
79102 break;
79103 case PopupTextContext.SonarAlert:
79104 color2 = Color.Blue * 0.4f;
79105 if (popupText.npcNetID != 0)
79106 {
79107 color2 = Color.Red * 0.4f;
79108 }
79109 num10 = 1f;
79110 break;
79111 }
79112 float num11 = (float)num5 / 255f;
79113 for (int j = 0; j < 5; j++)
79114 {
79115 color = color2;
79116 float num12 = 0f;
79117 float num2 = 0f;
79118 switch (j)
79119 {
79120 case 0:
79121 num12 -= scaleTarget * 2f;
79122 break;
79123 case 1:
79124 num12 += scaleTarget * 2f;
79125 break;
79126 case 2:
79127 num2 -= scaleTarget * 2f;
79128 break;
79129 case 3:
79130 num2 += scaleTarget * 2f;
79131 break;
79132 default:
79133 color = popupText.color * num * popupText.alpha * num10;
79134 break;
79135 }
79136 if (j < 4)
79137 {
79138 num9 = (float)(int)((Color)(ref popupText.color)).A * num * popupText.alpha;
79139 ((Color)(ref color))._002Ector(0, 0, 0, (int)num9);
79140 }
79141 if (color2 != Color.Black && j < 4)
79142 {
79143 num12 *= 1.3f + 1.3f * num11;
79144 num2 *= 1.3f + 1.3f * num11;
79145 }
79146 float num3 = popupText.position.Y - screenPosition.Y + num2;
79147 if (player[myPlayer].gravDir == -1f)
79148 {
79149 num3 = (float)screenHeight - num3;
79150 }
79151 if (color2 != Color.Black && j < 4)
79152 {
79153 Color color3 = color2;
79154 ((Color)(ref color3)).A = (byte)MathHelper.Lerp(60f, 127f, Utils.GetLerpValue(0f, 255f, num9, clamped: true));
79155 spriteBatch.DrawString(FontAssets.MouseText.Value, text, new Vector2(popupText.position.X - screenPosition.X + num12 + origin.X, num3 + origin.Y), Color.Lerp(color, color3, 0.5f), popupText.rotation, origin, popupText.scale, (SpriteEffects)0, 0f);
79156 spriteBatch.DrawString(FontAssets.MouseText.Value, text, new Vector2(popupText.position.X - screenPosition.X + num12 + origin.X, num3 + origin.Y), color3, popupText.rotation, origin, popupText.scale, (SpriteEffects)0, 0f);
79157 }
79158 else
79159 {
79160 spriteBatch.DrawString(FontAssets.MouseText.Value, text, new Vector2(popupText.position.X - screenPosition.X + num12 + origin.X, num3 + origin.Y), color, popupText.rotation, origin, popupText.scale, (SpriteEffects)0, 0f);
79161 }
79162 if (texture2D != null)
79163 {
79164 float scale = (1.3f - num11) * popupText.scale * 0.7f;
79165 ((Vector2)(ref vector2))._002Ector(popupText.position.X - screenPosition.X + num12 + origin.X, num3 + origin.Y);
79166 Color color4 = color2 * 0.6f;
79167 if (j == 4)
79168 {
79169 color4 = Color.White * 0.6f;
79170 }
79171 ((Color)(ref color4)).A = (byte)((float)(int)((Color)(ref color4)).A * 0.5f);
79172 int num4 = 25;
79173 spriteBatch.Draw(texture2D, vector2 + new Vector2(origin.X * -0.5f - (float)num4 - texture2D.Size().X / 2f, 0f), (Rectangle?)null, color4 * popupText.scale, 0f, texture2D.Size() / 2f, scale, (SpriteEffects)0, 0f);
79174 spriteBatch.Draw(texture2D, vector2 + new Vector2(origin.X * 0.5f + (float)num4 + texture2D.Size().X / 2f, 0f), (Rectangle?)null, color4 * popupText.scale, 0f, texture2D.Size() / 2f, scale, (SpriteEffects)0, 0f);
79175 }
79176 }
79177 }
79178 }
static Asset< DynamicSpriteFont > MouseText
Definition FontAssets.cs:10
static SpriteBatch spriteBatch
Definition Main.cs:1043
static int myPlayer
The index in F:Terraria.Main.player of this client's Player. If this is 255, this client is the ser...
Definition Main.cs:1958
static int screenHeight
Definition Main.cs:1870
static Vector2 screenPosition
The position of the top left corner of the screen in world coordinates. Modify in M:Terraria....
Definition Main.cs:1864
static Player[] player
Definition Main.cs:1960
static PopupText[] popupText
Definition Main.cs:1842

References Terraria.Graphics.Light.Color, Terraria.Utils.GetLerpValue(), Terraria.GameContent.FontAssets.MouseText, Terraria.Main.myPlayer, Terraria.Main.player, Terraria.Main.popupText, Terraria.Main.screenHeight, Terraria.Main.screenPosition, and Terraria.Main.spriteBatch.

Referenced by Terraria.Main.DoDraw().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: