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

◆ DrawChat()

void Terraria.GameContent.UI.Chat.LegacyChatMonitor.DrawChat ( bool drawingPlayerChat)
inline

Implements Terraria.GameContent.UI.Chat.IChatMonitor.

Definition at line 186 of file LegacyChatMonitor.cs.

187 {
188 int num = startChatLine;
190 if (num2 >= numChatLines)
191 {
192 num2 = --numChatLines;
193 num = num2 - showCount;
194 }
195 int num3 = 0;
196 int num4 = -1;
197 int num5 = -1;
198 for (int i = num; i < num2; i++)
199 {
200 if (drawingPlayerChat || (chatLine[i].showTime > 0 && chatLine[i].parsedText.Length != 0))
201 {
202 int hoveredSnippet = -1;
203 ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, FontAssets.MouseText.Value, chatLine[i].parsedText, new Vector2(88f, Main.screenHeight - 30 - 28 - num3 * 21), 0f, Vector2.Zero, Vector2.One, out hoveredSnippet);
204 if (hoveredSnippet >= 0 && chatLine[i].parsedText[hoveredSnippet].CheckForHover)
205 {
206 num4 = i;
208 }
209 }
210 num3++;
211 }
212 if (num4 > -1)
213 {
215 if (Main.mouseLeft && Main.mouseLeftRelease)
216 {
218 }
219 }
220 }
TextSnippet[] parsedText
Definition ChatLine.cs:13
static Vector2 DrawColorCodedStringWithShadow(SpriteBatch spriteBatch, DynamicSpriteFont font, TextSnippet[] snippets, Vector2 position, float rotation, Vector2 origin, Vector2 baseScale, out int hoveredSnippet, float maxWidth=-1f, float spread=2f)

References Terraria.GameContent.UI.Chat.LegacyChatMonitor.chatLine, Terraria.UI.Chat.ChatManager.DrawColorCodedStringWithShadow(), Terraria.Main.mouseLeft, Terraria.Main.mouseLeftRelease, Terraria.GameContent.FontAssets.MouseText, Terraria.GameContent.UI.Chat.LegacyChatMonitor.numChatLines, Terraria.UI.Chat.TextSnippet.OnClick(), Microsoft.Xna.Framework.Vector2.One, Terraria.UI.Chat.TextSnippet.OnHover(), Terraria.UI.Chat.ChatLine.parsedText, Terraria.Main.screenHeight, Terraria.GameContent.UI.Chat.LegacyChatMonitor.showCount, Terraria.Main.spriteBatch, Terraria.GameContent.UI.Chat.LegacyChatMonitor.startChatLine, and Microsoft.Xna.Framework.Vector2.Zero.