about summary refs log tree commit diff stats
path: root/Archipelago/textclient.gd
diff options
context:
space:
mode:
Diffstat (limited to 'Archipelago/textclient.gd')
-rw-r--r--Archipelago/textclient.gd13
1 files changed, 12 insertions, 1 deletions
diff --git a/Archipelago/textclient.gd b/Archipelago/textclient.gd index 7bddf38..f100776 100644 --- a/Archipelago/textclient.gd +++ b/Archipelago/textclient.gd
@@ -84,5 +84,16 @@ func parse_printjson(text):
84 84
85func text_entered(text): 85func text_entered(text):
86 var apclient = global.get_node("Archipelago") 86 var apclient = global.get_node("Archipelago")
87 apclient.say(text.trim_suffix("\n")) 87 var cmd = text.trim_suffix("\n")
88 if cmd.begins_with("/say "):
89 if apclient.enable_multiplayer:
90 var msg = cmd.trim_prefix("/say ")
91 parse_printjson(
92 "[LOCAL] [color=#ee00ee]%s[/color]: %s" % [apclient.get_player_name(), msg]
93 )
94 get_tree().get_root().get_node("Spatial/Multiplayer").say(msg)
95 else:
96 parse_printjson("Multiplayer must be enabled to use /say")
97 else:
98 apclient.say(cmd)
88 entry.text = "" 99 entry.text = ""