точно есть дэшм

This commit is contained in:
2026-07-21 00:27:17 +07:00
parent 1df926f1d8
commit d74fa3bd80
601 changed files with 2375919 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
[gd_scene format=3 uid="uid://dtrxx4ps81imm"]
[ext_resource type="Script" uid="uid://in2mxlslr7en" path="res://addons/dialoge/script/DialogueUI.gd" id="1_gunyw"]
[sub_resource type="LabelSettings" id="LabelSettings_gunyw"]
font_color = Color(0, 0, 0, 1)
[node name="DialogueUI" type="CanvasLayer" unique_id=996459414]
script = ExtResource("1_gunyw")
[node name="PressE" type="Label" parent="." unique_id=67837544]
offset_left = 517.0
offset_top = 211.0
offset_right = 587.0
offset_bottom = 234.0
text = "нажми E"
label_settings = SubResource("LabelSettings_gunyw")
[node name="DialogueBox" type="Control" parent="." unique_id=1725666230]
layout_mode = 3
anchor_top = 1.0120001
anchor_bottom = 1.0120001
offset_top = -257.77606
offset_right = 1155.0
offset_bottom = 0.22393799
[node name="TextureRect" type="Panel" parent="DialogueBox" unique_id=476248982]
layout_mode = 0
offset_left = 2.0
offset_top = -2.0
offset_right = 1152.0
offset_bottom = 249.0
[node name="NameLabel" type="Label" parent="DialogueBox" unique_id=499549505]
layout_mode = 0
offset_left = 60.0
offset_top = 10.0
offset_right = 201.0
offset_bottom = 33.0
[node name="TextLabel" type="Label" parent="DialogueBox" unique_id=1357001805]
layout_mode = 0
offset_left = 48.0
offset_top = 82.0
offset_right = 1080.0
offset_bottom = 225.0
+62
View File
@@ -0,0 +1,62 @@
extends CanvasLayer
@onready var dialogue_box = $DialogueBox
@onready var name_label = $DialogueBox/NameLabel
@onready var text_label = $DialogueBox/TextLabel
@onready var press_e_label = $PressE
var current_dialogue_lines: Array = []
var current_line_index: int = 0
func _ready():
# Изначально скрываем и окно диалога, и саму подсказку "Press E"
dialogue_box.visible = false
if press_e_label:
press_e_label.visible = false
func start_dialogue(lines: Array):
# Как только диалог начался — подсказку "Press E" нужно СРАЗУ убрать с экрана
hide_prompt()
current_dialogue_lines = lines
current_line_index = 0
dialogue_box.visible = true
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
show_current_line()
func show_current_line():
if current_line_index < current_dialogue_lines.size():
var line_data = current_dialogue_lines[current_line_index]
name_label.text = line_data.get("name", "NPC")
text_label.text = line_data.get("text", "")
else:
end_dialogue()
func _input(event):
if dialogue_box.visible:
var is_mouse_click = event is InputEventMouseButton and event.pressed and event.button_index == MOUSE_BUTTON_LEFT
var is_accept = event.is_action_pressed("ui_accept")
var is_e_key = event is InputEventKey and event.pressed and event.keycode == KEY_E
if is_mouse_click or is_accept or is_e_key:
current_line_index += 1
show_current_line()
# Перехватываем ввод, чтобы клики мыши при листании не вызывали стрельбу в шутере
get_viewport().set_input_as_handled()
func end_dialogue():
dialogue_box.visible = false
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
# Функция для показа подсказки
func show_prompt() -> void:
if press_e_label and not dialogue_box.visible:
press_e_label.visible = true
print("[UI] Подсказка 'Press E' успешно включена на экране.")
# Функция для скрытия подсказки
func hide_prompt() -> void:
if press_e_label:
press_e_label.visible = false
print("[UI] Подсказка 'Press E' скрыта.")
+1
View File
@@ -0,0 +1 @@
uid://in2mxlslr7en