JABofNeurospine
Terrarian
So I figured how to display the chatbox for typing in, however there's no way for me to do anything when the enter key is pressed yet. So I had to improvise.. with tools...
This really is becoming a mess isn't it? Anyway, you can enable the chatbox with the following line:
Not sure how to make it do something when you press enter though, so that's why I made an execute tool to execute the last thing I type in and to open the chatbox in the first place. The Terraria.Main.Update method contains the code that decides when to open the chatbox, so having a hook for that to detect key presses could really help.Code:Terraria.Main.chatMode = true;
You don't actually have to detect when enter is pressed in this case, you can simply check for a change in the chat box.
Code:
if(Main.chatLine[0].text!=lastChatLine)
{
lastChatLine = Main.chatLine[0].text;
//do stuff with the command
}