start working on the XLib plugin, add evilium
This commit is contained in:
@@ -7,21 +7,31 @@ extends Control
|
||||
## if you are looking for chat var storage
|
||||
## they are in GameShit/ChatSystem/ChatBox.gd
|
||||
|
||||
|
||||
## This dict holds a reference to all command IDs and their corresponding call
|
||||
var Commands : Dictionary = {
|
||||
"give": CommandHandler.registerCommand("base:giveItem").new(),
|
||||
"say": CommandHandler.registerCommand("base:say").new()
|
||||
}
|
||||
|
||||
## load the language manager
|
||||
var language = LanguageManager.loadLanguage()
|
||||
|
||||
## parse message
|
||||
func _parseMessage():
|
||||
|
||||
## get the contents
|
||||
var messageContents : String = %Input.text
|
||||
|
||||
## handle if its a command
|
||||
if messageContents.begins_with("/"):
|
||||
## strip out the /
|
||||
var command = messageContents.right(-1)
|
||||
## run the command
|
||||
runCommand(command)
|
||||
%Input.text = ""
|
||||
MainGame.hideChatbox.emit()
|
||||
## if its not a command, send the message and reset the field and hide the box
|
||||
else:
|
||||
sendMessage(messageContents)
|
||||
%Input.text = ""
|
||||
|
||||
Reference in New Issue
Block a user