about summary refs log tree commit diff stats
path: root/apworld/client/effects.gd
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2025-10-01 12:32:00 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2025-10-01 12:32:00 -0400
commit54e22c5614ffe3a8a4a74fd3555edccf0c49ab23 (patch)
treeb7e59f69705504978672054820fc59c9c75307ad /apworld/client/effects.gd
parentc7c64dcc56432e85e92a7c619a260bd01bf56e56 (diff)
downloadlingo2-archipelago-54e22c5614ffe3a8a4a74fd3555edccf0c49ab23.tar.gz
lingo2-archipelago-54e22c5614ffe3a8a4a74fd3555edccf0c49ab23.tar.bz2
lingo2-archipelago-54e22c5614ffe3a8a4a74fd3555edccf0c49ab23.zip
Show in-game when connection drops
Diffstat (limited to 'apworld/client/effects.gd')
-rw-r--r--apworld/client/effects.gd32
1 files changed, 32 insertions, 0 deletions
diff --git a/apworld/client/effects.gd b/apworld/client/effects.gd new file mode 100644 index 0000000..9dc1dd8 --- /dev/null +++ b/apworld/client/effects.gd
@@ -0,0 +1,32 @@
1extends CanvasLayer
2
3var _label
4
5var _disconnected = false
6
7
8func _ready():
9 _label = Label.new()
10 _label.name = "Label"
11 _label.offset_left = 20
12 _label.offset_top = 20
13 _label.horizontal_alignment = HORIZONTAL_ALIGNMENT_LEFT
14 _label.vertical_alignment = VERTICAL_ALIGNMENT_TOP
15 _label.theme = preload("res://assets/themes/baseUI.tres")
16 _label.add_theme_font_size_override("font_size", 36)
17 add_child(_label)
18
19
20func set_connection_lost(arg):
21 _disconnected = arg
22
23 _update_label()
24
25
26func _update_label():
27 var text = []
28
29 if _disconnected:
30 text.append("Disconnected from multiworld.")
31
32 _label.text = "\n".join(text)