Updated dialogic

This commit is contained in:
MaddoScientisto 2026-01-05 16:00:41 +01:00
commit cbb82512ee
483 changed files with 5743 additions and 2177 deletions

View file

@ -1 +1 @@
uid://lsk3tuggakt6
uid://cm8w2iamuulp7

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=5 format=3 uid="uid://ch4j2lesn1sis"]
[ext_resource type="Script" uid="uid://lsk3tuggakt6" path="res://addons/dialogic/Editor/Events/Fields/array_part.gd" id="1"]
[ext_resource type="Script" uid="uid://cm8w2iamuulp7" path="res://addons/dialogic/Editor/Events/Fields/array_part.gd" id="1"]
[ext_resource type="PackedScene" uid="uid://dl08ubinx6ugu" path="res://addons/dialogic/Editor/Events/Fields/field_flex_value.tscn" id="3_s4j7i"]
[sub_resource type="Image" id="Image_28ws6"]

View file

@ -41,4 +41,3 @@ func _on_flex_value_value_changed() -> void:
func _on_delete_pressed() -> void:
queue_free()
value_changed.emit()

View file

@ -1 +1 @@
uid://c6u35t2t7k8mm
uid://b41laec1d54io

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=5 format=3 uid="uid://b27yweami3mxi"]
[ext_resource type="Script" uid="uid://c6u35t2t7k8mm" path="res://addons/dialogic/Editor/Events/Fields/dictionary_part.gd" id="2_q88pg"]
[ext_resource type="Script" uid="uid://b41laec1d54io" path="res://addons/dialogic/Editor/Events/Fields/dictionary_part.gd" id="2_q88pg"]
[ext_resource type="PackedScene" uid="uid://dl08ubinx6ugu" path="res://addons/dialogic/Editor/Events/Fields/field_flex_value.tscn" id="3_p082d"]
[sub_resource type="Image" id="Image_teqf1"]

View file

@ -1 +1 @@
uid://cm1yxhxo57dd6
uid://kmn7rns1g4fc

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=4 format=3 uid="uid://btmy7ageqpyq1"]
[ext_resource type="Script" uid="uid://cm1yxhxo57dd6" path="res://addons/dialogic/Editor/Events/Fields/field_array.gd" id="2"]
[ext_resource type="Script" uid="uid://kmn7rns1g4fc" path="res://addons/dialogic/Editor/Events/Fields/field_array.gd" id="2"]
[sub_resource type="Image" id="Image_v6fhx"]
data = {

View file

@ -1 +1 @@
uid://b2fdm4rg2lsq5
uid://lnr24bngydn2

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://dotvrsumm5y5c"]
[ext_resource type="Script" uid="uid://b2fdm4rg2lsq5" path="res://addons/dialogic/Editor/Events/Fields/field_audio_preview.gd" id="1_7wm54"]
[ext_resource type="Script" uid="uid://lnr24bngydn2" path="res://addons/dialogic/Editor/Events/Fields/field_audio_preview.gd" id="1_7wm54"]
[node name="Field_Audio_Preview" type="Button"]
offset_right = 8.0

View file

@ -1 +1 @@
uid://bvx3n3jfkyt7f
uid://do3x030t162u1

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://iypxcctv080u"]
[ext_resource type="Script" uid="uid://bvx3n3jfkyt7f" path="res://addons/dialogic/Editor/Events/Fields/field_bool_button.gd" id="1_t1n1f"]
[ext_resource type="Script" uid="uid://do3x030t162u1" path="res://addons/dialogic/Editor/Events/Fields/field_bool_button.gd" id="1_t1n1f"]
[node name="Field_BoolButton" type="Button"]
theme_override_colors/icon_normal_color = Color(0, 0, 0, 1)

View file

@ -1 +1 @@
uid://dnwdfshaj4rv7
uid://ddxcyihcistll

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://dm5hxmhyyxgq"]
[ext_resource type="Script" uid="uid://dnwdfshaj4rv7" path="res://addons/dialogic/Editor/Events/Fields/field_bool_check.gd" id="1_ckmtx"]
[ext_resource type="Script" uid="uid://ddxcyihcistll" path="res://addons/dialogic/Editor/Events/Fields/field_bool_check.gd" id="1_ckmtx"]
[node name="Field_BoolCheck" type="CheckButton"]
offset_right = 44.0

View file

@ -1 +1 @@
uid://cj3yoscgycygy
uid://o26ppdmyst02

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://4e0kjekan5e7"]
[ext_resource type="Script" uid="uid://cj3yoscgycygy" path="res://addons/dialogic/Editor/Events/Fields/field_color.gd" id="1_l666a"]
[ext_resource type="Script" uid="uid://o26ppdmyst02" path="res://addons/dialogic/Editor/Events/Fields/field_color.gd" id="1_l666a"]
[node name="Field_Color" type="ColorPickerButton"]
custom_minimum_size = Vector2(48, 0)

View file

@ -56,7 +56,7 @@ func _ready() -> void:
for i in [%Value1Variable, %Value2Variable]:
i.get_suggestions_func = get_variable_suggestions
i.suggestions_func = get_variable_suggestions
i.value_changed.connect(something_changed)
%Value1Number.value_changed.connect(something_changed)
@ -264,4 +264,3 @@ func _on_value_1_variable_value_changed(property_name: Variant, value: Variant)
%Value2Type.index_pressed(1)
something_changed()

View file

@ -1 +1 @@
uid://dtni8g3dujujh
uid://gx1mq5xn4mri

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=9 format=3 uid="uid://ir6334lqtuwt"]
[ext_resource type="Script" uid="uid://dtni8g3dujujh" path="res://addons/dialogic/Editor/Events/Fields/field_condition.gd" id="1_owjj0"]
[ext_resource type="Script" uid="uid://gx1mq5xn4mri" path="res://addons/dialogic/Editor/Events/Fields/field_condition.gd" id="1_owjj0"]
[ext_resource type="PackedScene" uid="uid://d3bhehatwoio" path="res://addons/dialogic/Editor/Events/Fields/field_options_fixed.tscn" id="2_f6v80"]
[ext_resource type="PackedScene" uid="uid://c0vkcehgjsjy" path="res://addons/dialogic/Editor/Events/Fields/field_text_singleline.tscn" id="3_3kfwc"]
[ext_resource type="PackedScene" uid="uid://kdpp3mibml33" path="res://addons/dialogic/Editor/Events/Fields/field_number.tscn" id="4_6q3a6"]

View file

@ -1 +1 @@
uid://ntqvlvpqgjwc
uid://cjhy1b218xsh0

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=4 format=3 uid="uid://c74bnmhefu72w"]
[ext_resource type="Script" uid="uid://ntqvlvpqgjwc" path="res://addons/dialogic/Editor/Events/Fields/field_dictionary.gd" id="1_p4kmu"]
[ext_resource type="Script" uid="uid://cjhy1b218xsh0" path="res://addons/dialogic/Editor/Events/Fields/field_dictionary.gd" id="1_p4kmu"]
[sub_resource type="Image" id="Image_mpo34"]
data = {

View file

@ -23,6 +23,7 @@ var resource_icon: Texture:
var max_width := 200
var current_value: String
var hide_reset := false
var show_editing_button := false
#endregion
@ -36,6 +37,9 @@ func _ready() -> void:
%OpenButton.icon = get_theme_icon("Folder", "EditorIcons")
%OpenButton.button_down.connect(_on_OpenButton_pressed)
%EditButton.icon = get_theme_icon("Edit", "EditorIcons")
%EditButton.button_down.connect(_on_EditButton_pressed)
%ClearButton.icon = get_theme_icon("Reload", "EditorIcons")
%ClearButton.button_up.connect(clear_path)
%ClearButton.visible = !hide_reset
@ -72,6 +76,8 @@ func _set_value(value: Variant) -> void:
%Field.custom_minimum_size.x = 0
%Field.expand_to_text_length = true
%EditButton.visible = show_editing_button and value
if not %Field.text == text:
value_changed.emit(property_name, current_value)
%Field.text = text
@ -94,6 +100,11 @@ func _on_file_dialog_selected(path:String) -> void:
value_changed.emit(property_name, path)
func _on_EditButton_pressed() -> void:
if ResourceLoader.exists(current_value):
EditorInterface.inspect_object(load(current_value), "", true)
func clear_path() -> void:
_set_value("")
value_changed.emit(property_name, "")
@ -134,6 +145,8 @@ func _on_field_focus_entered() -> void:
func _on_field_focus_exited() -> void:
$FocusStyle.hide()
var field_text: String = %Field.text
if current_value == field_text or (file_mode != EditorFileDialog.FILE_MODE_OPEN_DIR and current_value.get_file() == field_text):
return
_on_file_dialog_selected(field_text)
#endregion

View file

@ -1 +1 @@
uid://n3gpu77wxspf
uid://buepm260xnmaa

View file

@ -1,26 +1,14 @@
[gd_scene load_steps=8 format=3 uid="uid://7mvxuaulctcq"]
[gd_scene load_steps=6 format=3 uid="uid://7mvxuaulctcq"]
[ext_resource type="Script" uid="uid://n3gpu77wxspf" path="res://addons/dialogic/Editor/Events/Fields/field_file.gd" id="1_0grcf"]
[ext_resource type="Script" uid="uid://buepm260xnmaa" path="res://addons/dialogic/Editor/Events/Fields/field_file.gd" id="1_0grcf"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_tr837"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_wq6bt"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_6b7on"]
[sub_resource type="Image" id="Image_ye6ml"]
data = {
"data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 231, 255, 94, 94, 54, 255, 94, 94, 57, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 231, 255, 94, 94, 54, 255, 94, 94, 57, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 93, 93, 41, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 44, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 44, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 235, 255, 94, 94, 234, 255, 95, 95, 43, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 235, 255, 94, 94, 234, 255, 95, 95, 43, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0),
"format": "RGBA8",
"height": 16,
"mipmaps": false,
"width": 16
}
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_wq6bt"]
[sub_resource type="ImageTexture" id="ImageTexture_dkuon"]
image = SubResource("Image_ye6ml")
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_yv1pn"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ye6ml"]
content_margin_left = 4.0
content_margin_top = 4.0
content_margin_right = 4.0
@ -60,27 +48,30 @@ layout_mode = 2
size_flags_horizontal = 3
mouse_filter = 1
theme_override_styles/normal = SubResource("StyleBoxEmpty_tr837")
theme_override_styles/focus = SubResource("StyleBoxEmpty_wq6bt")
theme_override_styles/read_only = SubResource("StyleBoxEmpty_6b7on")
theme_override_styles/focus = SubResource("StyleBoxEmpty_wq6bt")
expand_to_text_length = true
[node name="OpenButton" type="Button" parent="BG/HBox"]
unique_name_in_owner = true
layout_mode = 2
icon = SubResource("ImageTexture_dkuon")
flat = true
[node name="EditButton" type="Button" parent="BG/HBox"]
unique_name_in_owner = true
layout_mode = 2
flat = true
[node name="ClearButton" type="Button" parent="BG/HBox"]
unique_name_in_owner = true
layout_mode = 2
icon = SubResource("ImageTexture_dkuon")
flat = true
[node name="FocusStyle" type="Panel" parent="."]
visible = false
layout_mode = 2
mouse_filter = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_yv1pn")
theme_override_styles/panel = SubResource("StyleBoxFlat_ye6ml")
[connection signal="focus_entered" from="BG/HBox/Field" to="." method="_on_field_focus_entered"]
[connection signal="focus_exited" from="BG/HBox/Field" to="." method="_on_field_focus_exited"]

View file

@ -1 +1 @@
uid://c67ocy8gudoug
uid://bl8pqdbnw005y

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=3 format=3 uid="uid://dl08ubinx6ugu"]
[ext_resource type="Script" uid="uid://c67ocy8gudoug" path="res://addons/dialogic/Editor/Events/Fields/field_flex_value.gd" id="1_m5nnp"]
[ext_resource type="Script" uid="uid://bl8pqdbnw005y" path="res://addons/dialogic/Editor/Events/Fields/field_flex_value.gd" id="1_m5nnp"]
[ext_resource type="PackedScene" uid="uid://d3bhehatwoio" path="res://addons/dialogic/Editor/Events/Fields/field_options_fixed.tscn" id="3_h10fc"]
[node name="FlexValue" type="HBoxContainer"]

View file

@ -0,0 +1,64 @@
@tool
extends DialogicVisualEditorField
var body: Control
var image_path: String
func _ready() -> void:
body = find_parent('Body') as Control
body.visibility_changed.connect(_on_body_visibility_toggled)
func _enter_tree() -> void:
%HiddenLabel.add_theme_color_override(
'font_color',
event_resource.event_color.lerp(get_theme_color("font_color", "Editor"), 0.8))
#region OVERWRITES
################################################################################
## To be overwritten
func _set_value(value:Variant) -> void:
if ResourceLoader.exists(value):
image_path = value
if is_preview_enabled():
self.texture = load(value)
custom_minimum_size.y = get_preview_size()
else:
self.texture = null
minimum_size_changed.emit()
#endregion
#region SIGNAL METHODS
################################################################################
func _on_body_visibility_toggled() -> void:
custom_minimum_size.y = 0
if body.is_visible:
%HiddenLabel.visible = not is_preview_enabled()
if is_preview_enabled() and ResourceLoader.exists(image_path):
self.texture = load(image_path)
custom_minimum_size.y = get_preview_size()
else:
self.texture = null
minimum_size_changed.emit()
#endregion
func is_preview_enabled() -> bool:
return get_preview_size() != 0
func get_preview_size() -> int:
return DialogicUtil.get_editor_setting(
"image_preview_height", 50) * DialogicUtil.get_editor_scale()

View file

@ -0,0 +1 @@
uid://u6evsmx7tynf

View file

@ -0,0 +1,23 @@
[gd_scene load_steps=2 format=3 uid="uid://bar0t74j5v4sa"]
[ext_resource type="Script" uid="uid://u6evsmx7tynf" path="res://addons/dialogic/Editor/Events/Fields/field_image_preview.gd" id="1_e5vbc"]
[node name="Field_Image_Preview" type="TextureRect"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 0
expand_mode = 2
stretch_mode = 4
script = ExtResource("1_e5vbc")
[node name="HiddenLabel" type="Label" parent="."]
unique_name_in_owner = true
visible = false
layout_mode = 0
tooltip_text = "Preview hidden because project setting 'dialogic/accessibility/image_preview_height' is 0."
mouse_filter = 1
text = "(Hidden)"

View file

@ -4,11 +4,18 @@ extends DialogicVisualEditorField
## Event block field for integers and floats. Improved version of the native spinbox.
@export_enum("Float", "Int", "Decible") var mode := 0 :
set(new_mode):
mode = new_mode
match mode:
0: use_float_mode() #FLOAT
1: use_int_mode() #INT
2: use_decibel_mode() #DECIBLE
@export var allow_string: bool = false
@export var step: float = 0.1
@export var enforce_step: bool = true
@export var min: float = -INF
@export var max: float = INF
@export var min_value: float = -INF
@export var max_value: float = INF
@export var value = 0.0
@export var prefix: String = ""
@export var suffix: String = ""
@ -27,18 +34,11 @@ func _ready() -> void:
func _load_display_info(info: Dictionary) -> void:
match info.get('mode', 0):
0: #FLOAT
use_float_mode(info.get('step', 0.1))
1: #INT
use_int_mode(info.get('step', 1))
2: #DECIBLE:
use_decibel_mode(info.get('step', step))
for option in info.keys():
match option:
'min': min = info[option]
'max': max = info[option]
'min': min_value = info[option]
'max': max_value = info[option]
'prefix': update_prefix(info[option])
'suffix': update_suffix(info[option])
'step':
@ -46,6 +46,7 @@ func _load_display_info(info: Dictionary) -> void:
step = info[option]
'hide_step_button': %Spin.hide()
mode = info.get('mode', mode)
func _set_value(new_value: Variant) -> void:
_on_value_text_submitted(str(new_value), true)
@ -60,22 +61,20 @@ func get_value() -> float:
return value
func use_float_mode(value_step: float = 0.1) -> void:
step = value_step
func use_float_mode() -> void:
update_suffix("")
enforce_step = false
func use_int_mode(value_step: float = 1) -> void:
step = value_step
func use_int_mode() -> void:
update_suffix("")
enforce_step = true
func use_decibel_mode(value_step: float = step) -> void:
max = 6
func use_decibel_mode() -> void:
max_value = 6
update_suffix("dB")
min = -80
min_value = -80
#endregion
@ -147,31 +146,38 @@ func _on_gui_input(event: InputEvent) -> void:
func _on_increment_button_down(button: NodePath) -> void:
_on_value_text_submitted(str(value+step))
_holding_button(1.0, get_node(button) as BaseButton)
_holding_button(1, get_node(button) as BaseButton)
func _on_decrement_button_down(button: NodePath) -> void:
_on_value_text_submitted(str(value-step))
_holding_button(-1.0, get_node(button) as BaseButton)
_holding_button(-1, get_node(button) as BaseButton)
func _on_value_text_submitted(new_text: String, no_signal:= false) -> void:
if new_text.is_empty() and not allow_string:
new_text = "0.0"
if new_text.is_valid_float():
var temp: float = min(max(new_text.to_float(), min), max)
if !enforce_step:
var temp: float = min(max(new_text.to_float(), min_value), max_value)
if not enforce_step:
value = temp
else:
value = snapped(temp, step)
elif allow_string:
value = new_text
%Value.text = str(value).pad_decimals(len(str(float(step)-floorf(step)))-2)
if int(step) == step and step != 0:
%Value.text = str(int(value))
else:
%Value.text = str(value).pad_decimals(
max(
len(str(float(step)-floorf(step)))-2,
len(str(float(value)-floorf(value)))-2,))
if not no_signal:
value_changed.emit(property_name, value)
# Visually disable Up or Down arrow when limit is reached to better indicate a limit has been hit
%Spin/Decrement.disabled = value <= min
%Spin/Increment.disabled = value >= max
%Spin/Decrement.disabled = value <= min_value
%Spin/Increment.disabled = value >= max_value
# If prefix or suffix was clicked, select the actual value box instead and move the caret to the closest side.
@ -196,4 +202,3 @@ func _on_value_focus_entered() -> void:
%Value.select_all.call_deferred()
#endregion

View file

@ -1 +1 @@
uid://b60ru6qhj10c3
uid://dbegwhxegm271

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=9 format=3 uid="uid://kdpp3mibml33"]
[ext_resource type="Script" uid="uid://b60ru6qhj10c3" path="res://addons/dialogic/Editor/Events/Fields/field_number.gd" id="1_0jdnn"]
[ext_resource type="Script" uid="uid://dbegwhxegm271" path="res://addons/dialogic/Editor/Events/Fields/field_number.gd" id="1_0jdnn"]
[ext_resource type="Texture2D" uid="uid://dh1ycbmw8anqh" path="res://addons/dialogic/Editor/Images/Interactable/increment_icon.svg" id="3_v5cne"]
[ext_resource type="Texture2D" uid="uid://brjikovneb63n" path="res://addons/dialogic/Editor/Images/Interactable/decrement_icon.svg" id="4_ph52o"]
@ -34,7 +34,7 @@ border_color = Color(0, 0, 0, 0)
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_right = -1102.0
offset_right = -1011.0
offset_bottom = -617.0
grow_horizontal = 2
grow_vertical = 2
@ -43,6 +43,7 @@ script = ExtResource("1_0jdnn")
[node name="Value_Panel" type="PanelContainer" parent="."]
layout_mode = 2
size_flags_horizontal = 3
theme_type_variation = &"DialogicEventEdit"
[node name="Layout" type="HBoxContainer" parent="Value_Panel"]
@ -60,8 +61,8 @@ size_flags_vertical = 4
mouse_filter = 1
mouse_default_cursor_shape = 1
theme_override_colors/default_color = Color(0.54099, 0.540991, 0.54099, 1)
theme_override_styles/focus = SubResource("StyleBoxEmpty_sj3oj")
theme_override_styles/normal = SubResource("StyleBoxEmpty_sj3oj")
theme_override_styles/focus = SubResource("StyleBoxEmpty_sj3oj")
bbcode_enabled = true
fit_content = true
scroll_active = false
@ -78,10 +79,9 @@ size_flags_horizontal = 3
focus_mode = 1
theme_override_constants/minimum_character_width = 0
theme_override_styles/normal = SubResource("StyleBoxEmpty_8yqsu")
theme_override_styles/focus = SubResource("StyleBoxEmpty_8yqsu")
theme_override_styles/read_only = SubResource("StyleBoxEmpty_8yqsu")
theme_override_styles/focus = SubResource("StyleBoxEmpty_8yqsu")
text = "0"
alignment = 1
expand_to_text_length = true
virtual_keyboard_type = 3
@ -95,8 +95,8 @@ size_flags_horizontal = 8
size_flags_vertical = 4
mouse_default_cursor_shape = 1
theme_override_colors/default_color = Color(0.435192, 0.435192, 0.435192, 1)
theme_override_styles/focus = SubResource("StyleBoxEmpty_smq50")
theme_override_styles/normal = SubResource("StyleBoxEmpty_smq50")
theme_override_styles/focus = SubResource("StyleBoxEmpty_smq50")
bbcode_enabled = true
fit_content = true
scroll_active = false
@ -113,17 +113,17 @@ theme_override_constants/separation = 0
alignment = 1
[node name="Increment" type="Button" parent="Value_Panel/Layout/Spin"]
auto_translate_mode = 2
layout_mode = 2
size_flags_vertical = 3
auto_translate = false
focus_neighbor_left = NodePath("../../Value")
focus_neighbor_top = NodePath(".")
focus_neighbor_bottom = NodePath("../Decrement")
theme_override_colors/icon_hover_color = Color(0.412738, 0.550094, 0.760917, 1)
theme_override_colors/icon_focus_color = Color(0.412738, 0.550094, 0.760917, 1)
theme_override_colors/icon_hover_color = Color(0.412738, 0.550094, 0.760917, 1)
theme_override_styles/normal = SubResource("StyleBoxFlat_increment")
theme_override_styles/hover = SubResource("StyleBoxFlat_increment")
theme_override_styles/pressed = SubResource("StyleBoxFlat_increment")
theme_override_styles/hover = SubResource("StyleBoxFlat_increment")
theme_override_styles/disabled = SubResource("StyleBoxFlat_increment")
theme_override_styles/focus = SubResource("StyleBoxFlat_increment")
icon = ExtResource("3_v5cne")
@ -131,17 +131,17 @@ flat = true
vertical_icon_alignment = 2
[node name="Decrement" type="Button" parent="Value_Panel/Layout/Spin"]
auto_translate_mode = 2
layout_mode = 2
size_flags_vertical = 3
auto_translate = false
focus_neighbor_left = NodePath("../../Value")
focus_neighbor_top = NodePath("../Increment")
focus_neighbor_bottom = NodePath(".")
theme_override_colors/icon_hover_color = Color(0.412738, 0.550094, 0.760917, 1)
theme_override_colors/icon_focus_color = Color(0.412738, 0.550094, 0.760917, 1)
theme_override_colors/icon_hover_color = Color(0.412738, 0.550094, 0.760917, 1)
theme_override_styles/normal = SubResource("StyleBoxFlat_decrement")
theme_override_styles/hover = SubResource("StyleBoxFlat_decrement")
theme_override_styles/pressed = SubResource("StyleBoxFlat_decrement")
theme_override_styles/hover = SubResource("StyleBoxFlat_decrement")
theme_override_styles/disabled = SubResource("StyleBoxFlat_decrement")
theme_override_styles/focus = SubResource("StyleBoxFlat_decrement")
icon = ExtResource("4_ph52o")

View file

@ -6,12 +6,13 @@ extends DialogicVisualEditorField
## SETTINGS
@export var placeholder_text := "Select Resource"
@export var empty_text := ""
enum Modes {PURE_STRING, PRETTY_PATH, IDENTIFIER}
enum Modes {PURE_STRING, PRETTY_PATH, IDENTIFIER, ANY_VALID_STRING}
@export var mode := Modes.PURE_STRING
@export var fit_text_length := true
var collapse_when_empty := false
var valid_file_drop_extension := ""
var get_suggestions_func: Callable
var suggestions_func: Callable
var validation_func: Callable
var resource_icon: Texture = null:
get:
@ -21,8 +22,13 @@ var resource_icon: Texture = null:
%Icon.texture = new_icon
## STATE
var current_value: String
var current_value: String:
set(value):
if current_value != value:
current_value = value
current_value_updated = true
var current_selected := 0
var current_value_updated := false
## SUGGESTIONS ITEM LIST
var _v_separation := 0
@ -38,12 +44,15 @@ var _max_height := 200 * DialogicUtil.get_editor_scale()
func _set_value(value:Variant) -> void:
if value == null or value.is_empty():
%Search.text = empty_text
update_error_tooltip('')
else:
match mode:
Modes.PRETTY_PATH:
%Search.text = DialogicUtil.pretty_name(value)
Modes.IDENTIFIER when value.begins_with("res://"):
%Search.text = DialogicResourceUtil.get_unique_identifier(value)
%Search.text = DialogicResourceUtil.get_unique_identifier_by_path(value)
Modes.ANY_VALID_STRING when validation_func:
%Search.text = validation_func.call(value).get('valid_text', value)
_:
%Search.text = str(value)
@ -51,11 +60,11 @@ func _set_value(value:Variant) -> void:
current_value = str(value)
func _load_display_info(info:Dictionary) -> void:
valid_file_drop_extension = info.get('file_extension', '')
collapse_when_empty = info.get('collapse_when_empty', false)
get_suggestions_func = info.get('suggestions_func', get_suggestions_func)
suggestions_func = info.get('suggestions_func', suggestions_func)
validation_func = info.get('validation_func', validation_func)
empty_text = info.get('empty_text', '')
placeholder_text = info.get('placeholder', 'Select Resource')
mode = info.get("mode", 0)
@ -101,16 +110,59 @@ func _ready() -> void:
if resource_icon == null:
self.resource_icon = null
var error_label_style := StyleBoxFlat.new()
error_label_style.bg_color = get_theme_color('background', 'Editor')
error_label_style.border_color = get_theme_color('error_color', 'Editor')
error_label_style.set_border_width_all(1)
error_label_style.set_corner_radius_all(4)
error_label_style.set_content_margin_all(6)
%ErrorTooltip.add_theme_stylebox_override('normal', error_label_style)
func change_to_empty() -> void:
update_error_tooltip('')
value_changed.emit(property_name, "")
func validate() -> void:
if mode == Modes.ANY_VALID_STRING and validation_func:
var validation_result: Dictionary = validation_func.call(current_value)
current_value = validation_result.get('valid_text', current_value)
update_error_tooltip(validation_result.get('error_tooltip', ''))
func update_error_tooltip(text: String) -> void:
%ErrorTooltip.text = text
if text.is_empty():
%ErrorTooltip.hide()
%Search.remove_theme_color_override("font_color")
else:
%ErrorTooltip.reset_size()
%ErrorTooltip.global_position = global_position - Vector2(0, %ErrorTooltip.size.y + 4)
%ErrorTooltip.show()
%Search.add_theme_color_override("font_color", get_theme_color('error_color', 'Editor'))
#endregion
#region SEARCH & SUGGESTION POPUP
################################################################################
func _on_Search_text_entered(new_text:String) -> void:
if mode == Modes.ANY_VALID_STRING:
if validation_func:
var validation_result: Dictionary = validation_func.call(new_text)
new_text = validation_result.get('valid_text', new_text)
update_error_tooltip(validation_result.get('error_tooltip', ''))
set_value(new_text)
value_changed.emit(property_name, current_value)
current_value_updated = false
hide_suggestions()
return
if %Suggestions.get_item_count():
if %Suggestions.is_anything_selected():
suggestion_selected(%Suggestions.get_selected_items()[0])
@ -123,21 +175,41 @@ func _on_Search_text_entered(new_text:String) -> void:
func _on_Search_text_changed(new_text:String, just_update:bool = false) -> void:
%Suggestions.clear()
if new_text == "" and !just_update:
if new_text == "" and not just_update:
change_to_empty()
else:
%Search.show()
var suggestions: Dictionary = get_suggestions_func.call(new_text)
if mode == Modes.ANY_VALID_STRING and !just_update:
if validation_func:
var validation_result: Dictionary = validation_func.call(new_text)
new_text = validation_result.get('valid_text', new_text)
update_error_tooltip(validation_result.get('error_tooltip', ''))
current_value = new_text
if just_update and new_text.is_empty() and %Search.text.ends_with("."):
new_text = %Search.text
var suggestions: Dictionary = suggestions_func.call(new_text)
var line_length := 0
var idx := 0
if new_text and mode == Modes.ANY_VALID_STRING and not new_text in suggestions.keys():
%Suggestions.add_item(new_text, get_theme_icon('GuiScrollArrowRight', 'EditorIcons'))
%Suggestions.set_item_metadata(idx, new_text)
line_length = get_theme_font('font', 'Label').get_string_size(
new_text, HORIZONTAL_ALIGNMENT_LEFT, -1, get_theme_font_size("font_size", 'Label')
).x + %Suggestions.fixed_icon_size.x * %Suggestions.get_icon_scale() + _icon_margin * 2 + _h_separation
idx += 1
for element in suggestions:
if new_text.is_empty() or new_text.to_lower() in element.to_lower() or new_text.to_lower() in str(suggestions[element].value).to_lower() or new_text.to_lower() in suggestions[element].get('tooltip', '').to_lower():
var curr_line_length: int = 0
curr_line_length = get_theme_font('font', 'Label').get_string_size(
curr_line_length = int(get_theme_font('font', 'Label').get_string_size(
element, HORIZONTAL_ALIGNMENT_LEFT, -1, get_theme_font_size("font_size", 'Label')
).x
).x)
%Suggestions.add_item(element)
if suggestions[element].has('icon'):
@ -166,7 +238,7 @@ func _on_Search_text_changed(new_text:String, just_update:bool = false) -> void:
var total_height: int = 0
for item in %Suggestions.item_count:
total_height += _line_height * DialogicUtil.get_editor_scale() + _v_separation
total_height += int(_line_height * DialogicUtil.get_editor_scale() + _v_separation)
total_height += _v_separation * 2
if total_height > _max_height:
line_length += %Suggestions.get_v_scroll_bar().get_minimum_size().x
@ -182,7 +254,7 @@ func _on_Search_text_changed(new_text:String, just_update:bool = false) -> void:
%Suggestions.size.x = max(%PanelContainer.size.x, line_length)
func suggestion_selected(index: int, position := Vector2(), button_index := MOUSE_BUTTON_LEFT) -> void:
func suggestion_selected(index: int, _position := Vector2(), button_index := MOUSE_BUTTON_LEFT) -> void:
if button_index != MOUSE_BUTTON_LEFT:
return
if %Suggestions.is_item_disabled(index):
@ -196,10 +268,12 @@ func suggestion_selected(index: int, position := Vector2(), button_index := MOUS
else:
current_value = %Suggestions.get_item_metadata(index)
update_error_tooltip('')
hide_suggestions()
grab_focus()
value_changed.emit(property_name, current_value)
current_value_updated = false
func _input(event:InputEvent) -> void:
@ -256,12 +330,17 @@ func _on_search_focus_entered() -> void:
_on_Search_text_changed("")
%Search.call_deferred('select_all')
%Focus.show()
validate()
func _on_search_focus_exited() -> void:
%Focus.hide()
if !%Suggestions.get_global_rect().has_point(get_global_mouse_position()):
hide_suggestions()
validate()
if current_value_updated:
value_changed.emit(property_name, current_value)
current_value_updated = false
#endregion
@ -269,7 +348,7 @@ func _on_search_focus_exited() -> void:
#region DRAG AND DROP
################################################################################
func _can_drop_data(position:Vector2, data:Variant) -> bool:
func _can_drop_data(_position:Vector2, data:Variant) -> bool:
if typeof(data) == TYPE_DICTIONARY and data.has('files') and len(data.files) == 1:
if valid_file_drop_extension:
if data.files[0].ends_with(valid_file_drop_extension):
@ -279,11 +358,12 @@ func _can_drop_data(position:Vector2, data:Variant) -> bool:
return false
func _drop_data(position:Vector2, data:Variant) -> void:
func _drop_data(_position:Vector2, data:Variant) -> void:
var path := str(data.files[0])
if mode == Modes.IDENTIFIER:
path = DialogicResourceUtil.get_unique_identifier(path)
path = DialogicResourceUtil.get_unique_identifier_by_path(path)
_set_value(path)
value_changed.emit(property_name, path)
current_value_updated = false
#endregion

View file

@ -1 +1 @@
uid://cgh1jncreeyuu
uid://cowk63wwk126v

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=7 format=3 uid="uid://dpwhshre1n4t6"]
[ext_resource type="Script" uid="uid://cgh1jncreeyuu" path="res://addons/dialogic/Editor/Events/Fields/field_options_dynamic.gd" id="1_b07gq"]
[ext_resource type="Script" uid="uid://cowk63wwk126v" path="res://addons/dialogic/Editor/Events/Fields/field_options_dynamic.gd" id="1_b07gq"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_tmt5n"]
@ -127,9 +127,18 @@ mouse_filter = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_g74jb")
metadata/_edit_use_anchors_ = true
[node name="ErrorTooltip" type="Label" parent="PanelContainer/Focus"]
unique_name_in_owner = true
visible = false
top_level = true
layout_mode = 0
offset_left = -2.0
offset_top = -44.5
offset_right = 11.0
offset_bottom = -9.5
[connection signal="focus_entered" from="." to="." method="_on_focus_entered"]
[connection signal="focus_entered" from="PanelContainer/MarginContainer/HBoxContainer/Search" to="." method="_on_search_focus_entered"]
[connection signal="focus_exited" from="PanelContainer/MarginContainer/HBoxContainer/Search" to="." method="_on_search_focus_exited"]
[connection signal="gui_input" from="PanelContainer/MarginContainer/HBoxContainer/Search" to="." method="_on_search_gui_input"]
[connection signal="gui_input" from="PanelContainer/MarginContainer/HBoxContainer/Search/Suggestions" to="." method="_on_suggestions_gui_input"]
[connection signal="toggled" from="PanelContainer/MarginContainer/HBoxContainer/SelectButton" to="." method="_on_SelectButton_toggled"]

View file

@ -3,7 +3,11 @@ extends DialogicVisualEditorField
## Event block field for constant options. For varying options use ComplexPicker.
var options: Array = []
var options: Array = []:
set(o):
options = o
if current_value != -1:
set_value(current_value)
## if true, only the symbol will be displayed. In the dropdown text will be visible.
## Useful for making UI simpler
@ -21,6 +25,7 @@ func _ready() -> void:
call("get_popup").index_pressed.connect(index_pressed)
func _load_display_info(info:Dictionary) -> void:
options = info.get('options', [])
self.disabled = info.get('disabled', false)
@ -35,7 +40,7 @@ func _set_value(value:Variant) -> void:
if !symbol_only:
self.text = option['label']
self.icon = option.get('icon', null)
current_value = value
current_value = value
func get_value() -> Variant:

View file

@ -1 +1 @@
uid://ddymwkrijul30
uid://l6jbshj3y66l

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://d3bhehatwoio"]
[ext_resource type="Script" uid="uid://ddymwkrijul30" path="res://addons/dialogic/Editor/Events/Fields/field_options_fixed.gd" id="1"]
[ext_resource type="Script" uid="uid://l6jbshj3y66l" path="res://addons/dialogic/Editor/Events/Fields/field_options_fixed.gd" id="1"]
[node name="Field_FixedOptions" type="MenuButton"]
offset_right = 137.0

View file

@ -31,7 +31,7 @@ func _autofocus() -> void:
#region SIGNAL METHODS
################################################################################
func _on_text_changed(value := "") -> void:
func _on_text_changed(_value := "") -> void:
value_changed.emit(property_name, self.text)
#endregion

View file

@ -1 +1 @@
uid://e63vkf3hk2td
uid://do4y48h30412d

View file

@ -1,7 +1,7 @@
[gd_scene load_steps=4 format=3 uid="uid://dyp7m2nvab1aj"]
[ext_resource type="Script" uid="uid://ccjw4fyc586j1" path="res://addons/dialogic/Editor/TimelineEditor/TextEditor/syntax_highlighter.gd" id="2_ww6ga"]
[ext_resource type="Script" uid="uid://e63vkf3hk2td" path="res://addons/dialogic/Editor/Events/Fields/field_text_multiline.gd" id="3_q7600"]
[ext_resource type="Script" uid="uid://bf2nivn8txcw5" path="res://addons/dialogic/Editor/TimelineEditor/TextEditor/syntax_highlighter.gd" id="2_ww6ga"]
[ext_resource type="Script" uid="uid://do4y48h30412d" path="res://addons/dialogic/Editor/Events/Fields/field_text_multiline.gd" id="3_q7600"]
[sub_resource type="SyntaxHighlighter" id="SyntaxHighlighter_2q5dk"]
script = ExtResource("2_ww6ga")

View file

@ -1 +1 @@
uid://c3pgscvl707c8
uid://cgx1rn8km87ya

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://c0vkcehgjsjy"]
[ext_resource type="Script" uid="uid://c3pgscvl707c8" path="res://addons/dialogic/Editor/Events/Fields/field_text_singleline.gd" id="1_4vnxv"]
[ext_resource type="Script" uid="uid://cgx1rn8km87ya" path="res://addons/dialogic/Editor/Events/Fields/field_text_singleline.gd" id="1_4vnxv"]
[node name="Field_Text_Singleline" type="LineEdit"]
offset_right = 1152.0

View file

@ -24,3 +24,8 @@ func _on_sub_value_changed(sub_component: String, value: float) -> void:
func _update_sub_component_text(value: Variant) -> void:
$X._on_value_text_submitted(str(value.x), true)
$Y._on_value_text_submitted(str(value.y), true)
func _on_step_changed(new_step:float) -> void:
$X.step = new_step
$Y.step = new_step

View file

@ -1 +1 @@
uid://yia1ug0bha8n
uid://2dk2fuatjwru

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=3 format=3 uid="uid://dtimnsj014cu"]
[ext_resource type="Script" uid="uid://yia1ug0bha8n" path="res://addons/dialogic/Editor/Events/Fields/field_vector2.gd" id="1_v6lp0"]
[ext_resource type="Script" uid="uid://2dk2fuatjwru" path="res://addons/dialogic/Editor/Events/Fields/field_vector2.gd" id="1_v6lp0"]
[ext_resource type="PackedScene" uid="uid://kdpp3mibml33" path="res://addons/dialogic/Editor/Events/Fields/field_number.tscn" id="2_a0b6y"]
[node name="Field_Vector2" type="HBoxContainer"]
@ -16,14 +16,16 @@ script = ExtResource("1_v6lp0")
[node name="X" parent="." instance=ExtResource("2_a0b6y")]
layout_mode = 2
step = 0.001
size_flags_horizontal = 3
enforce_step = false
min = -9999.0
max = 9999.0
prefix = ""
prefix = "x"
[node name="Y" parent="." instance=ExtResource("2_a0b6y")]
layout_mode = 2
step = 0.001
size_flags_horizontal = 3
enforce_step = false
min = -9999.0
max = 9999.0
prefix = ""
prefix = "y"

View file

@ -26,3 +26,9 @@ func _update_sub_component_text(value: Variant) -> void:
$X._on_value_text_submitted(str(value.x), true)
$Y._on_value_text_submitted(str(value.y), true)
$Z._on_value_text_submitted(str(value.z), true)
func _on_step_changed(new_step:float) -> void:
$X.step = new_step
$Y.step = new_step
$Z.step = new_step

View file

@ -1 +1 @@
uid://1e3wqmg6kvor
uid://y01tg3q2homo

View file

@ -1,7 +1,7 @@
[gd_scene load_steps=4 format=3 uid="uid://cklkpfrcvopgw"]
[ext_resource type="PackedScene" uid="uid://dtimnsj014cu" path="res://addons/dialogic/Editor/Events/Fields/field_vector2.tscn" id="1_l3y0o"]
[ext_resource type="Script" uid="uid://1e3wqmg6kvor" path="res://addons/dialogic/Editor/Events/Fields/field_vector3.gd" id="2_gktf1"]
[ext_resource type="Script" uid="uid://y01tg3q2homo" path="res://addons/dialogic/Editor/Events/Fields/field_vector3.gd" id="2_gktf1"]
[ext_resource type="PackedScene" uid="uid://kdpp3mibml33" path="res://addons/dialogic/Editor/Events/Fields/field_number.tscn" id="3_k0u0p"]
[node name="Field_Vector3" instance=ExtResource("1_l3y0o")]
@ -10,7 +10,8 @@ script = ExtResource("2_gktf1")
[node name="Z" parent="." index="2" instance=ExtResource("3_k0u0p")]
layout_mode = 2
step = 0.001
size_flags_horizontal = 3
enforce_step = false
min = -9999.0
max = 9999.0
affix = "z:"
prefix = "z"

View file

@ -28,3 +28,10 @@ func _update_sub_component_text(value: Variant) -> void:
$Y._on_value_text_submitted(str(value.y), true)
$Z._on_value_text_submitted(str(value.z), true)
$W._on_value_text_submitted(str(value.w), true)
func _on_step_changed(new_step:float) -> void:
$X.step = new_step
$Y.step = new_step
$Z.step = new_step
$W.step = new_step

View file

@ -1 +1 @@
uid://c06oke50dvorg
uid://chr6fkvkjugep

View file

@ -1,16 +1,25 @@
[gd_scene load_steps=4 format=3 uid="uid://dykss037r2rsc"]
[ext_resource type="PackedScene" uid="uid://cklkpfrcvopgw" path="res://addons/dialogic/Editor/Events/Fields/field_vector3.tscn" id="1_20tvl"]
[ext_resource type="Script" uid="uid://c06oke50dvorg" path="res://addons/dialogic/Editor/Events/Fields/field_vector4.gd" id="2_yksrc"]
[ext_resource type="Script" uid="uid://chr6fkvkjugep" path="res://addons/dialogic/Editor/Events/Fields/field_vector4.gd" id="2_yksrc"]
[ext_resource type="PackedScene" uid="uid://kdpp3mibml33" path="res://addons/dialogic/Editor/Events/Fields/field_number.tscn" id="3_1jogk"]
[node name="Field_Vector4" instance=ExtResource("1_20tvl")]
offset_right = -908.0
script = ExtResource("2_yksrc")
[node name="X" parent="." index="0"]
size_flags_horizontal = 1
prefix = ""
[node name="Y" parent="." index="1"]
size_flags_horizontal = 1
prefix = ""
[node name="W" parent="." index="3" instance=ExtResource("3_1jogk")]
layout_mode = 2
step = 0.001
size_flags_horizontal = 3
enforce_step = false
min = -9999.0
max = 9999.0
affix = "w:"
prefix = "w"

View file

@ -1,7 +1,12 @@
@tool
class_name DialogicVisualEditorFieldVector
extends DialogicVisualEditorField
## Base type for Vector event blocks
var step := 0.001 :
set(val):
step = val
_on_step_changed(step)
func _ready() -> void:
for child in get_children():
@ -36,3 +41,7 @@ func _on_sub_value_changed(sub_component: String, value: float) -> void:
func _update_sub_component_text(value: Variant) -> void:
pass
func _on_step_changed(step:float) -> void:
pass

View file

@ -1 +1 @@
uid://knuu5u6056yv
uid://c25u8dv20exfr