aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client/game.gd16
-rw-r--r--client/menu/communicate/chat/chat_message.gd (renamed from client/menu/chat/chat_message.gd)0
-rw-r--r--client/menu/communicate/chat/chat_message.tscn (renamed from client/menu/chat/chat_message.tscn)2
-rw-r--r--client/menu/communicate/chat/chat_open.gd (renamed from client/menu/chat/chat_open.gd)2
-rw-r--r--client/menu/communicate/chat/chat_open.tscn (renamed from client/menu/chat/chat_open.tscn)2
-rw-r--r--client/menu/communicate/chat/chat_preview.gd (renamed from client/menu/chat/chat_preview.gd)2
-rw-r--r--client/menu/communicate/chat/chat_preview.tscn (renamed from client/menu/chat/chat_preview.tscn)2
-rw-r--r--client/menu/communicate/item/item_message.gd65
-rw-r--r--client/menu/communicate/item/item_message.tscn47
-rw-r--r--client/menu/communicate/item/item_render.gd35
-rw-r--r--client/menu/communicate/item/item_render.tscn25
-rw-r--r--client/menu/communicate/popup_message/pinned_item_messages.gd32
-rw-r--r--client/menu/communicate/popup_message/pinned_item_messages.tscn21
-rw-r--r--client/menu/communicate/popup_message/popup_message.gd (renamed from client/menu/popup_message/popup_message.gd)0
-rw-r--r--client/menu/communicate/popup_message/popup_message.tscn (renamed from client/menu/popup_message/popup_message.tscn)4
-rw-r--r--client/menu/communicate/popup_message/server_message.tscn (renamed from client/menu/popup_message/server_message.tscn)12
-rw-r--r--client/menu/game.gd2
-rw-r--r--client/menu/game.tscn10
-rw-r--r--client/menu/theme/paper_panel_style.tres6
-rw-r--r--client/menu/theme/style/item_bubble_progress_style_background.tres5
-rw-r--r--client/multiplayer.gd2
-rw-r--r--client/player/item_bubble.gd33
-rw-r--r--client/player/item_bubble.tscn65
23 files changed, 278 insertions, 112 deletions
diff --git a/client/game.gd b/client/game.gd
index 4a4e3f1f..88535c36 100644
--- a/client/game.gd
+++ b/client/game.gd
@@ -60,6 +60,7 @@ var spectating_mode: SpectatingMode = SpectatingMode.CENTER
@onready var lobby: Lobby = $"../Lobby"
@onready var overlay: Overlay = $"../Overlay"
@onready var popup_message: PopupMessage = $"../PopupMessage"
+@onready var pinned_items: PinnedItemMessages = $"../PinnedItemMessages"
@onready var menu: GameMenu = $".."
@onready var follow_camera: FollowCamera = $FollowCamera
@@ -179,17 +180,24 @@ func handle_packet(p):
map.set_tile(p.tile, tile_names[p.kind], neighbors)
else: map.clear_tile(p.tile)
"communicate":
- var timeout_initial: float = p["timeout"]["initial"] if p["timeout"] != null else 5.
- var timeout_remaining: float = p["timeout"]["remaining"] if p["timeout"] != null else 5.
+ var timeout_initial: float = p.timeout.initial if p.timeout != null else 5.
+ var timeout_remaining: float = p.timeout.remaining if p.timeout != null else 5.
+ var pinned: bool = p.timeout.pinned if p.timeout != null and "pinned" in p.timeout else false
if p.message != null:
if "item" in p.message:
- var player: Player = players[p.player]
var item_name: String = item_names[p.message.item]
var parsed_item := Global.ParsedItem.new(item_name)
var ingredients := [parsed_item.name]
ingredients.append_array(parsed_item.contents)
+
+ if pinned:
+ pinned_items.pin_item(item_name, timeout_initial, timeout_remaining)
+ return
+
+ var player: Player = players[p.player]
player.item_message(item_name, timeout_initial, timeout_remaining)
+ # Maybe start tutorial
if player.is_customer and not Global.get_setting("gameplay.tutorial_disabled"):
var completed_ingredients: Array = Global.get_profile("tutorial_ingredients_played")
var completed := Global.array_has_all(completed_ingredients, ingredients)
@@ -202,6 +210,8 @@ func handle_packet(p):
update_tutorial_running.emit(tutorial_running)
mp.send_chat(player_id, "/start-tutorial %s" % item_name)
elif "text" in p.message:
+ if pinned:
+ push_error("Pinned text messages are currently not supported")
players[p.player].text_message(p.message.text, timeout_initial, timeout_remaining)
var username: String = players[p.player].username
text_message.emit(username, p.message.text, timeout_initial, timeout_remaining)
diff --git a/client/menu/chat/chat_message.gd b/client/menu/communicate/chat/chat_message.gd
index 1cc57102..1cc57102 100644
--- a/client/menu/chat/chat_message.gd
+++ b/client/menu/communicate/chat/chat_message.gd
diff --git a/client/menu/chat/chat_message.tscn b/client/menu/communicate/chat/chat_message.tscn
index c72deb7b..a095c42e 100644
--- a/client/menu/chat/chat_message.tscn
+++ b/client/menu/communicate/chat/chat_message.tscn
@@ -1,6 +1,6 @@
[gd_scene load_steps=4 format=3 uid="uid://bpc2qgsvcafhe"]
-[ext_resource type="Script" path="res://menu/chat/chat_message.gd" id="1_ey0qp"]
+[ext_resource type="Script" path="res://menu/communicate/chat/chat_message.gd" id="1_ey0qp"]
[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme/theme.tres" id="1_rx6vg"]
[sub_resource type="FontVariation" id="FontVariation_jfhbh"]
diff --git a/client/menu/chat/chat_open.gd b/client/menu/communicate/chat/chat_open.gd
index 576568ee..c67a1b1c 100644
--- a/client/menu/chat/chat_open.gd
+++ b/client/menu/communicate/chat/chat_open.gd
@@ -16,7 +16,7 @@
extends Menu
class_name ChatOpen
-const CHAT_MESSAGE_SCENE = preload("res://menu/chat/chat_message.tscn")
+const CHAT_MESSAGE_SCENE = preload("res://menu/communicate/chat/chat_message.tscn")
@onready var messages_container: VBoxContainer = $PanelContainer/MarginContainer/VBoxContainer/ScrollContainerCustom/Messages
@onready var line: LineEdit = $PanelContainer/MarginContainer/VBoxContainer/LineEdit
diff --git a/client/menu/chat/chat_open.tscn b/client/menu/communicate/chat/chat_open.tscn
index 6d03b391..0247a1ca 100644
--- a/client/menu/chat/chat_open.tscn
+++ b/client/menu/communicate/chat/chat_open.tscn
@@ -1,6 +1,6 @@
[gd_scene load_steps=7 format=3 uid="uid://dbd6k56l4p0ls"]
-[ext_resource type="Script" path="res://menu/chat/chat_open.gd" id="1_dsl4a"]
+[ext_resource type="Script" path="res://menu/communicate/chat/chat_open.gd" id="1_dsl4a"]
[ext_resource type="Material" uid="uid://beea1pc5nt67r" path="res://menu/theme/dark_blur_material.tres" id="1_isqmk"]
[ext_resource type="Script" path="res://menu/blur_setup.gd" id="2_urbd2"]
[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme/theme.tres" id="3_v7xmg"]
diff --git a/client/menu/chat/chat_preview.gd b/client/menu/communicate/chat/chat_preview.gd
index 7f8212b5..14713f7e 100644
--- a/client/menu/chat/chat_preview.gd
+++ b/client/menu/communicate/chat/chat_preview.gd
@@ -16,7 +16,7 @@
extends Control
class_name ChatPreview
-const CHAT_MESSAGE_SCENE = preload("res://menu/chat/chat_message.tscn")
+const CHAT_MESSAGE_SCENE = preload("res://menu/communicate/chat/chat_message.tscn")
@onready var game: Game = $"../Game"
@onready var messages_container: VBoxContainer = $MarginContainer/ScrollContainer/PanelContainer/Messages
diff --git a/client/menu/chat/chat_preview.tscn b/client/menu/communicate/chat/chat_preview.tscn
index a50b138a..4cc39e00 100644
--- a/client/menu/chat/chat_preview.tscn
+++ b/client/menu/communicate/chat/chat_preview.tscn
@@ -1,7 +1,7 @@
[gd_scene load_steps=5 format=3 uid="uid://xcxbmynn8mhi"]
[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme/theme.tres" id="1_x8ock"]
-[ext_resource type="Script" path="res://menu/chat/chat_preview.gd" id="2_72x70"]
+[ext_resource type="Script" path="res://menu/communicate/chat/chat_preview.gd" id="2_72x70"]
[ext_resource type="Material" uid="uid://beea1pc5nt67r" path="res://menu/theme/dark_blur_material.tres" id="4_jo1xn"]
[ext_resource type="Script" path="res://menu/blur_setup.gd" id="5_1l77s"]
diff --git a/client/menu/communicate/item/item_message.gd b/client/menu/communicate/item/item_message.gd
new file mode 100644
index 00000000..53e6ff22
--- /dev/null
+++ b/client/menu/communicate/item/item_message.gd
@@ -0,0 +1,65 @@
+# Hurry Curry! - a game about cooking
+# Copyright 2024 nokoe
+# 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/>.
+#
+class_name ItemMessage
+extends Control
+
+var timeout_remaining := 0.
+var timeout_initial := 0.
+
+@onready var item_render: ItemRender = $VBoxContainer/SubViewportContainer/SubViewport/ItemRender
+@onready var progress: ProgressBar = $VBoxContainer/ProgressBar
+@onready var sub_viewport: SubViewport = $VBoxContainer/SubViewportContainer/SubViewport
+@onready var v_box_container: VBoxContainer = $VBoxContainer
+
+#func _init():
+# progress_style = progress_style.duplicate()
+
+func set_subviewport_size(sub_viewport_size: Vector2):
+ sub_viewport.size = sub_viewport_size
+ progress.custom_minimum_size.y = sub_viewport_size.x - sub_viewport_size.y
+ v_box_container.size.y = 0
+
+func set_round_corner_radius_progress(radius: int):
+ var style_bg: StyleBoxFlat = progress.get_theme_stylebox("background")
+ var style_fill: StyleBoxFlat = progress.get_theme_stylebox("fill")
+
+ style_bg.corner_radius_bottom_left = radius
+ style_bg.corner_radius_bottom_right = radius
+ style_fill.corner_radius_bottom_left = radius
+ style_fill.corner_radius_bottom_right = radius
+
+func set_item(item_name: String, timeout_initial_: float, timeout_remaining_: float):
+ item_render.set_item(item_name)
+
+ timeout_remaining = timeout_remaining_
+ timeout_initial = timeout_initial_
+ progress.max_value = timeout_initial
+ progress.value = timeout_remaining
+
+func remove_item():
+ item_render.remove_item()
+
+func _process(delta):
+ if item_render.item != null:
+ timeout_remaining -= delta
+ progress.value = timeout_remaining
+ var x: float = timeout_remaining / timeout_initial
+ var progress_style: StyleBoxFlat = progress.get_theme_stylebox("fill")
+ progress_style.bg_color = Color(min((1-x) * 2, 1), min(x * 2, 1), 0.)
+ if progress_style.corner_radius_bottom_right != 0:
+ progress_style.corner_radius_bottom_right = max(32.-(1.-x)*320, 0)
+ progress.add_theme_stylebox_override("fill", progress_style)
diff --git a/client/menu/communicate/item/item_message.tscn b/client/menu/communicate/item/item_message.tscn
new file mode 100644
index 00000000..c0b0ea95
--- /dev/null
+++ b/client/menu/communicate/item/item_message.tscn
@@ -0,0 +1,47 @@
+[gd_scene load_steps=6 format=3 uid="uid://fkqh36s4vl3p"]
+
+[ext_resource type="Script" path="res://menu/communicate/item/item_message.gd" id="1_76lg0"]
+[ext_resource type="PackedScene" uid="uid://cem5xcld6vn51" path="res://menu/communicate/item/item_render.tscn" id="1_sju7l"]
+[ext_resource type="StyleBox" uid="uid://brw8uogdgx2gf" path="res://menu/theme/style/item_bubble_progress_style.tres" id="3_ipe76"]
+[ext_resource type="StyleBox" uid="uid://cu0his4018e7h" path="res://menu/theme/style/item_bubble_progress_style_background.tres" id="3_t61n3"]
+
+[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_dpele"]
+bg_color = Color(1, 1, 1, 1)
+corner_radius_top_left = 30
+corner_radius_top_right = 30
+corner_radius_bottom_right = 30
+corner_radius_bottom_left = 30
+
+[node name="ItemMessage" type="PanelContainer"]
+auto_translate_mode = 2
+offset_right = 256.0
+offset_bottom = 256.0
+size_flags_vertical = 0
+theme_override_styles/panel = SubResource("StyleBoxFlat_dpele")
+script = ExtResource("1_76lg0")
+
+[node name="VBoxContainer" type="VBoxContainer" parent="."]
+layout_mode = 2
+size_flags_vertical = 0
+theme_override_constants/separation = 0
+
+[node name="SubViewportContainer" type="SubViewportContainer" parent="VBoxContainer"]
+layout_mode = 2
+
+[node name="SubViewport" type="SubViewport" parent="VBoxContainer/SubViewportContainer"]
+own_world_3d = true
+transparent_bg = true
+handle_input_locally = false
+size = Vector2i(256, 224)
+render_target_update_mode = 4
+
+[node name="ItemRender" parent="VBoxContainer/SubViewportContainer/SubViewport" instance=ExtResource("1_sju7l")]
+
+[node name="ProgressBar" type="ProgressBar" parent="VBoxContainer"]
+custom_minimum_size = Vector2(0, 32)
+layout_mode = 2
+theme_override_styles/background = ExtResource("3_t61n3")
+theme_override_styles/fill = ExtResource("3_ipe76")
+step = 0.0
+value = 100.0
+show_percentage = false
diff --git a/client/menu/communicate/item/item_render.gd b/client/menu/communicate/item/item_render.gd
new file mode 100644
index 00000000..cd7d726a
--- /dev/null
+++ b/client/menu/communicate/item/item_render.gd
@@ -0,0 +1,35 @@
+# 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 Node3D
+class_name ItemRender
+
+var item: Item
+
+@onready var base = $ItemBase
+
+func set_item(item_name: String):
+ if item != null:
+ remove_item()
+
+ item = ItemFactory.produce(item_name, base)
+ base.add_child(item)
+
+func remove_item():
+ if item != null:
+ item.queue_free()
+
+func _process(delta: float):
+ base.rotation.y += delta * TAU * .025
diff --git a/client/menu/communicate/item/item_render.tscn b/client/menu/communicate/item/item_render.tscn
new file mode 100644
index 00000000..1309509e
--- /dev/null
+++ b/client/menu/communicate/item/item_render.tscn
@@ -0,0 +1,25 @@
+[gd_scene load_steps=3 format=3 uid="uid://cem5xcld6vn51"]
+
+[ext_resource type="Script" path="res://menu/communicate/item/item_render.gd" id="1_jfi7o"]
+
+[sub_resource type="Environment" id="Environment_iyxrx"]
+ambient_light_source = 2
+ambient_light_color = Color(1, 1, 1, 1)
+ambient_light_energy = 0.5
+
+[node name="ItemRender" type="Node3D"]
+script = ExtResource("1_jfi7o")
+
+[node name="Camera3D" type="Camera3D" parent="."]
+transform = Transform3D(1, 0, 0, 0, 0.939693, 0.34202, 0, -0.34202, 0.939693, 0, 0.5, 1)
+projection = 1
+size = 0.6
+
+[node name="ItemBase" type="Node3D" parent="."]
+
+[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
+transform = Transform3D(1, 0, 0, 0, 0.173648, 0.984808, 0, -0.984808, 0.173648, 0, 0, 0)
+light_energy = 0.5
+
+[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
+environment = SubResource("Environment_iyxrx")
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_)
diff --git a/client/menu/communicate/popup_message/pinned_item_messages.tscn b/client/menu/communicate/popup_message/pinned_item_messages.tscn
new file mode 100644
index 00000000..e53b27c3
--- /dev/null
+++ b/client/menu/communicate/popup_message/pinned_item_messages.tscn
@@ -0,0 +1,21 @@
+[gd_scene load_steps=2 format=3 uid="uid://dcrr1rwdwbkq8"]
+
+[ext_resource type="Script" path="res://menu/communicate/popup_message/pinned_item_messages.gd" id="1_q0jkk"]
+
+[node name="PinnedItemMessages" type="Control"]
+layout_mode = 3
+anchors_preset = 15
+anchor_right = 1.0
+anchor_bottom = 1.0
+grow_horizontal = 2
+grow_vertical = 2
+mouse_filter = 2
+script = ExtResource("1_q0jkk")
+
+[node name="HBoxContainer" type="HBoxContainer" parent="."]
+layout_mode = 1
+anchors_preset = 10
+anchor_right = 1.0
+offset_bottom = 256.0
+grow_horizontal = 2
+mouse_filter = 2
diff --git a/client/menu/popup_message/popup_message.gd b/client/menu/communicate/popup_message/popup_message.gd
index 6c2c2c0e..6c2c2c0e 100644
--- a/client/menu/popup_message/popup_message.gd
+++ b/client/menu/communicate/popup_message/popup_message.gd
diff --git a/client/menu/popup_message/popup_message.tscn b/client/menu/communicate/popup_message/popup_message.tscn
index 659a5b7e..799712e1 100644
--- a/client/menu/popup_message/popup_message.tscn
+++ b/client/menu/communicate/popup_message/popup_message.tscn
@@ -1,9 +1,9 @@
[gd_scene load_steps=12 format=3 uid="uid://b21nrnkygiyjt"]
[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme/theme.tres" id="1_a1566"]
-[ext_resource type="Script" path="res://menu/popup_message/popup_message.gd" id="2_sbew6"]
+[ext_resource type="Script" path="res://menu/communicate/popup_message/popup_message.gd" id="2_sbew6"]
[ext_resource type="Shader" path="res://menu/blur_mix.gdshader" id="3_2vnom"]
-[ext_resource type="PackedScene" uid="uid://dq61p3a8og2b6" path="res://menu/popup_message/server_message.tscn" id="3_m3rok"]
+[ext_resource type="PackedScene" uid="uid://dq61p3a8og2b6" path="res://menu/communicate/popup_message/server_message.tscn" id="3_m3rok"]
[ext_resource type="Script" path="res://menu/blur_setup.gd" id="4_pvwmw"]
[ext_resource type="FontFile" uid="uid://bk704sc5gkrb3" path="res://menu/theme/font-azaret-mono.woff2" id="4_wsrnf"]
[ext_resource type="Texture2D" uid="uid://b2uv5rf0enikf" path="res://menu/hint.svg" id="5_2dxsd"]
diff --git a/client/menu/popup_message/server_message.tscn b/client/menu/communicate/popup_message/server_message.tscn
index b7ad98f4..63160942 100644
--- a/client/menu/popup_message/server_message.tscn
+++ b/client/menu/communicate/popup_message/server_message.tscn
@@ -1,11 +1,11 @@
[gd_scene load_steps=8 format=3 uid="uid://dq61p3a8og2b6"]
-[ext_resource type="Shader" path="res://menu/blur_mix.gdshader" id="1_la056"]
-[ext_resource type="Script" path="res://menu/blur_setup.gd" id="2_uinkj"]
-[ext_resource type="FontFile" uid="uid://bk704sc5gkrb3" path="res://menu/theme/font-azaret-mono.woff2" id="3_7fupk"]
+[ext_resource type="Shader" path="res://menu/blur_mix.gdshader" id="1_qv8ew"]
+[ext_resource type="Script" path="res://menu/blur_setup.gd" id="2_80a6b"]
+[ext_resource type="FontFile" uid="uid://bk704sc5gkrb3" path="res://menu/theme/font-azaret-mono.woff2" id="3_dw20j"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_q3bbd"]
-shader = ExtResource("1_la056")
+shader = ExtResource("1_qv8ew")
shader_parameter/blur_amount = 3.5
shader_parameter/mix_amount = 0.85
shader_parameter/mix_amount_no_blur = 0.85
@@ -20,7 +20,7 @@ corner_radius_bottom_right = 16
corner_radius_bottom_left = 16
[sub_resource type="FontVariation" id="FontVariation_qfltj"]
-base_font = ExtResource("3_7fupk")
+base_font = ExtResource("3_dw20j")
variation_embolden = 0.75
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_3rgop"]
@@ -35,7 +35,7 @@ size_flags_horizontal = 4
size_flags_vertical = 0
mouse_filter = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_vq4dg")
-script = ExtResource("2_uinkj")
+script = ExtResource("2_80a6b")
[node name="CenterContainer" type="CenterContainer" parent="."]
layout_mode = 2
diff --git a/client/menu/game.gd b/client/menu/game.gd
index fb0d2fa9..70f28636 100644
--- a/client/menu/game.gd
+++ b/client/menu/game.gd
@@ -34,7 +34,7 @@ func _input(_event):
if Input.is_action_just_pressed("chat"):
Sound.play_click()
chat_preview.visible = false
- await submenu("res://menu/chat/chat_open.tscn")
+ await submenu("res://menu/communicate/chat/chat_open.tscn")
chat_preview.visible = true
func _menu_cover(state):
diff --git a/client/menu/game.tscn b/client/menu/game.tscn
index 23929591..d3a3b446 100644
--- a/client/menu/game.tscn
+++ b/client/menu/game.tscn
@@ -1,11 +1,12 @@
-[gd_scene load_steps=7 format=3 uid="uid://bbjwoxs71fnsk"]
+[gd_scene load_steps=8 format=3 uid="uid://bbjwoxs71fnsk"]
[ext_resource type="Script" path="res://menu/game.gd" id="1_cdpsh"]
[ext_resource type="PackedScene" uid="uid://c6krh36hoqfg8" path="res://game.tscn" id="2_uojcy"]
[ext_resource type="PackedScene" uid="uid://bpikve6wlsjfl" path="res://menu/overlay.tscn" id="3_i0ytb"]
[ext_resource type="PackedScene" uid="uid://bc50la65ntifb" path="res://menu/lobby.tscn" id="3_udxby"]
-[ext_resource type="PackedScene" uid="uid://b21nrnkygiyjt" path="res://menu/popup_message/popup_message.tscn" id="5_n1wy0"]
-[ext_resource type="PackedScene" uid="uid://xcxbmynn8mhi" path="res://menu/chat/chat_preview.tscn" id="6_dh5lr"]
+[ext_resource type="PackedScene" uid="uid://b21nrnkygiyjt" path="res://menu/communicate/popup_message/popup_message.tscn" id="5_n1wy0"]
+[ext_resource type="PackedScene" uid="uid://xcxbmynn8mhi" path="res://menu/communicate/chat/chat_preview.tscn" id="6_dh5lr"]
+[ext_resource type="PackedScene" uid="uid://dcrr1rwdwbkq8" path="res://menu/communicate/popup_message/pinned_item_messages.tscn" id="7_lf2li"]
[node name="GameMenu" type="Control"]
layout_mode = 3
@@ -40,3 +41,6 @@ layout_mode = 1
[node name="ChatPreview" parent="." instance=ExtResource("6_dh5lr")]
layout_mode = 1
+
+[node name="PinnedItemMessages" parent="." instance=ExtResource("7_lf2li")]
+layout_mode = 1
diff --git a/client/menu/theme/paper_panel_style.tres b/client/menu/theme/paper_panel_style.tres
new file mode 100644
index 00000000..5a8a4a78
--- /dev/null
+++ b/client/menu/theme/paper_panel_style.tres
@@ -0,0 +1,6 @@
+[gd_resource type="StyleBoxTexture" load_steps=2 format=3 uid="uid://bqhs5wtdp2oax"]
+
+[ext_resource type="Texture2D" uid="uid://chxkwohi56cxx" path="res://menu/theme/paper_texture.tres" id="1_u1kqj"]
+
+[resource]
+texture = ExtResource("1_u1kqj")
diff --git a/client/menu/theme/style/item_bubble_progress_style_background.tres b/client/menu/theme/style/item_bubble_progress_style_background.tres
new file mode 100644
index 00000000..02362554
--- /dev/null
+++ b/client/menu/theme/style/item_bubble_progress_style_background.tres
@@ -0,0 +1,5 @@
+[gd_resource type="StyleBoxFlat" format=3 uid="uid://cu0his4018e7h"]
+
+[resource]
+corner_radius_bottom_right = 32
+corner_radius_bottom_left = 32
diff --git a/client/multiplayer.gd b/client/multiplayer.gd
index 58b13ccf..1b56572d 100644
--- a/client/multiplayer.gd
+++ b/client/multiplayer.gd
@@ -22,7 +22,7 @@ signal packet(packet: Dictionary)
signal connection_closed()
static var VERSION_MAJOR: int = 7
-static var VERSION_MINOR: int = 1
+static var VERSION_MINOR: int = 2
var connected := false
var socket := WebSocketPeer.new()
diff --git a/client/player/item_bubble.gd b/client/player/item_bubble.gd
index ac71c27e..9c18bfbb 100644
--- a/client/player/item_bubble.gd
+++ b/client/player/item_bubble.gd
@@ -16,42 +16,17 @@
class_name ItemBubble
extends MeshInstance3D
-@onready var base: Node3D = $SubViewport/ItemMessage/VBoxContainer/SubViewportContainer/SubViewport/ItemBase
-@onready var progress: ProgressBar = $SubViewport/ItemMessage/VBoxContainer/ProgressBar
-
var item: Item
var timeout_remaining := 0.
var timeout_initial := 0.
var progress_style = preload("res://menu/theme/style/item_bubble_progress_style.tres")
-func _init():
- progress_style = progress_style.duplicate()
+@onready var item_message = $SubViewport/ItemMessage
-func set_item(t: String, timeout_initial_: float, timeout_remaining_: float):
- if timeout_remaining_ == 0.:
- remove_item()
- return
-
+func set_item(item_name: String, timeout_initial_: float, timeout_remaining_: float):
visible = true
- item = ItemFactory.produce(t, base)
- base.add_child(item)
-
- timeout_remaining = timeout_remaining_
- timeout_initial = timeout_initial_
- progress.max_value = timeout_initial
- progress.value = timeout_remaining
+ item_message.set_item(item_name, timeout_initial_, timeout_remaining_)
func remove_item():
visible = false
- if item != null:
- item.queue_free()
-
-func _process(delta):
- if visible:
- item.rotation.y += delta * TAU * .05
- timeout_remaining -= delta
- progress.value = timeout_remaining
- var x: float = timeout_remaining / timeout_initial
- progress_style.bg_color = Color(min((1-x) * 2, 1), min(x * 2, 1), 0.)
- progress_style.corner_radius_bottom_right = max(32.-(1.-x)*320, 0)
- progress.add_theme_stylebox_override("fill", progress_style)
+ item_message.remove_item()
diff --git a/client/player/item_bubble.tscn b/client/player/item_bubble.tscn
index 2e340ff3..cba432f2 100644
--- a/client/player/item_bubble.tscn
+++ b/client/player/item_bubble.tscn
@@ -1,7 +1,7 @@
-[gd_scene load_steps=9 format=3 uid="uid://cj777mi5nok6c"]
+[gd_scene load_steps=6 format=3 uid="uid://cj777mi5nok6c"]
[ext_resource type="Script" path="res://player/item_bubble.gd" id="1_84g24"]
-[ext_resource type="StyleBox" uid="uid://brw8uogdgx2gf" path="res://menu/theme/style/item_bubble_progress_style.tres" id="2_5qt7f"]
+[ext_resource type="PackedScene" uid="uid://fkqh36s4vl3p" path="res://menu/communicate/item/item_message.tscn" id="2_hgmra"]
[sub_resource type="QuadMesh" id="QuadMesh_tlsxo"]
@@ -16,22 +16,6 @@ shading_mode = 0
albedo_texture = SubResource("ViewportTexture_mko8a")
billboard_mode = 1
-[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_dpele"]
-bg_color = Color(1, 1, 1, 1)
-corner_radius_top_left = 30
-corner_radius_top_right = 30
-corner_radius_bottom_right = 30
-corner_radius_bottom_left = 30
-
-[sub_resource type="Environment" id="Environment_iyxrx"]
-ambient_light_source = 2
-ambient_light_color = Color(1, 1, 1, 1)
-ambient_light_energy = 0.5
-
-[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ima0t"]
-corner_radius_bottom_right = 32
-corner_radius_bottom_left = 32
-
[node name="ItemBubble" type="MeshInstance3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.5, 0)
visible = false
@@ -44,47 +28,4 @@ disable_3d = true
transparent_bg = true
size = Vector2i(256, 256)
-[node name="ItemMessage" type="PanelContainer" parent="SubViewport"]
-auto_translate_mode = 2
-offset_right = 256.0
-offset_bottom = 256.0
-size_flags_vertical = 3
-theme_override_styles/panel = SubResource("StyleBoxFlat_dpele")
-
-[node name="VBoxContainer" type="VBoxContainer" parent="SubViewport/ItemMessage"]
-layout_mode = 2
-theme_override_constants/separation = 0
-
-[node name="SubViewportContainer" type="SubViewportContainer" parent="SubViewport/ItemMessage/VBoxContainer"]
-layout_mode = 2
-size_flags_vertical = 3
-
-[node name="SubViewport" type="SubViewport" parent="SubViewport/ItemMessage/VBoxContainer/SubViewportContainer"]
-own_world_3d = true
-transparent_bg = true
-handle_input_locally = false
-size = Vector2i(256, 224)
-render_target_update_mode = 4
-
-[node name="Camera3D" type="Camera3D" parent="SubViewport/ItemMessage/VBoxContainer/SubViewportContainer/SubViewport"]
-transform = Transform3D(1, 0, 0, 0, 0.939693, 0.34202, 0, -0.34202, 0.939693, 0, 0.5, 1)
-projection = 1
-size = 0.6
-
-[node name="ItemBase" type="Node3D" parent="SubViewport/ItemMessage/VBoxContainer/SubViewportContainer/SubViewport"]
-
-[node name="DirectionalLight3D" type="DirectionalLight3D" parent="SubViewport/ItemMessage/VBoxContainer/SubViewportContainer/SubViewport"]
-transform = Transform3D(1, 0, 0, 0, 0.173648, 0.984808, 0, -0.984808, 0.173648, 0, 0, 0)
-light_energy = 0.5
-
-[node name="WorldEnvironment" type="WorldEnvironment" parent="SubViewport/ItemMessage/VBoxContainer/SubViewportContainer/SubViewport"]
-environment = SubResource("Environment_iyxrx")
-
-[node name="ProgressBar" type="ProgressBar" parent="SubViewport/ItemMessage/VBoxContainer"]
-custom_minimum_size = Vector2(0, 32)
-layout_mode = 2
-theme_override_styles/background = SubResource("StyleBoxFlat_ima0t")
-theme_override_styles/fill = ExtResource("2_5qt7f")
-step = 0.0
-value = 100.0
-show_percentage = false
+[node name="ItemMessage" parent="SubViewport" instance=ExtResource("2_hgmra")]