aboutsummaryrefslogtreecommitdiff
path: root/client/menu/communicate/popup_message/pinned_item_messages.gd
diff options
context:
space:
mode:
Diffstat (limited to 'client/menu/communicate/popup_message/pinned_item_messages.gd')
-rw-r--r--client/menu/communicate/popup_message/pinned_item_messages.gd32
1 files changed, 32 insertions, 0 deletions
diff --git a/client/menu/communicate/popup_message/pinned_item_messages.gd b/client/menu/communicate/popup_message/pinned_item_messages.gd
new file mode 100644
index 00000000..7343865c
--- /dev/null
+++ b/client/menu/communicate/popup_message/pinned_item_messages.gd
@@ -0,0 +1,32 @@
+# Hurry Curry! - a game about cooking
+# Copyright 2024 tpart
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, version 3 of the License only.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+#
+extends Control
+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")
+
+@onready var pinned_items_container: HBoxContainer = $HBoxContainer
+
+func pin_item(item_name: String, timeout_initial_: float, timeout_remaining_: 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)
+ pinned_items_container.add_child(item_message)
+ item_message.set_subviewport_size(Vector2(96, 84))
+ item_message.set_round_corner_radius_progress(0)
+
+ item_message.set_item(item_name, timeout_initial_, timeout_remaining_)