Uploaded game files

This commit is contained in:
JamnedZ 2022-11-18 00:52:05 +07:00
parent 459da513f6
commit f71e7e39a0
1543 changed files with 50503 additions and 0 deletions

View file

@ -0,0 +1,16 @@
extends LineEdit
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass

View file

@ -0,0 +1,39 @@
[gd_scene load_steps=2 format=2]
[sub_resource type="StyleBoxFlat" id=1]
content_margin_left = 11.0
content_margin_right = 9.0
content_margin_top = 5.0
content_margin_bottom = 5.0
bg_color = Color( 0.12549, 0.141176, 0.192157, 1 )
border_width_left = 1
border_width_top = 1
border_width_right = 1
border_width_bottom = 1
border_color = Color( 0.0980392, 0.113725, 0.152941, 1 )
corner_radius_top_left = 3
corner_radius_top_right = 3
corner_radius_bottom_right = 3
corner_radius_bottom_left = 3
[node name="CustomLineEdit" type="LineEdit"]
margin_right = 48.0
margin_bottom = 30.0
rect_min_size = Vector2( 130, 27 )
size_flags_vertical = 6
custom_colors/selection_color = Color( 0.345098, 0.345098, 0.345098, 1 )
custom_colors/cursor_color = Color( 1, 1, 1, 1 )
custom_colors/clear_button_color_pressed = Color( 0.960784, 0.960784, 0.960784, 1 )
custom_colors/font_color_selected = Color( 1, 1, 1, 1 )
custom_colors/font_color = Color( 1, 1, 1, 1 )
custom_colors/clear_button_color = Color( 0, 0, 0, 1 )
custom_colors/font_color_uneditable = Color( 0, 0, 0, 1 )
custom_styles/read_only = SubResource( 1 )
custom_styles/focus = SubResource( 1 )
custom_styles/normal = SubResource( 1 )
expand_to_text_length = true
caret_blink = true
caret_blink_speed = 0.5
__meta__ = {
"_edit_use_anchors_": false
}

View file

@ -0,0 +1,29 @@
tool
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
# has an event_data variable that stores the current data!!!
## node references
onready var input_field = $HBox/InputField
# used to connect the signals
func _ready():
input_field.connect("text_changed", self, "_on_InputField_text_changed")
# called by the event block
func load_data(data:Dictionary):
# First set the event_data
.load_data(data)
# Now update the ui nodes to display the data.
input_field.text = event_data['emit_signal']
# has to return the wanted preview, only useful for body parts
func get_preview():
return ''
func _on_InputField_text_changed(text):
event_data['emit_signal'] = text
# informs the parent about the changes!
data_changed()

View file

@ -0,0 +1,55 @@
tool
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
onready var text_editor = $VBoxContainer/TextEditor
onready var voice_editor = $VBoxContainer/VoiceEditor
func _ready() -> void:
text_editor.connect("data_changed", self, "_on_text_editor_data_changed")
voice_editor.connect("data_changed", self, "_on_voice_editor_data_changed")
voice_editor.visible = use_voices()
voice_editor.editor_reference = editor_reference
voice_editor.repopulate()
func load_data(data):
.load_data(data)
text_editor.load_data(data)
voice_editor.visible = use_voices()
voice_editor.load_data(data)
update_voices_lines()
func get_preview():
return text_editor.get_preview()
func use_voices():
var config = DialogicResources.get_settings_config()
return config.get_value('dialog', 'text_event_audio_enable', false)
func _on_text_editor_data_changed(data) -> void:
event_data = data
#udpate the voice picker to check if we repopulate it
update_voices_lines()
# informs the parent
data_changed()
func update_voices_lines():
var text = text_editor.get_child(0).text
voice_editor._on_text_changed(text)
func _on_voice_editor_data_changed(data) -> void:
event_data['voice_data'] = data['voice_data']
voice_editor.visible = use_voices()
# informs the parent
data_changed()
func focus():
text_editor.focus()

View file

@ -0,0 +1,130 @@
tool
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
# has an event_data variable that stores the current data!!!
## node references
onready var text_editor = $TextEdit
var timeline_area = null
var text_gap = 50
# used to connect the signals
func _ready():
text_gap = (text_gap * DialogicUtil.get_editor_scale(self))
# signals
text_editor.connect("text_changed", self, "_on_TextEditor_text_changed")
text_editor.connect("focus_entered", self, "_on_TextEditor_focus_entered")
# stylistig setup
text_editor.syntax_highlighting = true
text_editor.add_color_region('[', ']', get_color("axis_z_color", "Editor"))
text_editor.set('custom_colors/number_color', get_color("font_color", "Editor"))
text_editor.set('custom_colors/function_color', get_color("font_color", "Editor"))
text_editor.set('custom_colors/member_variable_color', get_color("font_color", "Editor"))
text_editor.set('custom_colors/symbol_color', get_color("font_color", "Editor"))
timeline_area = find_parent('TimelineArea')
timeline_area.connect('resized', self, '_set_new_min_size')
_set_new_min_size()
# called by the event block
func load_data(data:Dictionary):
# First set the event_data
.load_data(data)
# Now update the ui nodes to display the data.
# in case this is a text event
if data['event_id'] == 'dialogic_001':
text_editor.text = event_data['text']
# in case this is a question event
elif data['event_id'] == 'dialogic_010':
text_editor.text = event_data['question']
# otherwise
else:
text_editor.text = event_data['text']
# resize the text_editor to the correct size
_set_new_min_size()
# has to return the wanted preview, only useful for body parts
func get_preview():
var max_preview_characters = 35
var text = ''
if event_data['event_id'] == 'dialogic_001':
text = event_data['text']
# in case this is a question event
elif event_data['event_id'] == 'dialogic_010':
text = event_data['question']
# otherwise
else:
text = event_data['text']
text = text.replace('\n', '[br]')
var preview = text.substr(0, min(max_preview_characters, len(text)))
if (len(text) > max_preview_characters):
preview += "..."
return preview
func _on_TextEditor_text_changed():
# in case this is a text event
if event_data['event_id'] == 'dialogic_001':
event_data['text'] = text_editor.text
# in case this is a question event
elif event_data['event_id'] == 'dialogic_010':
event_data['question'] = text_editor.text
# otherwise
else:
event_data['text'] = text_editor.text
_set_new_min_size()
# informs the parent about the changes!
data_changed()
func _set_new_min_size():
# Reset
text_editor.rect_min_size = Vector2(0,0)
# Getting new sizes
var extra_vertical = 1.1
# Getting the longest string and making that the width of the dialog bubble
# also check how many lines wrap (and how often)
var count_wrapped_lines = 0
var longest_string = ''
for l in text_editor.text.split('\n'):
if l.length() > longest_string.length():
longest_string = l
if get_font("normal_font").get_string_size(l).x > get_max_x_size():
count_wrapped_lines += get_font("normal_font").get_string_size(l).x/(get_max_x_size())
# set the height
if text_editor.get_line_count() > 1:
extra_vertical = 1.22
text_editor.rect_min_size.y = get_font("normal_font").get_height() * ((text_editor.get_line_count() + 1 + count_wrapped_lines) * extra_vertical)
# set the width
text_editor.rect_min_size.x = get_font("normal_font").get_string_size(longest_string).x + text_gap
if text_editor.rect_min_size.x > get_max_x_size():
text_editor.rect_min_size.x = get_max_x_size()
func get_max_x_size():
return timeline_area.rect_size.x - (text_editor.rect_global_position.x - timeline_area.rect_global_position.x) - text_gap
func _on_TextEditor_focus_entered() -> void:
if (Input.is_mouse_button_pressed(BUTTON_LEFT)):
emit_signal("request_selection")
func _on_TextEdit_focus_exited():
# Remove text selection to visually notify the user that the text will not
# be copied if they use a hotkey like CTRL + C
$TextEdit.deselect()
func focus():
$TextEdit.grab_focus()

View file

@ -0,0 +1,5 @@
tool
extends Label
func _ready():
add_color_override("font_color", get_color("contrast_color_2", "Editor"))

View file

@ -0,0 +1,13 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/GreyLabel.gd" type="Script" id=1]
[node name="Label" type="Label"]
margin_top = 4.0
margin_right = 78.0
margin_bottom = 18.0
text = "with portrait"
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}

View file

@ -0,0 +1,32 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/CustomLineEdit.tscn" type="PackedScene" id=1]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/EventPart_SignalArgumentPicker.gd" type="Script" id=2]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/GreyLabel.tscn" type="PackedScene" id=3]
[node name="SignalArgumentPicker" type="VBoxContainer"]
margin_right = 40.0
margin_bottom = 40.0
size_flags_vertical = 6
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="HBox" type="HBoxContainer" parent="."]
margin_top = 6.0
margin_right = 361.0
margin_bottom = 33.0
size_flags_vertical = 6
[node name="Label" parent="HBox" instance=ExtResource( 3 )]
margin_top = 6.0
margin_right = 227.0
margin_bottom = 20.0
custom_colors/font_color = Color( 0, 0, 0, 1 )
text = "'dialogic_signal' with the argument "
[node name="InputField" parent="HBox" instance=ExtResource( 1 )]
margin_left = 231.0
margin_right = 361.0
margin_bottom = 27.0

View file

@ -0,0 +1,26 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/EventPart_TextAndVoicePicker.gd" type="Script" id=1]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Audio/VoiceEditor.tscn" type="PackedScene" id=2]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/TextEditor.tscn" type="PackedScene" id=3]
[node name="TextAndVoiceEditor" type="VBoxContainer"]
margin_right = 40.0
margin_bottom = 40.0
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VBoxContainer" type="VBoxContainer" parent="."]
margin_right = 40.0
margin_bottom = 15.0
[node name="TextEditor" parent="VBoxContainer" instance=ExtResource( 3 )]
margin_bottom = 15.0
[node name="VoiceEditor" parent="VBoxContainer" instance=ExtResource( 2 )]
visible = false
margin_top = 4.0
margin_right = 358.0
margin_bottom = 44.0

View file

@ -0,0 +1,44 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/EventPart_TextEditor.gd" type="Script" id=1]
[ext_resource path="res://addons/dialogic/Editor/Events/styles/TextBackground.tres" type="StyleBox" id=2]
[sub_resource type="StyleBoxFlat" id=3]
content_margin_left = 16.0
content_margin_top = 14.0
bg_color = Color( 0.27451, 0.27451, 0.27451, 1 )
border_width_left = 1
border_width_top = 1
border_width_right = 1
border_width_bottom = 1
border_color = Color( 0.192157, 0.666667, 1, 1 )
corner_radius_top_left = 8
corner_radius_top_right = 8
corner_radius_bottom_right = 8
corner_radius_bottom_left = 8
[node name="TextEditor" type="HBoxContainer"]
margin_right = 40.0
margin_bottom = 40.0
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="TextEdit" type="TextEdit" parent="."]
margin_right = 17.0
margin_bottom = 40.0
size_flags_vertical = 3
custom_colors/member_variable_color = Color( 0, 0, 0, 1 )
custom_colors/function_color = Color( 0, 0, 0, 1 )
custom_colors/symbol_color = Color( 0, 0, 0, 1 )
custom_colors/font_color = Color( 1, 1, 1, 1 )
custom_colors/number_color = Color( 0, 0, 0, 1 )
custom_styles/focus = SubResource( 3 )
custom_styles/normal = ExtResource( 2 )
syntax_highlighting = true
show_line_numbers = true
smooth_scrolling = true
wrap_enabled = true
[connection signal="focus_exited" from="TextEdit" to="." method="_on_TextEdit_focus_exited"]