diff options
| author | Star Rauchenberger <fefferburbia@gmail.com> | 2025-09-13 13:09:31 -0400 |
|---|---|---|
| committer | Star Rauchenberger <fefferburbia@gmail.com> | 2025-09-13 13:09:31 -0400 |
| commit | 19316af04812bc69f29ded74ab3d07c7343690eb (patch) | |
| tree | 44d5a1a8ec0b4c22085d71e337cbc261933f46a4 /client | |
| parent | 7896502cd996b64d4c301eaa1c77c37a9f3e83cd (diff) | |
| download | lingo2-archipelago-19316af04812bc69f29ded74ab3d07c7343690eb.tar.gz lingo2-archipelago-19316af04812bc69f29ded74ab3d07c7343690eb.tar.bz2 lingo2-archipelago-19316af04812bc69f29ded74ab3d07c7343690eb.zip | |
[Client] Clear out messages between connections
Diffstat (limited to 'client')
| -rw-r--r-- | client/Archipelago/messages.gd | 18 | ||||
| -rw-r--r-- | client/Archipelago/pauseMenu.gd | 1 |
2 files changed, 15 insertions, 4 deletions
| diff --git a/client/Archipelago/messages.gd b/client/Archipelago/messages.gd index 52f38b9..82fdbc4 100644 --- a/client/Archipelago/messages.gd +++ b/client/Archipelago/messages.gd | |||
| @@ -48,10 +48,11 @@ func showMessage(text): | |||
| 48 | while !_ordered_labels.is_empty(): | 48 | while !_ordered_labels.is_empty(): |
| 49 | await get_tree().create_timer(timeout).timeout | 49 | await get_tree().create_timer(timeout).timeout |
| 50 | 50 | ||
| 51 | var to_remove = _ordered_labels.pop_front() | 51 | if !_ordered_labels.is_empty(): |
| 52 | var to_tween = get_tree().create_tween().bind_node(to_remove) | 52 | var to_remove = _ordered_labels.pop_front() |
| 53 | to_tween.tween_property(to_remove, "modulate:a", 0.0, 0.5) | 53 | var to_tween = get_tree().create_tween().bind_node(to_remove) |
| 54 | to_tween.tween_callback(to_remove.queue_free) | 54 | to_tween.tween_property(to_remove, "modulate:a", 0.0, 0.5) |
| 55 | to_tween.tween_callback(to_remove.queue_free) | ||
| 55 | 56 | ||
| 56 | if !_message_queue.is_empty(): | 57 | if !_message_queue.is_empty(): |
| 57 | var next_msg = _message_queue.pop_front() | 58 | var next_msg = _message_queue.pop_front() |
| @@ -59,3 +60,12 @@ func showMessage(text): | |||
| 59 | 60 | ||
| 60 | if timeout > 4: | 61 | if timeout > 4: |
| 61 | timeout -= 3 | 62 | timeout -= 3 |
| 63 | |||
| 64 | |||
| 65 | func clear(): | ||
| 66 | _message_queue.clear() | ||
| 67 | |||
| 68 | for message_label in _ordered_labels: | ||
| 69 | message_label.queue_free() | ||
| 70 | |||
| 71 | _ordered_labels.clear() | ||
| diff --git a/client/Archipelago/pauseMenu.gd b/client/Archipelago/pauseMenu.gd index 5da114a..df4bfd1 100644 --- a/client/Archipelago/pauseMenu.gd +++ b/client/Archipelago/pauseMenu.gd | |||
| @@ -9,4 +9,5 @@ func _pause_game(): | |||
| 9 | func _main_menu(): | 9 | func _main_menu(): |
| 10 | global.loaded = false | 10 | global.loaded = false |
| 11 | global.get_node("Archipelago").disconnect_from_ap() | 11 | global.get_node("Archipelago").disconnect_from_ap() |
| 12 | global.get_node("Messages").clear() | ||
| 12 | super._main_menu() | 13 | super._main_menu() |
