Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
EmojiCommand.cs
Go to the documentation of this file.
1using System;
5
7
8[ChatCommand("Emoji")]
10{
11 public const int PlayerEmojiDuration = 360;
12
14
15 public EmojiCommand()
16 {
17 Initialize();
18 }
19
20 public void Initialize()
21 {
22 _byName.Clear();
23 for (int i = 0; i < EmoteID.Count; i++)
24 {
27 {
28 _byName[emojiName] = i;
29 }
30 }
31 }
32
33 public void ProcessIncomingMessage(string text, byte clientId)
34 {
35 }
36
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 {
68 }
69 else
70 {
71 NetMessage.SendData(120, -1, -1, null, Main.myPlayer, result);
72 }
73 }
74 message.Consume();
75 }
76
77 public void PrintWarning(string text)
78 {
79 throw new Exception("This needs localized text!");
80 }
81}
void ProcessOutgoingMessage(ChatMessage message)
void ProcessIncomingMessage(string text, byte clientId)
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
static LocalizedText GetEmojiName(int id)
Definition Lang.cs:176
static readonly LocalizedText Empty
static int myPlayer
Definition Main.cs:1801
static int netMode
Definition Main.cs:2095
static Player LocalPlayer
Definition Main.cs:2829
static void SendData(int msgType, int remoteClient=-1, int ignoreClient=-1, NetworkText text=null, int number=0, float number2=0f, float number3=0f, float number4=0f, int number5=0, int number6=0, int number7=0)
Definition NetMessage.cs:88