diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2025-10-01 12:32:00 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2025-10-01 12:32:00 -0400 |
commit | 54e22c5614ffe3a8a4a74fd3555edccf0c49ab23 (patch) | |
tree | b7e59f69705504978672054820fc59c9c75307ad /apworld/client/effects.gd | |
parent | c7c64dcc56432e85e92a7c619a260bd01bf56e56 (diff) | |
download | lingo2-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.gd | 32 |
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 @@ | |||
1 | extends CanvasLayer | ||
2 | |||
3 | var _label | ||
4 | |||
5 | var _disconnected = false | ||
6 | |||
7 | |||
8 | func _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 | |||
20 | func set_connection_lost(arg): | ||
21 | _disconnected = arg | ||
22 | |||
23 | _update_label() | ||
24 | |||
25 | |||
26 | func _update_label(): | ||
27 | var text = [] | ||
28 | |||
29 | if _disconnected: | ||
30 | text.append("Disconnected from multiworld.") | ||
31 | |||
32 | _label.text = "\n".join(text) | ||