diff options
Diffstat (limited to 'client/Archipelago/messages.gd')
| -rw-r--r-- | client/Archipelago/messages.gd | 18 |
1 files changed, 14 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() | ||
