diff options
Diffstat (limited to 'Archipelago/textclient.gd')
-rw-r--r-- | Archipelago/textclient.gd | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/Archipelago/textclient.gd b/Archipelago/textclient.gd index 7bddf38..3abd9e0 100644 --- a/Archipelago/textclient.gd +++ b/Archipelago/textclient.gd | |||
@@ -25,6 +25,7 @@ func _ready(): | |||
25 | label.margin_top = 80 | 25 | label.margin_top = 80 |
26 | label.margin_bottom = 720 | 26 | label.margin_bottom = 720 |
27 | label.scroll_following = true | 27 | label.scroll_following = true |
28 | label.selection_enabled = true | ||
28 | panel.add_child(label) | 29 | panel.add_child(label) |
29 | 30 | ||
30 | var dynamic_font = DynamicFont.new() | 31 | var dynamic_font = DynamicFont.new() |
@@ -51,7 +52,7 @@ func _ready(): | |||
51 | 52 | ||
52 | func _input(event): | 53 | func _input(event): |
53 | if event is InputEventKey and event.pressed: | 54 | if event is InputEventKey and event.pressed: |
54 | if event.scancode == KEY_TAB: | 55 | if event.scancode == KEY_TAB and !Input.is_key_pressed(KEY_SHIFT): |
55 | if !get_tree().paused: | 56 | if !get_tree().paused: |
56 | is_open = true | 57 | is_open = true |
57 | get_tree().paused = true | 58 | get_tree().paused = true |
@@ -84,5 +85,16 @@ func parse_printjson(text): | |||
84 | 85 | ||
85 | func text_entered(text): | 86 | func text_entered(text): |
86 | var apclient = global.get_node("Archipelago") | 87 | var apclient = global.get_node("Archipelago") |
87 | apclient.say(text.trim_suffix("\n")) | 88 | var cmd = text.trim_suffix("\n") |
89 | if cmd.begins_with("/say "): | ||
90 | if apclient.enable_multiplayer: | ||
91 | var msg = cmd.trim_prefix("/say ") | ||
92 | parse_printjson( | ||
93 | "[LOCAL] [color=#ee00ee]%s[/color]: %s" % [apclient.get_player_name(), msg] | ||
94 | ) | ||
95 | get_tree().get_root().get_node("Spatial/Multiplayer").say(msg) | ||
96 | else: | ||
97 | parse_printjson("Multiplayer must be enabled to use /say") | ||
98 | else: | ||
99 | apclient.say(cmd) | ||
88 | entry.text = "" | 100 | entry.text = "" |