diff options
Diffstat (limited to 'client/menu/communicate')
24 files changed, 0 insertions, 971 deletions
diff --git a/client/menu/communicate/chat/chat_message.gd b/client/menu/communicate/chat/chat_message.gd deleted file mode 100644 index ce3dd0ca..00000000 --- a/client/menu/communicate/chat/chat_message.gd +++ /dev/null @@ -1,32 +0,0 @@ -# Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors -# -# 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 VBoxContainer -class_name ChatMessage - -@onready var fade_away_timer: Timer = $FadeAway -@onready var sender_label: Label = $Sender -@onready var message_label: Label = $MarginContainer/Message - -func set_message(username: String, message: String, username_color: Color, fade_away: bool = false, fade_time: float = 5.): - sender_label.text = "<%s>" % username - message_label.text = message - sender_label.add_theme_color_override("font_color", username_color.lightened(.5)) - - if fade_away: - fade_away_timer.start(fade_time) - -func _on_fade_away_timeout() -> void: - queue_free() diff --git a/client/menu/communicate/chat/chat_message.gd.uid b/client/menu/communicate/chat/chat_message.gd.uid deleted file mode 100644 index f1c4ff05..00000000 --- a/client/menu/communicate/chat/chat_message.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://6rprqelfdp3 diff --git a/client/menu/communicate/chat/chat_message.tscn b/client/menu/communicate/chat/chat_message.tscn deleted file mode 100644 index 43930670..00000000 --- a/client/menu/communicate/chat/chat_message.tscn +++ /dev/null @@ -1,37 +0,0 @@ -[gd_scene load_steps=4 format=3 uid="uid://bpc2qgsvcafhe"] - -[ext_resource type="Script" uid="uid://6rprqelfdp3" path="res://menu/communicate/chat/chat_message.gd" id="1_ey0qp"] -[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme/theme/theme.tres" id="1_rx6vg"] - -[sub_resource type="FontVariation" id="FontVariation_jfhbh"] -variation_embolden = 1.3 - -[node name="ChatMessage" type="VBoxContainer"] -offset_right = 72.0 -offset_bottom = 192.0 -theme = ExtResource("1_rx6vg") -script = ExtResource("1_ey0qp") - -[node name="Sender" type="Label" parent="."] -layout_mode = 2 -theme_override_fonts/font = SubResource("FontVariation_jfhbh") -text = "<Name>" - -[node name="FadeAway" type="Timer" parent="."] -one_shot = true - -[node name="MarginContainer" type="MarginContainer" parent="."] -layout_mode = 2 -theme_override_constants/margin_left = 10 -theme_override_constants/margin_top = 0 -theme_override_constants/margin_right = 0 -theme_override_constants/margin_bottom = 5 - -[node name="Message" type="Label" parent="MarginContainer"] -layout_mode = 2 -size_flags_horizontal = 3 -text = "Message" -vertical_alignment = 1 -autowrap_mode = 3 - -[connection signal="timeout" from="FadeAway" to="." method="_on_fade_away_timeout"] diff --git a/client/menu/communicate/chat/chat_open.gd b/client/menu/communicate/chat/chat_open.gd deleted file mode 100644 index 150b0e7e..00000000 --- a/client/menu/communicate/chat/chat_open.gd +++ /dev/null @@ -1,48 +0,0 @@ -# Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors -# -# 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 Menu -class_name ChatOpen - -const CHAT_MESSAGE_SCENE = preload("res://menu/communicate/chat/chat_message.tscn") - -@onready var messages_container: VBoxContainer = $PanelContainer/MarginContainer/VBoxContainer/ScrollContainerCustom/Messages -@onready var scroll_container: ScrollContainerCustom = $PanelContainer/MarginContainer/VBoxContainer/ScrollContainerCustom -@onready var line: LineEdit = $PanelContainer/MarginContainer/VBoxContainer/LineEdit -@onready var game_menu: GameMenu = get_parent() -@onready var game: Game = game_menu.game - -func _ready() -> void: - super() - for i in game.text_message_history: - add_message(i) - - game.text_message.connect( - func message(m: Game.TextMessage): - add_message(m) - ) - -func _input(event: InputEvent) -> void: - if Input.is_action_just_pressed("chat"): - if line.text != "": - game.mp.send_chat(game.my_player_id, line.text) - exit() - super(event) - -func add_message(message: Game.TextMessage): - var chat_message: ChatMessage = CHAT_MESSAGE_SCENE.instantiate() - messages_container.add_child(chat_message) - chat_message.set_message(message.username, message.text, message.color) - scroll_container.call_deferred("scroll_to_bottom") diff --git a/client/menu/communicate/chat/chat_open.gd.uid b/client/menu/communicate/chat/chat_open.gd.uid deleted file mode 100644 index 672792c0..00000000 --- a/client/menu/communicate/chat/chat_open.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://cfweimyoq5vv0 diff --git a/client/menu/communicate/chat/chat_open.tscn b/client/menu/communicate/chat/chat_open.tscn deleted file mode 100644 index f161f210..00000000 --- a/client/menu/communicate/chat/chat_open.tscn +++ /dev/null @@ -1,55 +0,0 @@ -[gd_scene load_steps=7 format=3 uid="uid://dbd6k56l4p0ls"] - -[ext_resource type="Script" uid="uid://cfweimyoq5vv0" path="res://menu/communicate/chat/chat_open.gd" id="1_dsl4a"] -[ext_resource type="Material" uid="uid://beea1pc5nt67r" path="res://menu/theme/materials/dark_blur_material.tres" id="1_isqmk"] -[ext_resource type="Script" uid="uid://cmncjc06kadpe" path="res://menu/auto_setup/blur_setup.gd" id="2_urbd2"] -[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme/theme/theme.tres" id="3_v7xmg"] -[ext_resource type="StyleBox" uid="uid://bw4jamyna1top" path="res://menu/theme/style/panel_style_sidebar.tres" id="4_ew1yx"] -[ext_resource type="Script" uid="uid://bd7bylb2t2m0" path="res://menu/auto_setup/scroll_container_custom.gd" id="5_3mths"] - -[node name="ChatOpen" type="Control"] -layout_mode = 3 -anchors_preset = 9 -anchor_bottom = 1.0 -offset_right = 296.0 -grow_vertical = 2 -script = ExtResource("1_dsl4a") -support_anim = false - -[node name="PanelContainer" type="PanelContainer" parent="."] -material = ExtResource("1_isqmk") -layout_mode = 1 -anchors_preset = 9 -anchor_bottom = 1.0 -offset_right = 296.0 -grow_vertical = 2 -theme = ExtResource("3_v7xmg") -theme_override_styles/panel = ExtResource("4_ew1yx") -script = ExtResource("2_urbd2") - -[node name="MarginContainer" type="MarginContainer" parent="PanelContainer"] -layout_mode = 2 - -[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/MarginContainer"] -layout_mode = 2 -size_flags_horizontal = 3 -size_flags_vertical = 3 -theme_override_constants/separation = 0 - -[node name="ScrollContainerCustom" type="ScrollContainer" parent="PanelContainer/MarginContainer/VBoxContainer"] -material = ExtResource("1_isqmk") -layout_mode = 2 -size_flags_horizontal = 3 -size_flags_vertical = 3 -script = ExtResource("5_3mths") -auto_scroll_to_bottom = true - -[node name="Messages" type="VBoxContainer" parent="PanelContainer/MarginContainer/VBoxContainer/ScrollContainerCustom"] -layout_mode = 2 -size_flags_horizontal = 3 -size_flags_vertical = 3 - -[node name="LineEdit" type="LineEdit" parent="PanelContainer/MarginContainer/VBoxContainer" groups=["autoselect"]] -layout_mode = 2 -placeholder_text = "c.chat.write_message" -keep_editing_on_text_submit = true diff --git a/client/menu/communicate/chat/chat_preview.gd b/client/menu/communicate/chat/chat_preview.gd deleted file mode 100644 index e41c0b15..00000000 --- a/client/menu/communicate/chat/chat_preview.gd +++ /dev/null @@ -1,34 +0,0 @@ -# Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors -# -# 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 ChatPreview - -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 - -func _ready(): - game.text_message.connect(func(message: Game.TextMessage): - var chat_message: ChatMessage = CHAT_MESSAGE_SCENE.instantiate() - messages_container.add_child(chat_message) - chat_message.set_message( - message.username, - message.text, - message.color, - true, - message.timeout_remaining) - ) diff --git a/client/menu/communicate/chat/chat_preview.gd.uid b/client/menu/communicate/chat/chat_preview.gd.uid deleted file mode 100644 index 7a372630..00000000 --- a/client/menu/communicate/chat/chat_preview.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://bgt04y4ncl1fv diff --git a/client/menu/communicate/chat/chat_preview.tscn b/client/menu/communicate/chat/chat_preview.tscn deleted file mode 100644 index bd3c8ffa..00000000 --- a/client/menu/communicate/chat/chat_preview.tscn +++ /dev/null @@ -1,39 +0,0 @@ -[gd_scene load_steps=5 format=3 uid="uid://xcxbmynn8mhi"] - -[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme/theme/theme.tres" id="1_x8ock"] -[ext_resource type="Script" uid="uid://bgt04y4ncl1fv" path="res://menu/communicate/chat/chat_preview.gd" id="2_72x70"] -[ext_resource type="Material" uid="uid://beea1pc5nt67r" path="res://menu/theme/materials/dark_blur_material.tres" id="4_jo1xn"] -[ext_resource type="Script" uid="uid://cmncjc06kadpe" path="res://menu/auto_setup/blur_setup.gd" id="5_1l77s"] - -[node name="ChatPreview" 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 -theme = ExtResource("1_x8ock") -script = ExtResource("2_72x70") - -[node name="MarginContainer" type="MarginContainer" parent="."] -layout_mode = 2 -anchor_bottom = 1.0 -offset_right = 296.0 -grow_vertical = 2 - -[node name="ScrollContainer" type="ScrollContainer" parent="MarginContainer"] -layout_mode = 2 -horizontal_scroll_mode = 0 - -[node name="PanelContainer" type="PanelContainer" parent="MarginContainer/ScrollContainer"] -material = ExtResource("4_jo1xn") -layout_mode = 2 -size_flags_horizontal = 3 -size_flags_vertical = 0 -mouse_filter = 2 -script = ExtResource("5_1l77s") - -[node name="Messages" type="VBoxContainer" parent="MarginContainer/ScrollContainer/PanelContainer"] -layout_mode = 2 -mouse_filter = 2 diff --git a/client/menu/communicate/item/item_message.gd b/client/menu/communicate/item/item_message.gd deleted file mode 100644 index 77429f7b..00000000 --- a/client/menu/communicate/item/item_message.gd +++ /dev/null @@ -1,71 +0,0 @@ -# Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors -# -# 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 - -const PRINTED_MAT := preload("res://menu/theme/materials/printed_material.tres") - -@export var enable_rotation := true -@export var enable_grayscale := false - -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 sub_viewport_container: SubViewportContainer = $VBoxContainer/SubViewportContainer -@onready var v_box_container: VBoxContainer = $VBoxContainer - -func _ready() -> void: - Global.configure_viewport_aa(sub_viewport, Global.get_setting("graphics.aa")) - - if enable_grayscale: - sub_viewport_container.material = PRINTED_MAT - -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, enable_rotation) - - 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 and !Global.game_paused: - 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.) - progress.add_theme_stylebox_override("fill", progress_style) diff --git a/client/menu/communicate/item/item_message.gd.uid b/client/menu/communicate/item/item_message.gd.uid deleted file mode 100644 index d2600c43..00000000 --- a/client/menu/communicate/item/item_message.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://boheclidwdafn diff --git a/client/menu/communicate/item/item_message.tscn b/client/menu/communicate/item/item_message.tscn deleted file mode 100644 index 9178afab..00000000 --- a/client/menu/communicate/item/item_message.tscn +++ /dev/null @@ -1,48 +0,0 @@ -[gd_scene load_steps=6 format=3 uid="uid://fkqh36s4vl3p"] - -[ext_resource type="Script" uid="uid://boheclidwdafn" 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 -clip_children = 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 deleted file mode 100644 index 71a5eb7c..00000000 --- a/client/menu/communicate/item/item_render.gd +++ /dev/null @@ -1,41 +0,0 @@ -# Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors -# -# 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 -var do_rotate: bool - -var base := Node3D.new() - -func _ready() -> void: - add_child(base) - -func set_item(item_name: String, enable_rotation := true): - if item != null: - remove_item() - - item = ItemFactory.produce(item_name, base) - do_rotate = enable_rotation - base.add_child(item) - -func remove_item(): - if item != null: - item.queue_free() - -func _process(delta: float): - if do_rotate: - base.rotation.y += delta * TAU * .025 diff --git a/client/menu/communicate/item/item_render.gd.uid b/client/menu/communicate/item/item_render.gd.uid deleted file mode 100644 index 745b21ce..00000000 --- a/client/menu/communicate/item/item_render.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://bt7773og3p557 diff --git a/client/menu/communicate/item/item_render.tscn b/client/menu/communicate/item/item_render.tscn deleted file mode 100644 index 5beb8563..00000000 --- a/client/menu/communicate/item/item_render.tscn +++ /dev/null @@ -1,23 +0,0 @@ -[gd_scene load_steps=3 format=3 uid="uid://cem5xcld6vn51"] - -[ext_resource type="Script" uid="uid://bt7773og3p557" 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="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 deleted file mode 100644 index fdbe015c..00000000 --- a/client/menu/communicate/popup_message/pinned_item_messages.gd +++ /dev/null @@ -1,55 +0,0 @@ -# Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors -# -# 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/style/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, player_id: float): - var item_message: ItemMessage = ITEM_MESSAGE_SCENE.instantiate() - item_message.remove_theme_stylebox_override("panel") - item_message.enable_rotation = false - item_message.enable_grayscale = true - 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_) - pinned_items[player_id] = item_message - sort_pins() - -func clear_item(player_id: float): - if player_id in pinned_items: - if is_instance_valid(pinned_items[player_id]): - pinned_items[player_id].queue_free() - -func sort_pins(): - var sorted_nodes := pinned_items_container.get_children() - - sorted_nodes.sort_custom( - func(a: Node, b: Node): return a.timeout_remaining < b.timeout_remaining - ) - - for node in pinned_items_container.get_children(): - pinned_items_container.remove_child(node) - - for node in sorted_nodes: - pinned_items_container.add_child(node) diff --git a/client/menu/communicate/popup_message/pinned_item_messages.gd.uid b/client/menu/communicate/popup_message/pinned_item_messages.gd.uid deleted file mode 100644 index 2325c656..00000000 --- a/client/menu/communicate/popup_message/pinned_item_messages.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://c0k6f1wkynbkd diff --git a/client/menu/communicate/popup_message/pinned_item_messages.tscn b/client/menu/communicate/popup_message/pinned_item_messages.tscn deleted file mode 100644 index 6d771853..00000000 --- a/client/menu/communicate/popup_message/pinned_item_messages.tscn +++ /dev/null @@ -1,22 +0,0 @@ -[gd_scene load_steps=2 format=3 uid="uid://dcrr1rwdwbkq8"] - -[ext_resource type="Script" uid="uid://c0k6f1wkynbkd" 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_direction = 2 -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/communicate/popup_message/popup_message.gd b/client/menu/communicate/popup_message/popup_message.gd deleted file mode 100644 index 7cefcdd9..00000000 --- a/client/menu/communicate/popup_message/popup_message.gd +++ /dev/null @@ -1,230 +0,0 @@ -# Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors -# -# 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 PopupMessage - -const SERVER_MESSAGE_SCENE = preload("res://menu/communicate/popup_message/server_message.tscn") - -var is_ingame := false -var is_joined := false - -var positional_messages = {} - -@onready var positional_messages_node: Control = $Positional -@onready var server_msg = $Static/VBox/ServerMessage -@onready var hint_msg = $Static/VBox/HintMessage - -@onready var server_msg_label: Label = $Static/VBox/ServerMessage/CenterContainer/Label -@onready var hint_msg_label: Label = $Static/VBox/HintMessage/CenterContainer/Label - -@onready var auto_hint_timers: Node = $Timers/AutoHints -@onready var server_msg_timer: Timer = $Timers/Server -@onready var hint_msg_timer: Timer = $Timers/Hint -@onready var reset_timer = $Timers/Reset -@onready var join_while_running_timer = $Timers/JoinWhileRunning - -@onready var game: Game = $"../Game" - -func _ready(): - game.join_state_updated.connect(func(state: Game.JoinState): - is_joined = state == Game.JoinState.JOINED - ) - game.update_tutorial_running.connect( - func a(running: bool): - if running: - stop_game_hints() - else: - update_state() - ) - game.in_lobby_updated.connect( - func a(in_lobby): - is_ingame = not in_lobby - update_state() - ) - -func _process(_delta: float): - for pos: Vector2 in positional_messages.keys(): - var msg: PositionalMessage = positional_messages[pos] - var pos_3d = Vector3(pos.x + 0.5, 1.5, pos.y + 0.5) - var pos_2d = get_viewport().get_camera_3d().unproject_position(pos_3d) - - msg.node_2d.position = pos_2d.clamp( - Vector2.ZERO + 0.5 * msg.node.size, - Vector2(get_viewport_rect().size) - 0.5 * msg.node.size - ) - - if msg.node.size != msg.last_size: - msg.last_size = msg.node.size - msg.node.position = -0.5 * msg.last_size - -func update_state(): - if is_ingame and is_joined: - start_game_hints() - elif is_ingame: - stop_game_hints() - join_while_running_timer.start() - else: - stop_game_hints() - -func display_server_msg(msg: String, auto_remove := true): - server_msg.show() - server_msg_label.text = msg - - if auto_remove: - server_msg_timer.start() - -func _on_server_timeout() -> void: - clear_server_msg() - -func display_server_msg_positional(text: String, pos: Vector2, use_monospace: bool): - var msg := PositionalMessage.new() - msg.node = SERVER_MESSAGE_SCENE.instantiate() - msg.node_2d = Node2D.new() - positional_messages_node.add_child(msg.node_2d) - msg.node_2d.add_child(msg.node) - msg.node.set_text(text, use_monospace) - msg.node.size = Vector2.ZERO - msg.position = pos - positional_messages[pos] = msg - -func clear_server_msg(position_ = null): - if position_ == null: - server_msg_timer.stop() - server_msg.hide() - else: - if position_ in positional_messages: - var msg: PositionalMessage = positional_messages[position_] - msg.node_2d.queue_free() - positional_messages.erase(position_) - -func display_hint_msg(msg: String): - hint_msg.show() - hint_msg_label.text = msg - hint_msg_timer.start() - -func _on_hint_timer_timeout(): - hint_msg.hide() - -func start_game_hints(): - for c: Timer in auto_hint_timers.get_children(): - c.start() - -func stop_game_hints(): - _on_hint_timer_timeout() - for c: Timer in auto_hint_timers.get_children(): - c.stop() - reset_timer.stop() - join_while_running_timer.stop() - -func _input(_event): - if Input.is_action_just_pressed("boost"): - Global.set_hint("has_boosted", true) - if any_action_just_pressed(["forwards", "backwards", "left", "right"]): - Global.set_hint("has_moved", true) - if any_action_just_pressed(["rotate_left", "rotate_right", "rotate_up", "rotate_down"]): - if not Global.get_hint("has_reset"): - reset_timer.start() - Global.set_hint("has_rotated", true) - if any_action_just_pressed(["zoom_in", "zoom_out"]): - Global.set_hint("has_zoomed", true) - if Input.is_action_just_pressed("interact_left") or Input.is_action_just_pressed("interact_right"): - Global.set_hint("has_interacted", true) - if Input.is_action_just_pressed("reset"): - Global.set_hint("has_reset", true) - -func _on_boost_timeout(): - if not Global.get_hint("has_boosted") and not Global.using_touch: - display_hint_msg(tr("c.hint.boost").format([display_keybind("boost")])) - -func _on_move_timeout(): - if not Global.get_hint("has_moved") and not Global.using_touch: - display_hint_msg(tr("c.hint.movement").format([", ".join( - [ - display_keybind("forwards"), - display_keybind("left"), - display_keybind("backwards"), - display_keybind("right") - ] - )])) - -func _on_interact_timeout(): - if not Global.get_hint("has_interacted") and not Global.using_touch: - display_hint_msg(tr("c.hint.interact").format([display_keybind("interact")])) - -func _on_reset_timeout(): - if not Global.get_hint("has_reset") and not Global.using_touch: - display_hint_msg(tr("c.hint.reset_camera").format([display_keybind("reset")])) - -func _on_zoom_timeout(): - if not Global.get_hint("has_zoomed") and not Global.using_touch: - display_hint_msg(tr("c.hint.zoom_camera").format([", ".join( - [ - display_keybind("zoom_in"), - display_keybind("zoom_out") - ] - )])) - -func display_keybind(action_name: String) -> String: - var events := InputManager.get_events(action_name) - - if events.size() == 0: - # There are no events which match the action - return tr("c.settings.input.unknown_event") - - for event: InputEvent in events: - # Try to find event which matches input method - var type := InputManager.get_event_type(event) - if Global.using_joypad and type != InputManager.EventType.JOYPAD: - continue - if Global.using_touch and type != InputManager.EventType.TOUCH: - continue - return InputManager.display_input_event(event) - - # No matching event found. Just show any event. - return InputManager.display_input_event(events[0]) - -func any_action_just_pressed(actions: Array) -> bool: - for a: String in actions: - if Input.is_action_just_pressed(a): - return true - return false - -func _on_rotate_camera_timeout(): - if not Global.get_hint("has_rotated") and not Global.using_touch: - display_hint_msg(tr("c.hint.rotate").format([", ".join( - [ - display_keybind("rotate_up"), - display_keybind("rotate_left"), - display_keybind("rotate_down"), - display_keybind("rotate_right") - ] - )])) - -func _on_join_while_running_timeout(): - if not game.join_state == Game.JoinState.JOINED and not Global.get_hint("has_seen_join_while_running"): - Global.set_hint("has_seen_join_while_running", true) - display_hint_msg(tr("c.hint.join_while_running").format([display_keybind("menu")])) - -func _on_performance_timeout() -> void: - if not Global.get_hint("has_seen_performance") and Engine.get_frames_per_second() < DisplayServer.screen_get_refresh_rate() * 0.75: - Global.set_hint("has_seen_performance", true) - display_hint_msg(tr("c.hint.framerate_low")) - -class PositionalMessage: - var node: ServerMessage - var node_2d: Node2D - var position: Vector2 - var last_size: Vector2 diff --git a/client/menu/communicate/popup_message/popup_message.gd.uid b/client/menu/communicate/popup_message/popup_message.gd.uid deleted file mode 100644 index d9aa95c5..00000000 --- a/client/menu/communicate/popup_message/popup_message.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://c2cx41lrgf5b0 diff --git a/client/menu/communicate/popup_message/popup_message.tscn b/client/menu/communicate/popup_message/popup_message.tscn deleted file mode 100644 index 4ca5b3c5..00000000 --- a/client/menu/communicate/popup_message/popup_message.tscn +++ /dev/null @@ -1,164 +0,0 @@ -[gd_scene load_steps=12 format=3 uid="uid://b21nrnkygiyjt"] - -[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme/theme/theme.tres" id="1_a1566"] -[ext_resource type="Script" uid="uid://c2cx41lrgf5b0" path="res://menu/communicate/popup_message/popup_message.gd" id="2_sbew6"] -[ext_resource type="Shader" uid="uid://cwldxegcj55if" path="res://menu/theme/shaders/blur_mix.gdshader" id="3_2vnom"] -[ext_resource type="PackedScene" uid="uid://dq61p3a8og2b6" path="res://menu/communicate/popup_message/server_message.tscn" id="3_m3rok"] -[ext_resource type="Script" uid="uid://cmncjc06kadpe" path="res://menu/auto_setup/blur_setup.gd" id="4_pvwmw"] -[ext_resource type="FontFile" uid="uid://bk704sc5gkrb3" path="res://menu/theme/fonts/font-azaret-mono.woff2" id="4_wsrnf"] -[ext_resource type="Texture2D" uid="uid://b2uv5rf0enikf" path="res://menu/icons/hint.svg" id="5_2dxsd"] - -[sub_resource type="ShaderMaterial" id="ShaderMaterial_k0m35"] -shader = ExtResource("3_2vnom") -shader_parameter/blur_amount = 3.5 -shader_parameter/mix_amount = 0.85 -shader_parameter/mix_amount_no_blur = 1.0 -shader_parameter/color_over = Color(0, 0, 0, 1) -shader_parameter/enable_blur = false - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_vq4dg"] -bg_color = Color(1, 1, 1, 0.878431) -corner_radius_top_left = 16 -corner_radius_top_right = 16 -corner_radius_bottom_right = 16 -corner_radius_bottom_left = 16 - -[sub_resource type="FontVariation" id="FontVariation_qfltj"] -base_font = ExtResource("4_wsrnf") -variation_embolden = 0.75 - -[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_3rgop"] -content_margin_left = 32.0 -content_margin_top = 8.0 -content_margin_right = 32.0 -content_margin_bottom = 8.0 - -[node name="PopupMessage" 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("2_sbew6") - -[node name="Static" type="MarginContainer" parent="."] -layout_mode = 1 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -mouse_filter = 2 -theme = ExtResource("1_a1566") - -[node name="VBox" type="VBoxContainer" parent="Static"] -layout_mode = 2 -mouse_filter = 2 - -[node name="ServerMessage" parent="Static/VBox" instance=ExtResource("3_m3rok")] -visible = false -layout_mode = 2 - -[node name="HintMessage" type="PanelContainer" parent="Static/VBox"] -visible = false -material = SubResource("ShaderMaterial_k0m35") -layout_mode = 2 -size_flags_vertical = 0 -mouse_filter = 2 -theme_override_styles/panel = SubResource("StyleBoxFlat_vq4dg") -script = ExtResource("4_pvwmw") - -[node name="CenterContainer" type="HBoxContainer" parent="Static/VBox/HintMessage"] -layout_mode = 2 -mouse_filter = 2 -alignment = 1 - -[node name="MarginContainer" type="MarginContainer" parent="Static/VBox/HintMessage/CenterContainer"] -layout_mode = 2 -mouse_filter = 2 -theme_override_constants/margin_left = 4 -theme_override_constants/margin_top = 4 -theme_override_constants/margin_right = 4 -theme_override_constants/margin_bottom = 4 - -[node name="TextureRect" type="TextureRect" parent="Static/VBox/HintMessage/CenterContainer/MarginContainer"] -custom_minimum_size = Vector2(28, 28) -layout_mode = 2 -mouse_filter = 2 -texture = ExtResource("5_2dxsd") -expand_mode = 1 -stretch_mode = 4 - -[node name="Label" type="Label" parent="Static/VBox/HintMessage/CenterContainer"] -layout_mode = 2 -size_flags_horizontal = 3 -theme_override_fonts/font = SubResource("FontVariation_qfltj") -theme_override_styles/normal = SubResource("StyleBoxEmpty_3rgop") -text = "A hint is worth more than a thousand manuals" -autowrap_mode = 3 - -[node name="Positional" type="Control" parent="."] -layout_mode = 1 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -mouse_filter = 2 - -[node name="Timers" type="Node" parent="."] - -[node name="Server" type="Timer" parent="Timers"] -wait_time = 5.0 -one_shot = true - -[node name="Hint" type="Timer" parent="Timers"] -wait_time = 10.0 -one_shot = true - -[node name="AutoHints" type="Node" parent="Timers"] - -[node name="Move" type="Timer" parent="Timers/AutoHints"] -wait_time = 2.0 -one_shot = true - -[node name="Performance" type="Timer" parent="Timers/AutoHints"] -wait_time = 20.0 -one_shot = true - -[node name="Boost" type="Timer" parent="Timers/AutoHints"] -wait_time = 90.0 -one_shot = true - -[node name="Interact" type="Timer" parent="Timers/AutoHints"] -wait_time = 15.0 -one_shot = true - -[node name="RotateCamera" type="Timer" parent="Timers/AutoHints"] -wait_time = 120.0 -one_shot = true - -[node name="Zoom" type="Timer" parent="Timers/AutoHints"] -wait_time = 135.0 -one_shot = true - -[node name="Reset" type="Timer" parent="Timers"] -wait_time = 10.0 -one_shot = true - -[node name="JoinWhileRunning" type="Timer" parent="Timers"] -wait_time = 5.0 -one_shot = true - -[connection signal="timeout" from="Timers/Server" to="." method="_on_server_timeout"] -[connection signal="timeout" from="Timers/Hint" to="Static" method="_on_hint_timer_timeout"] -[connection signal="timeout" from="Timers/AutoHints/Move" to="Static" method="_on_move_timeout"] -[connection signal="timeout" from="Timers/AutoHints/Performance" to="Static" method="_on_performance_timeout"] -[connection signal="timeout" from="Timers/AutoHints/Boost" to="Static" method="_on_boost_timeout"] -[connection signal="timeout" from="Timers/AutoHints/Interact" to="Static" method="_on_interact_timeout"] -[connection signal="timeout" from="Timers/AutoHints/RotateCamera" to="Static" method="_on_rotate_camera_timeout"] -[connection signal="timeout" from="Timers/AutoHints/Zoom" to="Static" method="_on_zoom_timeout"] -[connection signal="timeout" from="Timers/Reset" to="Static" method="_on_reset_timeout"] -[connection signal="timeout" from="Timers/JoinWhileRunning" to="Static" method="_on_join_while_running_timeout"] diff --git a/client/menu/communicate/popup_message/server_message.gd b/client/menu/communicate/popup_message/server_message.gd deleted file mode 100644 index c3fc0a78..00000000 --- a/client/menu/communicate/popup_message/server_message.gd +++ /dev/null @@ -1,13 +0,0 @@ -extends BlurSetup -class_name ServerMessage - -const DEFAULT_FONT = preload("res://menu/theme/fonts/font-josefin-sans.woff2") -const MONOSPACE_FONT = preload("res://menu/theme/fonts/font-azaret-mono.woff2") - -@onready var label: Label = $CenterContainer/Label - -func set_text(text: String, use_monospace := true): - label.text = text - var font: FontVariation = label.get_theme_font("font") - font.base_font = MONOSPACE_FONT if use_monospace else DEFAULT_FONT - label.add_theme_font_size_override("font_size", 16 if use_monospace else 20) diff --git a/client/menu/communicate/popup_message/server_message.gd.uid b/client/menu/communicate/popup_message/server_message.gd.uid deleted file mode 100644 index 775979e0..00000000 --- a/client/menu/communicate/popup_message/server_message.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://dfgwh7x7sqc21 diff --git a/client/menu/communicate/popup_message/server_message.tscn b/client/menu/communicate/popup_message/server_message.tscn deleted file mode 100644 index 296970b4..00000000 --- a/client/menu/communicate/popup_message/server_message.tscn +++ /dev/null @@ -1,51 +0,0 @@ -[gd_scene load_steps=8 format=3 uid="uid://dq61p3a8og2b6"] - -[ext_resource type="Shader" uid="uid://cwldxegcj55if" path="res://menu/theme/shaders/blur_mix.gdshader" id="1_qv8ew"] -[ext_resource type="Script" uid="uid://dfgwh7x7sqc21" path="res://menu/communicate/popup_message/server_message.gd" id="2_csqo8"] -[ext_resource type="FontFile" uid="uid://bk704sc5gkrb3" path="res://menu/theme/fonts/font-azaret-mono.woff2" id="3_dw20j"] - -[sub_resource type="ShaderMaterial" id="ShaderMaterial_q3bbd"] -shader = ExtResource("1_qv8ew") -shader_parameter/blur_amount = 3.5 -shader_parameter/mix_amount = 0.85 -shader_parameter/mix_amount_no_blur = 0.85 -shader_parameter/color_over = Color(1, 1, 1, 1) -shader_parameter/enable_blur = true - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_vq4dg"] -bg_color = Color(1, 1, 1, 0.878431) -corner_radius_top_left = 16 -corner_radius_top_right = 16 -corner_radius_bottom_right = 16 -corner_radius_bottom_left = 16 - -[sub_resource type="FontVariation" id="FontVariation_qfltj"] -resource_local_to_scene = true -base_font = ExtResource("3_dw20j") -variation_embolden = 0.75 - -[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_3rgop"] -content_margin_left = 32.0 -content_margin_top = 8.0 -content_margin_right = 32.0 -content_margin_bottom = 8.0 - -[node name="ServerMessage" type="PanelContainer"] -material = SubResource("ShaderMaterial_q3bbd") -size_flags_horizontal = 4 -size_flags_vertical = 0 -mouse_filter = 2 -theme_override_styles/panel = SubResource("StyleBoxFlat_vq4dg") -script = ExtResource("2_csqo8") - -[node name="CenterContainer" type="CenterContainer" parent="."] -layout_mode = 2 -mouse_filter = 2 - -[node name="Label" type="Label" parent="CenterContainer"] -layout_mode = 2 -theme_override_colors/font_color = Color(0, 0, 0, 1) -theme_override_fonts/font = SubResource("FontVariation_qfltj") -theme_override_font_sizes/font_size = 16 -theme_override_styles/normal = SubResource("StyleBoxEmpty_3rgop") -text = "Server message" |