Working dialogue system

This commit is contained in:
2ndbeam 2024-05-19 17:14:52 +03:00
commit c0c68c8662
16 changed files with 267 additions and 103 deletions

BIN
icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

View file

@ -2,16 +2,16 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://i71ylgba55nf" uid="uid://nxj6c7esqect"
path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex" path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
[deps] [deps]
source_file="res://icon.svg" source_file="res://icon.png"
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"] dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"]
[params] [params]
@ -32,6 +32,3 @@ process/hdr_as_srgb=false
process/hdr_clamp_exposure=false process/hdr_clamp_exposure=false
process/size_limit=0 process/size_limit=0
detect_3d/compress_to=1 detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View file

@ -1 +0,0 @@
<svg height="128" width="128" xmlns="http://www.w3.org/2000/svg"><rect x="2" y="2" width="124" height="124" rx="14" fill="#363d52" stroke="#212532" stroke-width="4"/><g transform="scale(.101) translate(122 122)"><g fill="#fff"><path d="M105 673v33q407 354 814 0v-33z"/><path fill="#478cbf" d="m105 673 152 14q12 1 15 14l4 67 132 10 8-61q2-11 15-15h162q13 4 15 15l8 61 132-10 4-67q3-13 15-14l152-14V427q30-39 56-81-35-59-83-108-43 20-82 47-40-37-88-64 7-51 8-102-59-28-123-42-26 43-46 89-49-7-98 0-20-46-46-89-64 14-123 42 1 51 8 102-48 27-88 64-39-27-82-47-48 49-83 108 26 42 56 81zm0 33v39c0 276 813 276 813 0v-39l-134 12-5 69q-2 10-14 13l-162 11q-12 0-16-11l-10-65H447l-10 65q-4 11-16 11l-162-11q-12-3-14-13l-5-69z"/><path d="M483 600c3 34 55 34 58 0v-86c-3-34-55-34-58 0z"/><circle cx="725" cy="526" r="90"/><circle cx="299" cy="526" r="90"/></g><g fill="#414042"><circle cx="307" cy="532" r="60"/><circle cx="717" cy="532" r="60"/></g></g></svg>

Before

Width:  |  Height:  |  Size: 950 B

View file

@ -1,6 +1,7 @@
[gd_resource type="Resource" script_class="Menu" load_steps=6 format=3 uid="uid://c4jg3vwtxskjm"] [gd_resource type="Resource" script_class="Menu" load_steps=8 format=3 uid="uid://c4jg3vwtxskjm"]
[ext_resource type="Script" path="res://scripts/Classes/Menu/menu_menu_resource.gd" id="1_idjuj"] [ext_resource type="Script" path="res://scripts/Classes/Menu/menu_menu_resource.gd" id="1_idjuj"]
[ext_resource type="Script" path="res://scripts/Classes/Menu/combo_menu_resource.gd" id="2_23hxw"]
[ext_resource type="Script" path="res://scripts/Classes/Menu/script_menu_resource.gd" id="3_6o5so"] [ext_resource type="Script" path="res://scripts/Classes/Menu/script_menu_resource.gd" id="3_6o5so"]
[ext_resource type="Script" path="res://scripts/Classes/Menu/menu.gd" id="3_ow6va"] [ext_resource type="Script" path="res://scripts/Classes/Menu/menu.gd" id="3_ow6va"]
@ -8,12 +9,17 @@
script = ExtResource("1_idjuj") script = ExtResource("1_idjuj")
item = &"res://menus/Base Menu/test_menu_2.tres" item = &"res://menus/Base Menu/test_menu_2.tres"
[sub_resource type="Resource" id="Resource_yrsmw"]
script = ExtResource("2_23hxw")
item_script = &"res://scripts/Base/Menu/send_message.gd"
item_menu = &"res://menus/Base Menu/test_menu_2.tres"
[sub_resource type="Resource" id="Resource_b58fs"] [sub_resource type="Resource" id="Resource_b58fs"]
script = ExtResource("3_6o5so") script = ExtResource("3_6o5so")
item = &"res://scripts/Base/Menu/test.gd" item = &"res://scripts/Base/Menu/test.gd"
[resource] [resource]
script = ExtResource("3_ow6va") script = ExtResource("3_ow6va")
item_ids = Array[String](["BASE_TEST_TRANSIT", "BASE_TEST_BLANK", "BASE_TEST_BLANK", "BASE_TEST_BLANK", "BASE_TEST_BUTTON", "BASE_TEST_BLANK", "BASE_TEST_BLANK", "BASE_TEST_BLANK"]) item_ids = Array[String](["BASE_TEST_TRANSIT", "BASE_TEST_BLANK", "BASE_TEST_BLANK", "BASE_TEST_MESSAGE", "BASE_TEST_BUTTON", "BASE_TEST_BLANK", "BASE_TEST_BLANK", "BASE_TEST_BLANK"])
item_actions = Array[int]([1, 0, 0, 0, 2, 0, 0, 0]) item_actions = Array[int]([1, 0, 0, 3, 2, 0, 0, 0])
item_data = Array[Resource("res://scripts/Classes/Menu/menu_resource.gd")]([SubResource("Resource_jjcgb"), null, null, null, SubResource("Resource_b58fs"), null, null, null]) item_data = Array[Resource("res://scripts/Classes/Menu/menu_resource.gd")]([SubResource("Resource_jjcgb"), null, null, SubResource("Resource_yrsmw"), SubResource("Resource_b58fs"), null, null, null])

View file

@ -11,10 +11,12 @@ config_version=5
[application] [application]
config/name="GammaCosmicRays" config/name="GammaCosmicRays"
config/version="Ifre 1.0"
config/tags=PackedStringArray("main_project") config/tags=PackedStringArray("main_project")
run/main_scene="res://scenes/MainMenu.tscn" run/main_scene="res://scenes/MainMenu.tscn"
config/use_custom_user_dir=true
config/features=PackedStringArray("4.2", "Forward Plus") config/features=PackedStringArray("4.2", "Forward Plus")
config/icon="res://icon.svg" config/icon="res://icon.png"
[debug] [debug]
@ -92,7 +94,7 @@ dock={
[internationalization] [internationalization]
locale/translations=PackedStringArray("res://translations/gui.en.translation", "res://translations/gui.ru.translation") locale/translations=PackedStringArray("res://translations/gui.en.translation", "res://translations/gui.ru.translation", "res://translations/base_dialogue.en.translation", "res://translations/base_dialogue.ru.translation")
[layer_names] [layer_names]

182
scenes/Base/bas42D5.tmp Normal file
View file

@ -0,0 +1,182 @@
[gd_scene load_steps=8 format=3 uid="uid://crq284yed2if5"]
[ext_resource type="Script" path="res://scripts/Base/base_menu.gd" id="1_3hgu4"]
[ext_resource type="Theme" uid="uid://dmb8bcdghdjd" path="res://main_theme.tres" id="1_p1gsn"]
[ext_resource type="Texture2D" uid="uid://db4euprxhape0" path="res://sprites/9s.png" id="1_uf5rv"]
[ext_resource type="Texture2D" uid="uid://hxrx87gda3uf" path="res://sprites/Bases/Menu/end_communications.png" id="2_ceeiv"]
[ext_resource type="Script" path="res://scripts/Base/actions_menu.gd" id="4_3gtyd"]
[ext_resource type="Script" path="res://scripts/Base/close_button.gd" id="4_68ool"]
[ext_resource type="Resource" uid="uid://c4jg3vwtxskjm" path="res://menus/Base Menu/test_menu_1.tres" id="5_rkret"]
[node name="BaseMenu" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("1_p1gsn")
script = ExtResource("1_3hgu4")
[node name="MenuBackground" type="NinePatchRect" parent="."]
layout_mode = 0
offset_left = 40.0
offset_top = 40.0
offset_right = 1240.0
offset_bottom = 640.0
texture = ExtResource("1_uf5rv")
region_rect = Rect2(0, 0, 5, 5)
patch_margin_left = 2
patch_margin_top = 2
patch_margin_right = 2
patch_margin_bottom = 2
[node name="HeaderBackground" type="NinePatchRect" parent="MenuBackground"]
layout_mode = 0
offset_left = 2.0
offset_top = 2.0
offset_right = 1198.0
offset_bottom = 76.0
texture = ExtResource("1_uf5rv")
region_rect = Rect2(0, 0, 5, 5)
patch_margin_left = 2
patch_margin_top = 2
patch_margin_right = 2
patch_margin_bottom = 2
[node name="PortraitBackground" type="NinePatchRect" parent="MenuBackground"]
layout_mode = 0
offset_left = 2.0
offset_top = 77.0
offset_right = 324.0
offset_bottom = 598.0
texture = ExtResource("1_uf5rv")
region_rect = Rect2(0, 0, 5, 5)
patch_margin_left = 2
patch_margin_top = 2
patch_margin_right = 2
patch_margin_bottom = 2
[node name="DialogueBackground" type="NinePatchRect" parent="MenuBackground"]
layout_mode = 0
offset_left = 325.0
offset_top = 77.0
offset_right = 1198.0
offset_bottom = 399.0
texture = ExtResource("1_uf5rv")
region_rect = Rect2(0, 0, 5, 5)
patch_margin_left = 2
patch_margin_top = 2
patch_margin_right = 2
patch_margin_bottom = 2
[node name="RichTextLabel" type="RichTextLabel" parent="MenuBackground/DialogueBackground"]
layout_mode = 1
anchors_preset = -1
anchor_left = 0.001
anchor_top = 0.003
anchor_right = 0.999
anchor_bottom = 0.997
offset_left = 0.127
offset_top = 0.034
offset_right = -0.127075
offset_bottom = -0.0340271
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 4
size_flags_vertical = 8
focus_mode = 2
bbcode_enabled = true
scroll_following = true
selection_enabled = true
[node name="ActionsBackground" type="NinePatchRect" parent="MenuBackground"]
layout_mode = 0
offset_left = 325.0
offset_top = 400.0
offset_right = 1198.0
offset_bottom = 598.0
texture = ExtResource("1_uf5rv")
region_rect = Rect2(0, 0, 5, 5)
patch_margin_left = 2
patch_margin_top = 2
patch_margin_right = 2
patch_margin_bottom = 2
[node name="ActionsMenu" type="GridContainer" parent="MenuBackground/ActionsBackground"]
layout_mode = 1
anchors_preset = -1
anchor_left = 0.00114548
anchor_top = 0.00505051
anchor_right = 1.0
anchor_bottom = 0.99495
grow_horizontal = 2
grow_vertical = 2
columns = 2
script = ExtResource("4_3gtyd")
menu = ExtResource("5_rkret")
metadata/_edit_use_anchors_ = true
[node name="Action1" type="Button" parent="MenuBackground/ActionsBackground/ActionsMenu"]
clip_contents = true
custom_minimum_size = Vector2(434, 46)
layout_mode = 2
[node name="Action5" type="Button" parent="MenuBackground/ActionsBackground/ActionsMenu"]
clip_contents = true
custom_minimum_size = Vector2(434, 46)
layout_mode = 2
[node name="Action2" type="Button" parent="MenuBackground/ActionsBackground/ActionsMenu"]
clip_contents = true
custom_minimum_size = Vector2(434, 46)
layout_mode = 2
[node name="Action6" type="Button" parent="MenuBackground/ActionsBackground/ActionsMenu"]
clip_contents = true
custom_minimum_size = Vector2(434, 46)
layout_mode = 2
[node name="Action3" type="Button" parent="MenuBackground/ActionsBackground/ActionsMenu"]
clip_contents = true
custom_minimum_size = Vector2(434, 46)
layout_mode = 2
[node name="Action7" type="Button" parent="MenuBackground/ActionsBackground/ActionsMenu"]
clip_contents = true
custom_minimum_size = Vector2(434, 46)
layout_mode = 2
[node name="Action4" type="Button" parent="MenuBackground/ActionsBackground/ActionsMenu"]
clip_contents = true
custom_minimum_size = Vector2(434, 46)
layout_mode = 2
[node name="Action8" type="Button" parent="MenuBackground/ActionsBackground/ActionsMenu"]
clip_contents = true
custom_minimum_size = Vector2(434, 46)
layout_mode = 2
[node name="CloseButtonBackground" type="NinePatchRect" parent="MenuBackground"]
layout_mode = 0
offset_left = 1124.0
offset_top = 2.0
offset_right = 1198.0
offset_bottom = 76.0
texture = ExtResource("1_uf5rv")
region_rect = Rect2(0, 0, 5, 5)
patch_margin_left = 2
patch_margin_top = 2
patch_margin_right = 2
patch_margin_bottom = 2
[node name="CloseButton" type="Button" parent="MenuBackground/CloseButtonBackground"]
layout_mode = 0
offset_left = 1.0
offset_top = 1.0
offset_right = 73.0
offset_bottom = 73.0
icon = ExtResource("2_ceeiv")
script = ExtResource("4_68ool")
[connection signal="button_up" from="MenuBackground/CloseButtonBackground/CloseButton" to="MenuBackground/CloseButtonBackground/CloseButton" method="_on_button_up"]

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=8 format=3 uid="uid://crq284yed2if5"] [gd_scene load_steps=9 format=3 uid="uid://crq284yed2if5"]
[ext_resource type="Script" path="res://scripts/Base/base_menu.gd" id="1_3hgu4"] [ext_resource type="Script" path="res://scripts/Base/base_menu.gd" id="1_3hgu4"]
[ext_resource type="Theme" uid="uid://dmb8bcdghdjd" path="res://main_theme.tres" id="1_p1gsn"] [ext_resource type="Theme" uid="uid://dmb8bcdghdjd" path="res://main_theme.tres" id="1_p1gsn"]
@ -6,6 +6,7 @@
[ext_resource type="Texture2D" uid="uid://hxrx87gda3uf" path="res://sprites/Bases/Menu/end_communications.png" id="2_ceeiv"] [ext_resource type="Texture2D" uid="uid://hxrx87gda3uf" path="res://sprites/Bases/Menu/end_communications.png" id="2_ceeiv"]
[ext_resource type="Script" path="res://scripts/Base/actions_menu.gd" id="4_3gtyd"] [ext_resource type="Script" path="res://scripts/Base/actions_menu.gd" id="4_3gtyd"]
[ext_resource type="Script" path="res://scripts/Base/close_button.gd" id="4_68ool"] [ext_resource type="Script" path="res://scripts/Base/close_button.gd" id="4_68ool"]
[ext_resource type="Script" path="res://scripts/Base/Menu/dialogue.gd" id="4_swpa1"]
[ext_resource type="Resource" uid="uid://c4jg3vwtxskjm" path="res://menus/Base Menu/test_menu_1.tres" id="5_rkret"] [ext_resource type="Resource" uid="uid://c4jg3vwtxskjm" path="res://menus/Base Menu/test_menu_1.tres" id="5_rkret"]
[node name="BaseMenu" type="Control"] [node name="BaseMenu" type="Control"]
@ -31,7 +32,7 @@ patch_margin_top = 2
patch_margin_right = 2 patch_margin_right = 2
patch_margin_bottom = 2 patch_margin_bottom = 2
[node name="HeaderBackground" type="NinePatchRect" parent="MenuBackground"] [node name="Header" type="NinePatchRect" parent="MenuBackground"]
layout_mode = 0 layout_mode = 0
offset_left = 2.0 offset_left = 2.0
offset_top = 2.0 offset_top = 2.0
@ -44,7 +45,7 @@ patch_margin_top = 2
patch_margin_right = 2 patch_margin_right = 2
patch_margin_bottom = 2 patch_margin_bottom = 2
[node name="PortraitBackground" type="NinePatchRect" parent="MenuBackground"] [node name="Portrait" type="NinePatchRect" parent="MenuBackground"]
layout_mode = 0 layout_mode = 0
offset_left = 2.0 offset_left = 2.0
offset_top = 77.0 offset_top = 77.0
@ -57,7 +58,7 @@ patch_margin_top = 2
patch_margin_right = 2 patch_margin_right = 2
patch_margin_bottom = 2 patch_margin_bottom = 2
[node name="DialogueBackground" type="NinePatchRect" parent="MenuBackground"] [node name="Dialogue" type="NinePatchRect" parent="MenuBackground"]
layout_mode = 0 layout_mode = 0
offset_left = 325.0 offset_left = 325.0
offset_top = 77.0 offset_top = 77.0
@ -69,8 +70,9 @@ patch_margin_left = 2
patch_margin_top = 2 patch_margin_top = 2
patch_margin_right = 2 patch_margin_right = 2
patch_margin_bottom = 2 patch_margin_bottom = 2
script = ExtResource("4_swpa1")
[node name="RichTextLabel" type="RichTextLabel" parent="MenuBackground/DialogueBackground"] [node name="DialogueView" type="RichTextLabel" parent="MenuBackground/Dialogue"]
layout_mode = 1 layout_mode = 1
anchors_preset = -1 anchors_preset = -1
anchor_left = 0.001 anchor_left = 0.001
@ -87,10 +89,11 @@ size_flags_horizontal = 4
size_flags_vertical = 8 size_flags_vertical = 8
focus_mode = 2 focus_mode = 2
bbcode_enabled = true bbcode_enabled = true
text = "DIALOGUE_ENTRY_POINT"
scroll_following = true scroll_following = true
selection_enabled = true selection_enabled = true
[node name="ActionsBackground" type="NinePatchRect" parent="MenuBackground"] [node name="Actions" type="NinePatchRect" parent="MenuBackground"]
layout_mode = 0 layout_mode = 0
offset_left = 325.0 offset_left = 325.0
offset_top = 400.0 offset_top = 400.0
@ -103,7 +106,7 @@ patch_margin_top = 2
patch_margin_right = 2 patch_margin_right = 2
patch_margin_bottom = 2 patch_margin_bottom = 2
[node name="ActionsMenu" type="GridContainer" parent="MenuBackground/ActionsBackground"] [node name="ActionsMenu" type="GridContainer" parent="MenuBackground/Actions"]
layout_mode = 1 layout_mode = 1
anchors_preset = -1 anchors_preset = -1
anchor_left = 0.00114548 anchor_left = 0.00114548
@ -117,47 +120,47 @@ script = ExtResource("4_3gtyd")
menu = ExtResource("5_rkret") menu = ExtResource("5_rkret")
metadata/_edit_use_anchors_ = true metadata/_edit_use_anchors_ = true
[node name="Action1" type="Button" parent="MenuBackground/ActionsBackground/ActionsMenu"] [node name="Action1" type="Button" parent="MenuBackground/Actions/ActionsMenu"]
clip_contents = true clip_contents = true
custom_minimum_size = Vector2(434, 46) custom_minimum_size = Vector2(434, 46)
layout_mode = 2 layout_mode = 2
[node name="Action5" type="Button" parent="MenuBackground/ActionsBackground/ActionsMenu"] [node name="Action5" type="Button" parent="MenuBackground/Actions/ActionsMenu"]
clip_contents = true clip_contents = true
custom_minimum_size = Vector2(434, 46) custom_minimum_size = Vector2(434, 46)
layout_mode = 2 layout_mode = 2
[node name="Action2" type="Button" parent="MenuBackground/ActionsBackground/ActionsMenu"] [node name="Action2" type="Button" parent="MenuBackground/Actions/ActionsMenu"]
clip_contents = true clip_contents = true
custom_minimum_size = Vector2(434, 46) custom_minimum_size = Vector2(434, 46)
layout_mode = 2 layout_mode = 2
[node name="Action6" type="Button" parent="MenuBackground/ActionsBackground/ActionsMenu"] [node name="Action6" type="Button" parent="MenuBackground/Actions/ActionsMenu"]
clip_contents = true clip_contents = true
custom_minimum_size = Vector2(434, 46) custom_minimum_size = Vector2(434, 46)
layout_mode = 2 layout_mode = 2
[node name="Action3" type="Button" parent="MenuBackground/ActionsBackground/ActionsMenu"] [node name="Action3" type="Button" parent="MenuBackground/Actions/ActionsMenu"]
clip_contents = true clip_contents = true
custom_minimum_size = Vector2(434, 46) custom_minimum_size = Vector2(434, 46)
layout_mode = 2 layout_mode = 2
[node name="Action7" type="Button" parent="MenuBackground/ActionsBackground/ActionsMenu"] [node name="Action7" type="Button" parent="MenuBackground/Actions/ActionsMenu"]
clip_contents = true clip_contents = true
custom_minimum_size = Vector2(434, 46) custom_minimum_size = Vector2(434, 46)
layout_mode = 2 layout_mode = 2
[node name="Action4" type="Button" parent="MenuBackground/ActionsBackground/ActionsMenu"] [node name="Action4" type="Button" parent="MenuBackground/Actions/ActionsMenu"]
clip_contents = true clip_contents = true
custom_minimum_size = Vector2(434, 46) custom_minimum_size = Vector2(434, 46)
layout_mode = 2 layout_mode = 2
[node name="Action8" type="Button" parent="MenuBackground/ActionsBackground/ActionsMenu"] [node name="Action8" type="Button" parent="MenuBackground/Actions/ActionsMenu"]
clip_contents = true clip_contents = true
custom_minimum_size = Vector2(434, 46) custom_minimum_size = Vector2(434, 46)
layout_mode = 2 layout_mode = 2
[node name="CloseButtonBackground" type="NinePatchRect" parent="MenuBackground"] [node name="CloseButtonBack" type="NinePatchRect" parent="MenuBackground"]
layout_mode = 0 layout_mode = 0
offset_left = 1124.0 offset_left = 1124.0
offset_top = 2.0 offset_top = 2.0
@ -170,7 +173,7 @@ patch_margin_top = 2
patch_margin_right = 2 patch_margin_right = 2
patch_margin_bottom = 2 patch_margin_bottom = 2
[node name="CloseButton" type="Button" parent="MenuBackground/CloseButtonBackground"] [node name="CloseButton" type="Button" parent="MenuBackground/CloseButtonBack"]
layout_mode = 0 layout_mode = 0
offset_left = 1.0 offset_left = 1.0
offset_top = 1.0 offset_top = 1.0
@ -179,4 +182,4 @@ offset_bottom = 73.0
icon = ExtResource("2_ceeiv") icon = ExtResource("2_ceeiv")
script = ExtResource("4_68ool") script = ExtResource("4_68ool")
[connection signal="button_up" from="MenuBackground/CloseButtonBackground/CloseButton" to="MenuBackground/CloseButtonBackground/CloseButton" method="_on_button_up"] [connection signal="button_up" from="MenuBackground/CloseButtonBack/CloseButton" to="MenuBackground/CloseButtonBack/CloseButton" method="_on_button_up"]

View file

@ -0,0 +1,7 @@
extends NinePatchRect
@onready var dialogue = $DialogueView
func send_message(msg: Message):
var new_msg = tr(msg.fact + "_RECEIVED")
dialogue.append_text(new_msg)

View file

@ -1,7 +1,19 @@
extends MenuAction extends MenuAction
class_name MessageSenderAction
var dialogue
## Message which will be send on click ## Message which will be send on click
var msg: Message var msg: Message
## Gets message and translates it on display.
## Shown message should end with _LOCAL
func _ready():
var item_id = get_parent().menu.item_ids[id]
msg = Message.create(item_id, tr(item_id + "_LOCAL"))
text = msg.shown
super._ready()
func action(): func action():
dialogue.send_message(msg)
get_parent().transit_menu(id) get_parent().transit_menu(id)

View file

@ -40,7 +40,10 @@ func load_menu():
actions[i].set_script(menu.item_data[i].load_script()) actions[i].set_script(menu.item_data[i].load_script())
Menu.Action.ComboAction: Menu.Action.ComboAction:
actions[i].set_script(menu.item_data[i].load_script()) actions[i].set_script(menu.item_data[i].load_script())
actions[i].id = i if "id" in actions[i]:
actions[i].id = i
if "dialogue" in actions[i]:
actions[i].dialogue = $"../../Dialogue"
## Called with transit_button, changes current menu ## Called with transit_button, changes current menu
func transit_menu(id: int): func transit_menu(id: int):

View file

@ -2,9 +2,9 @@
class_name Message class_name Message
## Fact value ## Fact value
var fact: String @export var fact: String
## Display value ## Display value
var shown: String @export var shown: String
## Returns message with set fact and shown strings ## Returns message with set fact and shown strings
static func create(fact: String, shown: String) -> Message: static func create(fact: String, shown: String) -> Message:

View file

@ -1,68 +0,0 @@
[gd_scene load_steps=6 format=3 uid="uid://dhh12jepm10m7"]
[ext_resource type="Shader" path="res://shaders/ship.gdshader" id="1_0kl5j"]
[ext_resource type="Texture2D" uid="uid://dbwvej0c5bl52" path="res://sprites/ship mk1.png" id="2_bxhdx"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_j0js1"]
shader = ExtResource("1_0kl5j")
shader_parameter/wave_centers = null
shader_parameter/wave_distances = null
shader_parameter/color = Color(1, 1, 1, 1)
shader_parameter/max_distance = 20.0
shader_parameter/bublic_size = 15.0
[sub_resource type="GDScript" id="GDScript_cl2gl"]
resource_name = "perdej"
script/source = "extends Sprite2D
var tween
func wave(pos):
var pos_arr = [pos]
if tween:
tween.kill()
tween = create_tween()
tween.tween_method(set_wave,0,20,1.5)
material.set_shader_parameter(\"wave_centers\",pos_arr)
func set_wave(val):
material.set_shader_parameter(\"wave_distances\",[val])
"
[sub_resource type="GDScript" id="GDScript_lydqv"]
resource_name = "Testicles"
script/source = "extends RayCast2D
func _process(delta):
global_position = get_global_mouse_position().normalized()*target_position.x
look_at(Vector2.ZERO)
func _input(event):
if event is InputEventMouseButton:
if event.button_index == MOUSE_BUTTON_LEFT and event.pressed:
$\"../Icon\".wave(get_collision_point())
print(\"test\")
"
[node name="Node2D" type="Node2D"]
[node name="Icon" type="Sprite2D" parent="."]
material = SubResource("ShaderMaterial_j0js1")
position = Vector2(-48, 22)
texture = ExtResource("2_bxhdx")
script = SubResource("GDScript_cl2gl")
[node name="Area2D" type="Area2D" parent="Icon"]
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Icon/Area2D"]
polygon = PackedVector2Array(16, -5.2, 16, 5, 14.6, 5, -5.8, 16, -16, 16, -16, -16, -7.6, -16)
[node name="RayCast2D" type="RayCast2D" parent="."]
position = Vector2(0, -112)
target_position = Vector2(112, 0)
collide_with_areas = true
script = SubResource("GDScript_lydqv")
[node name="Camera2D" type="Camera2D" parent="."]
zoom = Vector2(1.475, 1.475)

View file

@ -0,0 +1,4 @@
,en,ru
DIALOGUE_ENTRY_POINT,Entering chat with {race}...\nLogged in as {profile_name}.\n> ,Осуществление связи с {race}...\nВы вошли в систему как {profile_name}\n>
BASE_TEST_MESSAGE_LOCAL,Greet,Поприветствовать
BASE_TEST_MESSAGE_RECEIVED,"Hello, gryadki!\n\tBye, ponos!\n> ","Хеллоу, грядки!\n\tБай, понос!\n> "
1 en ru
2 DIALOGUE_ENTRY_POINT Entering chat with {race}...\nLogged in as {profile_name}.\n> Осуществление связи с {race}...\nВы вошли в систему как {profile_name}\n>
3 BASE_TEST_MESSAGE_LOCAL Greet Поприветствовать
4 BASE_TEST_MESSAGE_RECEIVED Hello, gryadki!\n\tBye, ponos!\n> Хеллоу, грядки!\n\tБай, понос!\n>

View file

@ -0,0 +1,17 @@
[remap]
importer="csv_translation"
type="Translation"
uid="uid://cgcykk8j7h7yc"
[deps]
files=["res://translations/base_dialogue.en.translation", "res://translations/base_dialogue.ru.translation"]
source_file="res://translations/base_dialogue.csv"
dest_files=["res://translations/base_dialogue.en.translation", "res://translations/base_dialogue.ru.translation"]
[params]
compress=true
delimiter=0

Binary file not shown.

Binary file not shown.