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

◆ ProcessOutgoingMessage()

void Terraria.Chat.Commands.EmojiCommand.ProcessOutgoingMessage ( ChatMessage message)
inline

Implements Terraria.Chat.Commands.IChatCommand.

Definition at line 37 of file EmojiCommand.cs.

38 {
39 int result = -1;
40 if (int.TryParse(message.Text, out result))
41 {
43 {
44 return;
45 }
46 }
47 else
48 {
49 result = -1;
50 }
51 if (result == -1)
52 {
53 foreach (LocalizedText key in _byName.Keys)
54 {
55 if (message.Text == key.Value)
56 {
57 result = _byName[key];
58 break;
59 }
60 }
61 }
62 if (result != -1)
63 {
64 if (Main.netMode == 0)
65 {
66 EmoteBubble.NewBubble(result, new WorldUIAnchor(Main.LocalPlayer), 360);
67 EmoteBubble.CheckForNPCsToReactToEmoteBubble(result, Main.LocalPlayer);
68 }
69 else
70 {
71 NetMessage.SendData(120, -1, -1, null, Main.myPlayer, result);
72 }
73 }
74 message.Consume();
75 }
readonly Dictionary< LocalizedText, int > _byName
static void CheckForNPCsToReactToEmoteBubble(int emoteID, Player player)
static int NewBubble(int emoticon, WorldUIAnchor bubbleAnchor, int time)
static readonly int Count
Definition EmoteID.cs:9

References Terraria.Chat.Commands.EmojiCommand._byName, Terraria.GameContent.UI.EmoteBubble.CheckForNPCsToReactToEmoteBubble(), Terraria.Chat.ChatMessage.Consume(), Terraria.GameContent.UI.EmoteID.Count, System.key, System.Collections.Generic.Dictionary< TKey, TValue >.Keys, Terraria.Main.LocalPlayer, Terraria.Main.myPlayer, Terraria.Main.netMode, Terraria.GameContent.UI.EmoteBubble.NewBubble(), Terraria.NetMessage.SendData(), and Terraria.Chat.ChatMessage.Text.