Интерфейс для диалогов

This commit is contained in:
Евгений Титаренко 2024-08-24 19:53:51 +03:00
parent 7afef58a7f
commit 65003d3030
10 changed files with 288 additions and 49 deletions

View file

@ -1,32 +1,38 @@
[gd_scene load_steps=8 format=3 uid="uid://cmn7af4dsj8v2"]
[gd_scene load_steps=9 format=3 uid="uid://cmn7af4dsj8v2"]
[ext_resource type="FontFile" uid="uid://dwn20pw40jpxm" path="res://fonts/ZxSpectrum7-nROZ0.ttf" id="1_e4s1h"]
[ext_resource type="Script" path="res://scripts/Dialog.cs" id="2_a35aq"]
[ext_resource type="Texture2D" uid="uid://b7dgjrmfqi162" path="res://resources/sprites/ui/panel_square.png" id="3_adx38"]
[sub_resource type="Theme" id="Theme_gtdw8"]
default_font = ExtResource("1_e4s1h")
default_font_size = 10
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_tctyf"]
bg_color = Color(0.532017, 0.646565, 0.382003, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_yovy8"]
bg_color = Color(0.704854, 0.51027, 0.802981, 1)
[sub_resource type="LabelSettings" id="LabelSettings_8nvov"]
font = ExtResource("1_e4s1h")
font_size = 10
outline_color = Color(0, 0, 0, 1)
bg_color = Color(0.533333, 0.647059, 0.380392, 0)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_dk342"]
bg_color = Color(0.906641, 0.460702, 0.0359737, 1)
content_margin_top = 4.0
bg_color = Color(0.905882, 0.458824, 0.0352941, 0)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_yovy8"]
bg_color = Color(0.6, 0.6, 0.6, 0)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_68mln"]
content_margin_left = 5.0
content_margin_top = 5.0
content_margin_right = 5.0
content_margin_bottom = 5.0
bg_color = Color(0.6, 0.6, 0.6, 0)
[node name="Dialog" type="PanelContainer"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_right = -544.0
offset_bottom = -443.0
offset_left = -10.5
offset_top = -5.0
offset_right = -550.5
offset_bottom = -438.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
@ -36,17 +42,7 @@ script = ExtResource("2_a35aq")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 2
[node name="PanelContainer" type="PanelContainer" parent="VBoxContainer"]
layout_mode = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_yovy8")
[node name="TextBox" type="Label" parent="VBoxContainer/PanelContainer"]
custom_minimum_size = Vector2(96, 10)
layout_mode = 2
text = "Placeholder text"
label_settings = SubResource("LabelSettings_8nvov")
autowrap_mode = 3
theme_override_constants/separation = 0
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
layout_mode = 2
@ -57,9 +53,28 @@ layout_mode = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_dk342")
[node name="AuthorBox" type="Label" parent="VBoxContainer/HBoxContainer/PanelContainer"]
custom_minimum_size = Vector2(96, 10)
custom_minimum_size = Vector2(100, 10)
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 0
text = "NPC name"
autowrap_mode = 3
[node name="PanelContainer" type="PanelContainer" parent="VBoxContainer"]
layout_mode = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_yovy8")
[node name="NinePatchRect" type="NinePatchRect" parent="VBoxContainer/PanelContainer"]
layout_mode = 2
texture = ExtResource("3_adx38")
patch_margin_left = 12
patch_margin_top = 14
patch_margin_right = 12
patch_margin_bottom = 12
[node name="TextBox" type="Label" parent="VBoxContainer/PanelContainer"]
custom_minimum_size = Vector2(90, 10)
layout_mode = 2
theme_override_styles/normal = SubResource("StyleBoxFlat_68mln")
text = "Placeholder text"
autowrap_mode = 3

View file

@ -1,8 +1,9 @@
[gd_scene load_steps=14 format=3 uid="uid://dfdsnwub212o6"]
[gd_scene load_steps=19 format=3 uid="uid://dfdsnwub212o6"]
[ext_resource type="Script" path="res://scripts/Player.cs" id="1_68nsf"]
[ext_resource type="SpriteFrames" uid="uid://e8ybb7seykdx" path="res://resources/sprites/player/player.tres" id="1_be2ex"]
[ext_resource type="FontFile" uid="uid://dwn20pw40jpxm" path="res://fonts/ZxSpectrum7-nROZ0.ttf" id="3_w5ojp"]
[ext_resource type="Texture2D" uid="uid://dvbfhk2703brs" path="res://resources/sprites/ui/metalPanel.png" id="4_ha8al"]
[ext_resource type="PackedScene" uid="uid://cmn7af4dsj8v2" path="res://prefabs/Dialog.tscn" id="4_owmws"]
[ext_resource type="Script" path="res://scripts/ChatLogContainer.cs" id="4_tbl72"]
[ext_resource type="PackedScene" uid="uid://phjermaw6phb" path="res://prefabs/AudioCollection.tscn" id="5_wnylg"]
@ -16,8 +17,27 @@ size = Vector2(22, 51)
[sub_resource type="Theme" id="Theme_8jldp"]
default_font = ExtResource("3_w5ojp")
default_font_size = 10
Label/colors/font_color = Color(0, 0, 0, 1)
Label/constants/line_spacing = 0
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_l7l8c"]
content_margin_left = 22.0
content_margin_top = 5.0
bg_color = Color(0.6, 0.6, 0.6, 0)
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_7gu8b"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_5af0i"]
bg_color = Color(0.6, 0.6, 0.6, 0)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_m2s6r"]
content_margin_left = 22.0
content_margin_bottom = 0.0
bg_color = Color(0.6, 0.6, 0.6, 0)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_6l2d2"]
content_margin_left = 22.0
bg_color = Color(0.6, 0.6, 0.6, 0)
[sub_resource type="AudioStreamPlaylist" id="AudioStreamPlaylist_flb1c"]
loop = false
@ -49,7 +69,20 @@ offset_right = 40.0
offset_bottom = 40.0
theme = SubResource("Theme_8jldp")
[node name="NinePatchRect" type="NinePatchRect" parent="Camera2D/Control"]
layout_mode = 0
offset_left = 160.0
offset_top = -140.0
offset_right = 268.0
offset_bottom = 100.0
texture = ExtResource("4_ha8al")
patch_margin_left = 10
patch_margin_top = 10
patch_margin_right = 10
patch_margin_bottom = 10
[node name="ChatLog" type="PanelContainer" parent="Camera2D/Control"]
visible = false
layout_mode = 0
offset_left = 160.0
offset_top = -140.0
@ -58,6 +91,16 @@ offset_bottom = 100.0
theme = SubResource("Theme_8jldp")
theme_override_styles/panel = SubResource("StyleBoxFlat_l7l8c")
[node name="ChatLog2" type="PanelContainer" parent="Camera2D/Control"]
visible = false
layout_mode = 0
offset_left = 160.0
offset_top = -140.0
offset_right = 256.0
offset_bottom = 100.0
theme = SubResource("Theme_8jldp")
theme_override_styles/panel = SubResource("StyleBoxTexture_7gu8b")
[node name="PanelContainer" type="PanelContainer" parent="Camera2D/Control"]
layout_mode = 0
offset_left = 160.0
@ -70,44 +113,69 @@ theme_override_styles/panel = SubResource("StyleBoxFlat_l7l8c")
layout_mode = 2
text = "Chat Log"
[node name="ChatLogContainer" type="VBoxContainer" parent="Camera2D/Control"]
[node name="Control" type="Control" parent="Camera2D/Control"]
clip_contents = true
anchors_preset = 0
offset_left = 164.0
offset_top = -125.0
offset_right = 264.0
offset_bottom = 75.0
[node name="PanelContainer2" type="PanelContainer" parent="Camera2D/Control/Control"]
clip_contents = true
layout_mode = 0
offset_right = 100.0
offset_bottom = 220.0
theme_override_styles/panel = SubResource("StyleBoxFlat_5af0i")
[node name="ChatLogContainer" type="VBoxContainer" parent="Camera2D/Control/Control/PanelContainer2"]
layout_mode = 2
offset_left = 160.0
offset_top = -130.0
offset_right = 256.0
offset_bottom = -56.0
theme_override_constants/separation = 0
script = ExtResource("4_tbl72")
[node name="PlaceholderDialog" parent="Camera2D/Control/ChatLogContainer" instance=ExtResource("4_owmws")]
visible = false
[node name="PlaceholderDialog" parent="Camera2D/Control/Control/PanelContainer2/ChatLogContainer" instance=ExtResource("4_owmws")]
layout_mode = 2
[node name="PlaceholderDialog2" parent="Camera2D/Control/ChatLogContainer" instance=ExtResource("4_owmws")]
visible = false
[node name="PlaceholderDialog2" parent="Camera2D/Control/Control/PanelContainer2/ChatLogContainer" instance=ExtResource("4_owmws")]
layout_mode = 2
Text = "Placeholder text 2"
Author = "NPC name 2"
[node name="CloseLabel" type="PanelContainer" parent="Camera2D/Control"]
[node name="PlaceholderDialog3" parent="Camera2D/Control/Control/PanelContainer2/ChatLogContainer" instance=ExtResource("4_owmws")]
layout_mode = 2
Text = "Placeholder text 2"
Author = "NPC name 2"
[node name="PlaceholderDialog4" parent="Camera2D/Control/Control/PanelContainer2/ChatLogContainer" instance=ExtResource("4_owmws")]
layout_mode = 2
Text = "Placeholder text 2"
Author = "NPC name 2"
[node name="PlaceholderDialog5" parent="Camera2D/Control/Control/PanelContainer2/ChatLogContainer" instance=ExtResource("4_owmws")]
layout_mode = 2
Text = "Placeholder text 2"
Author = "NPC name 2"
[node name="ExitLabel" type="PanelContainer" parent="Camera2D/Control"]
layout_mode = 2
offset_left = 160.0
offset_top = 90.0
offset_top = 85.0
offset_right = 256.0
offset_bottom = 100.0
theme_override_styles/panel = SubResource("StyleBoxFlat_l7l8c")
offset_bottom = 95.0
theme_override_styles/panel = SubResource("StyleBoxFlat_m2s6r")
[node name="Label" type="Label" parent="Camera2D/Control/CloseLabel"]
[node name="Label" type="Label" parent="Camera2D/Control/ExitLabel"]
layout_mode = 2
text = "C - Exit"
[node name="NextLabel" type="PanelContainer" parent="Camera2D/Control"]
visible = false
layout_mode = 2
offset_left = 160.0
offset_top = 90.0
offset_top = 85.0
offset_right = 256.0
offset_bottom = 100.0
theme_override_styles/panel = SubResource("StyleBoxFlat_l7l8c")
offset_bottom = 95.0
theme_override_styles/panel = SubResource("StyleBoxFlat_6l2d2")
[node name="Label" type="Label" parent="Camera2D/Control/NextLabel"]
layout_mode = 2