diff options
author | tpart <tpart120@proton.me> | 2024-09-25 15:45:28 +0200 |
---|---|---|
committer | tpart <tpart120@proton.me> | 2024-09-25 15:45:33 +0200 |
commit | 511bed5e6ed201e3464820bdd3857d3596e846f1 (patch) | |
tree | 377e826a65564c3d09409a3f14668dcce7e2babf /client/menu | |
parent | 2e9a6d32552258337c0c1402fa4119d40d68c47b (diff) | |
download | hurrycurry-511bed5e6ed201e3464820bdd3857d3596e846f1.tar hurrycurry-511bed5e6ed201e3464820bdd3857d3596e846f1.tar.bz2 hurrycurry-511bed5e6ed201e3464820bdd3857d3596e846f1.tar.zst |
Clear pinned messages
Diffstat (limited to 'client/menu')
-rw-r--r-- | client/menu/communicate/popup_message/pinned_item_messages.gd | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/client/menu/communicate/popup_message/pinned_item_messages.gd b/client/menu/communicate/popup_message/pinned_item_messages.gd index 7343865c..e4507fa7 100644 --- a/client/menu/communicate/popup_message/pinned_item_messages.gd +++ b/client/menu/communicate/popup_message/pinned_item_messages.gd @@ -19,9 +19,11 @@ class_name PinnedItemMessages const ITEM_MESSAGE_SCENE := preload("res://menu/communicate/item/item_message.tscn") const PAPER_PANEL_STYLE := preload("res://menu/theme/paper_panel_style.tres") +var pinned_items := {} + @onready var pinned_items_container: HBoxContainer = $HBoxContainer -func pin_item(item_name: String, timeout_initial_: float, timeout_remaining_: float): +func pin_item(item_name: String, timeout_initial_: float, timeout_remaining_: float, player_id: float): var item_message: ItemMessage = ITEM_MESSAGE_SCENE.instantiate() item_message.remove_theme_stylebox_override("panel") item_message.add_theme_stylebox_override("panel", PAPER_PANEL_STYLE) @@ -30,3 +32,9 @@ func pin_item(item_name: String, timeout_initial_: float, timeout_remaining_: fl item_message.set_round_corner_radius_progress(0) item_message.set_item(item_name, timeout_initial_, timeout_remaining_) + + pinned_items[player_id] = item_message + +func clear_item(player_id: float): + if player_id in pinned_items: + pinned_items[player_id].queue_free() |