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

@ -70,64 +70,71 @@ var paused := false:
dialogic_resumed.emit()
## A timeline that will be played when dialog ends.
## By default this timeline only contains a clear event.
var dialog_ending_timeline: DialogicTimeline
## Emitted when [member paused] changes to `true`.
signal dialogic_paused
## Emitted when [member paused] changes to `false`.
signal dialogic_resumed
## Emitted when the timeline ends.
## This can be a timeline ending or [method end_timeline] being called.
signal timeline_ended
## Emitted when a timeline starts by calling either [method start]
## or [method start_timeline].
signal timeline_started
## Emitted when the timeline ends.
## This can be a timeline ending or [method end_timeline] being called.
signal timeline_ended
## Emitted when an event starts being executed.
## The event may not have finished executing yet.
signal event_handled(resource: DialogicEvent)
## Emitted when a [class SignalEvent] event was reached.
@warning_ignore("unused_signal") # This is emitted by the signal event.
signal signal_event(argument: Variant)
## Emitted when a signal event gets fired from a [class TextEvent] event.
@warning_ignore("unused_signal") # This is emitted by the text subsystem.
signal text_signal(argument: String)
# Careful, this section is repopulated automatically at certain moments.
#region SUBSYSTEMS
var Animations := preload("res://addons/dialogic/Modules/Core/subsystem_animation.gd").new():
get: return get_subsystem("Animations")
var Audio := preload("res://addons/dialogic/Modules/Audio/subsystem_audio.gd").new():
get: return get_subsystem("Audio")
var Backgrounds := preload("res://addons/dialogic/Modules/Background/subsystem_backgrounds.gd").new():
get: return get_subsystem("Backgrounds")
var Portraits := preload("res://addons/dialogic/Modules/Character/subsystem_portraits.gd").new():
get: return get_subsystem("Portraits")
var PortraitContainers := preload("res://addons/dialogic/Modules/Character/subsystem_containers.gd").new():
get: return get_subsystem("PortraitContainers")
var Choices := preload("res://addons/dialogic/Modules/Choice/subsystem_choices.gd").new():
get: return get_subsystem("Choices")
var Expressions := preload("res://addons/dialogic/Modules/Core/subsystem_expression.gd").new():
get: return get_subsystem("Expressions")
var Animations := preload("res://addons/dialogic/Modules/Core/subsystem_animation.gd").new():
get: return get_subsystem("Animations")
var Inputs := preload("res://addons/dialogic/Modules/Core/subsystem_input.gd").new():
get: return get_subsystem("Inputs")
var Glossary := preload("res://addons/dialogic/Modules/Glossary/subsystem_glossary.gd").new():
get: return get_subsystem("Glossary")
var History := preload("res://addons/dialogic/Modules/History/subsystem_history.gd").new():
get: return get_subsystem("History")
var Inputs := preload("res://addons/dialogic/Modules/Core/subsystem_input.gd").new():
get: return get_subsystem("Inputs")
var Jump := preload("res://addons/dialogic/Modules/Jump/subsystem_jump.gd").new():
get: return get_subsystem("Jump")
var PortraitContainers := preload("res://addons/dialogic/Modules/Character/subsystem_containers.gd").new():
get: return get_subsystem("PortraitContainers")
var Portraits := preload("res://addons/dialogic/Modules/Character/subsystem_portraits.gd").new():
get: return get_subsystem("Portraits")
var Save := preload("res://addons/dialogic/Modules/Save/subsystem_save.gd").new():
get: return get_subsystem("Save")
@ -149,9 +156,6 @@ var VAR := preload("res://addons/dialogic/Modules/Variable/subsystem_variables.g
var Voice := preload("res://addons/dialogic/Modules/Voice/subsystem_voice.gd").new():
get: return get_subsystem("Voice")
var ShowImage := preload("res://addons/dialogic_additions/ShowImage/subsystem_show_image.gd").new():
get: return get_subsystem("ShowImage")
#endregion
@ -161,6 +165,11 @@ func _ready() -> void:
clear()
DialogicResourceUtil.update_event_cache()
dialog_ending_timeline = DialogicTimeline.new()
dialog_ending_timeline.from_text("[clear]")
#region TIMELINE & EVENT HANDLING
################################################################################
@ -168,12 +177,12 @@ func _ready() -> void:
## Method to start a timeline AND ensure that a layout scene is present.
## For argument info, checkout [method start_timeline].
## -> returns the layout node
func start(timeline:Variant, label:Variant="") -> Node:
func start(timeline:Variant, label_or_idx:Variant="") -> Node:
# If we don't have a style subsystem, default to just start_timeline()
if not has_subsystem('Styles'):
printerr("[Dialogic] You called Dialogic.start() but the Styles subsystem is missing!")
clear(ClearFlags.KEEP_VARIABLES)
start_timeline(timeline, label)
start_timeline(timeline, label_or_idx)
return null
# Otherwise make sure there is a style active.
@ -185,10 +194,12 @@ func start(timeline:Variant, label:Variant="") -> Node:
scene.show()
if not scene.is_node_ready():
scene.ready.connect(clear.bind(ClearFlags.KEEP_VARIABLES))
scene.ready.connect(start_timeline.bind(timeline, label))
if not scene.ready.is_connected(clear.bind(ClearFlags.KEEP_VARIABLES)):
scene.ready.connect(clear.bind(ClearFlags.KEEP_VARIABLES))
if not scene.ready.is_connected(start_timeline.bind(timeline, label_or_idx)):
scene.ready.connect(start_timeline.bind(timeline, label_or_idx))
else:
start_timeline(timeline, label)
start_timeline(timeline, label_or_idx)
return scene
@ -198,12 +209,12 @@ func start(timeline:Variant, label:Variant="") -> Node:
## @label_or_idx can be a label (string) or index (int) to skip to immediatly.
func start_timeline(timeline:Variant, label_or_idx:Variant = "") -> void:
# load the resource if only the path is given
if typeof(timeline) == TYPE_STRING:
if typeof(timeline) in [TYPE_STRING, TYPE_STRING_NAME]:
#check the lookup table if it's not a full file name
if (timeline as String).contains("res://"):
timeline = load((timeline as String))
if "://" in timeline:
timeline = load(timeline)
else:
timeline = DialogicResourceUtil.get_timeline_resource((timeline as String))
timeline = DialogicResourceUtil.get_timeline_resource(timeline)
if timeline == null:
printerr("[Dialogic] There was an error loading this timeline. Check the filename, and the timeline for errors")
@ -217,7 +228,7 @@ func start_timeline(timeline:Variant, label_or_idx:Variant = "") -> void:
event.dialogic = self
current_event_idx = -1
if typeof(label_or_idx) == TYPE_STRING:
if typeof(label_or_idx) in [TYPE_STRING, TYPE_STRING_NAME]:
if label_or_idx:
if has_subsystem('Jump'):
Jump.jump_to_label((label_or_idx as String))
@ -225,7 +236,9 @@ func start_timeline(timeline:Variant, label_or_idx:Variant = "") -> void:
if label_or_idx >-1:
current_event_idx = label_or_idx -1
timeline_started.emit()
if not current_timeline == dialog_ending_timeline:
timeline_started.emit()
handle_next_event()
@ -233,8 +246,12 @@ func start_timeline(timeline:Variant, label_or_idx:Variant = "") -> void:
## [param timeline_resource] can be either a path (string) or a loaded timeline (resource)
func preload_timeline(timeline_resource:Variant) -> Variant:
# I think ideally this should be on a new thread, will test
if typeof(timeline_resource) == TYPE_STRING:
timeline_resource = load((timeline_resource as String))
if typeof(timeline_resource) in [TYPE_STRING, TYPE_STRING_NAME]:
if "://" in timeline_resource:
timeline_resource = load(timeline_resource)
else:
timeline_resource = DialogicResourceUtil.get_timeline_resource(timeline_resource)
if timeline_resource == null:
printerr("[Dialogic] There was an error preloading this timeline. Check the filename, and the timeline for errors")
return null
@ -245,12 +262,37 @@ func preload_timeline(timeline_resource:Variant) -> Variant:
## Clears and stops the current timeline.
func end_timeline() -> void:
## If [param skip_ending] is `true`, the dialog_ending_timeline is not getting played
func end_timeline(skip_ending := false) -> void:
if not skip_ending and dialog_ending_timeline and current_timeline != dialog_ending_timeline:
start(dialog_ending_timeline)
return
await clear(ClearFlags.TIMELINE_INFO_ONLY)
_on_timeline_ended()
if Styles.has_active_layout_node() and Styles.get_layout_node().is_inside_tree():
match ProjectSettings.get_setting('dialogic/layout/end_behaviour', 0):
0:
Styles.get_layout_node().get_parent().remove_child(Styles.get_layout_node())
Styles.get_layout_node().queue_free()
1:
Styles.get_layout_node().hide()
timeline_ended.emit()
## Method to check if timeline exists.
## @timeline can be either a loaded timeline resource or a path to a timeline file.
func timeline_exists(timeline:Variant) -> bool:
if typeof(timeline) in [TYPE_STRING, TYPE_STRING_NAME]:
if "://" in timeline and ResourceLoader.exists(timeline):
return load(timeline) is DialogicTimeline
else:
return DialogicResourceUtil.timeline_resource_exists(timeline)
return timeline is DialogicTimeline
## Handles the next event.
func handle_next_event(_ignore_argument: Variant = "") -> void:
handle_event(current_event_idx+1)
@ -271,6 +313,7 @@ func handle_event(event_index:int) -> void:
end_timeline()
return
# TODO: Check if necessary. This should be impossible.
#actually process the event now, since we didnt earlier at runtime
#this needs to happen before we create the copy DialogicEvent variable, so it doesn't throw an error if not ready
if current_timeline_events[event_index].event_node_ready == false:
@ -370,7 +413,7 @@ func load_full_state(state_info:Dictionary) -> void:
if current_state_info.get('current_timeline', null):
start_timeline(current_state_info.current_timeline, current_state_info.get('current_event_idx', 0))
else:
end_timeline.call_deferred()
end_timeline.call_deferred(true)
#endregion
@ -415,22 +458,12 @@ func add_subsystem(subsystem_name:String, script_path:String) -> DialogicSubsyst
#region HELPERS
################################################################################
## This handles the `Layout End Behaviour` setting that can be changed in the Dialogic settings.
func _on_timeline_ended() -> void:
if self.Styles.has_active_layout_node() and self.Styles.get_layout_node().is_inside_tree():
match ProjectSettings.get_setting('dialogic/layout/end_behaviour', 0):
0:
self.Styles.get_layout_node().get_parent().remove_child(self.Styles.get_layout_node())
self.Styles.get_layout_node().queue_free()
1:
@warning_ignore("unsafe_method_access")
self.Styles.get_layout_node().hide()
func print_debug_moment() -> void:
if not current_timeline:
return
printerr("\tAt event ", current_event_idx+1, " (",current_timeline_events[current_event_idx].event_name, ' Event) in timeline "', DialogicResourceUtil.get_unique_identifier(current_timeline.resource_path), '" (',current_timeline.resource_path,').')
printerr("\tAt event ", current_event_idx+1, " (",current_timeline_events[current_event_idx].event_name, ' Event) in timeline "', current_timeline.get_identifier(), '" (',current_timeline.resource_path,').')
print("\n")
#endregion

View file

@ -1 +1 @@
uid://dwg1hpegqijbk
uid://ds2q0uclmolvu

View file

@ -3,6 +3,7 @@ class_name DialogicResourceUtil
static var label_cache := {}
static var event_cache: Array[DialogicEvent] = []
static var channel_cache := {}
static var special_resources := {}
@ -11,6 +12,8 @@ static func update() -> void:
update_directory('.dch')
update_directory('.dtl')
update_label_cache()
update_audio_channel_cache()
DialogicStylesUtil.build_style_directory()
#region RESOURCE DIRECTORIES
@ -53,30 +56,54 @@ static func update_directory(extension:String) -> void:
static func add_resource_to_directory(file_path:String, directory:Dictionary) -> Dictionary:
var suggested_name := file_path.get_file().trim_suffix("."+file_path.get_extension())
var temp := suggested_name
while suggested_name in directory:
suggested_name = file_path.trim_suffix("/"+suggested_name+"."+file_path.get_extension()).get_file().path_join(suggested_name)
if suggested_name == temp:
break
temp = suggested_name
directory[suggested_name] = file_path
return directory
## Returns the unique identifier for the given resource path.
## Returns an empty string if no identifier was found.
static func get_unique_identifier(file_path:String) -> String:
var identifier: String = get_directory(file_path.get_extension()).find_key(file_path)
static func get_unique_identifier_by_path(file_path:String) -> String:
if not file_path: return ""
var identifier: Variant = get_directory(file_path.get_extension()).find_key(file_path)
if typeof(identifier) == TYPE_STRING:
return identifier
return ""
static func get_resource_path_from_identifier(identifier:String, extension:String) -> String:
var value: Variant = get_directory(extension).get(identifier, '')
if value is String:
return value
return ""
## Returns the resource associated with the given unique identifier.
## The expected extension is needed to use the right directory.
static func get_resource_from_identifier(identifier:String, extension:String) -> Resource:
var path: String = get_directory(extension).get(identifier, '')
if ResourceLoader.exists(path):
return load(path)
var value: Variant = get_directory(extension).get(identifier, '')
if typeof(value) == TYPE_STRING and ResourceLoader.exists(value):
return load(value)
elif value is Resource:
return value
return null
## Returns a boolean that expresses whether the resource exists.
## The expected extension is needed to use the right directory.
static func resource_exists_from_identifier(identifier:String, extension:String) -> bool:
var value: Variant = get_directory(extension).get(identifier, '')
if typeof(value) == TYPE_STRING:
return ResourceLoader.exists(value)
return value is Resource
## Editor Only
static func change_unique_identifier(file_path:String, new_identifier:String) -> void:
var directory := get_directory(file_path.get_extension())
var key: String = directory.find_key(file_path)
@ -110,6 +137,21 @@ static func remove_resource(file_path:String) -> void:
static func is_identifier_unused(extension:String, identifier:String) -> bool:
return not identifier in get_directory(extension)
## While usually the directory maps identifiers to paths, this method (only supposed to be used at runtime)
## allows mapping resources that are not saved to an identifier.
static func register_runtime_resource(resource:Resource, identifier:String, extension:String) -> void:
var directory := get_directory(extension)
directory[identifier] = resource
set_directory(extension, directory)
static func get_runtime_unique_identifier(resource:Resource, extension:String) -> String:
var identifier: Variant = get_directory(extension).find_key(resource)
if typeof(identifier) == TYPE_STRING:
return identifier
return ""
#endregion
#region LABEL CACHE
@ -139,6 +181,45 @@ static func update_label_cache() -> void:
#endregion
#region AUDIO CHANNEL CACHE
################################################################################
# The audio channel cache is only for the editor so we don't have to scan all timelines
# whenever we want to suggest channels. This has no use in game and is not always perfect.
static func get_audio_channel_cache() -> Dictionary:
if not channel_cache.is_empty():
return channel_cache
channel_cache = DialogicUtil.get_editor_setting('channel_ref', {})
return channel_cache
static func get_channel_list() -> Array:
if channel_cache.is_empty():
return []
var cached_names := []
for timeline in channel_cache:
for name in channel_cache[timeline]:
if not cached_names.has(name):
cached_names.append(name)
return cached_names
static func set_audio_channel_cache(cache:Dictionary) -> void:
channel_cache = cache
static func update_audio_channel_cache() -> void:
var cache := get_audio_channel_cache()
var timelines := get_timeline_directory().values()
for timeline in cache:
if !timeline in timelines:
cache.erase(timeline)
set_audio_channel_cache(cache)
#endregion
#region EVENT CACHE
################################################################################
@ -260,6 +341,10 @@ static func get_timeline_directory() -> Dictionary:
return get_directory('dtl')
static func timeline_resource_exists(timeline_identifier:String) -> bool:
return resource_exists_from_identifier(timeline_identifier, 'dtl')
static func get_timeline_resource(timeline_identifier:String) -> DialogicTimeline:
return get_resource_from_identifier(timeline_identifier, 'dtl')
@ -275,7 +360,7 @@ static func list_resources_of_type(extension:String) -> Array:
static func scan_folder(path:String, extension:String) -> Array:
var list: Array = []
if DirAccess.dir_exists_absolute(path):
if DirAccess.dir_exists_absolute(path) and not FileAccess.file_exists(path + "/" + ".gdignore"):
var dir := DirAccess.open(path)
dir.list_dir_begin()
var file_name := dir.get_next()

View file

@ -1 +1 @@
uid://dsn41e1wjwfp4
uid://bdt5bbxxkvab4

View file

@ -9,7 +9,9 @@ class_name DialogicUtil
## This method should be used instead of EditorInterface.get_editor_scale(), because if you use that
## it will run perfectly fine from the editor, but crash when the game is exported.
static func get_editor_scale() -> float:
return get_dialogic_plugin().get_editor_interface().get_editor_scale()
if Engine.is_editor_hint():
return get_dialogic_plugin().get_editor_interface().get_editor_scale()
return 1.0
## Although this does in fact always return a EditorPlugin node,
@ -77,11 +79,19 @@ static func _update_autoload_subsystem_access() -> void:
var script: Script = load("res://addons/dialogic/Core/DialogicGameHandler.gd")
var new_subsystem_access_list := "#region SUBSYSTEMS\n"
var subsystems_sorted := []
for indexer: DialogicIndexer in get_indexers(true, true):
for subsystem: Dictionary in indexer._get_subsystems().duplicate(true):
new_subsystem_access_list += '\nvar {name} := preload("{script}").new():\n\tget: return get_subsystem("{name}")\n'.format(subsystem)
subsystems_sorted.append(subsystem)
subsystems_sorted.sort_custom(func (a: Dictionary, b: Dictionary) -> bool:
return a.name < b.name
)
for subsystem: Dictionary in subsystems_sorted:
new_subsystem_access_list += '\nvar {name} := preload("{script}").new():\n\tget: return get_subsystem("{name}")\n'.format(subsystem)
new_subsystem_access_list += "\n#endregion"
script.source_code = RegEx.create_from_string(r"#region SUBSYSTEMS\n#*\n((?!#endregion)(.*\n))*#endregion").sub(script.source_code, new_subsystem_access_list)
@ -90,11 +100,10 @@ static func _update_autoload_subsystem_access() -> void:
static func get_indexers(include_custom := true, force_reload := false) -> Array[DialogicIndexer]:
if Engine.get_main_loop().has_meta('dialogic_indexers') and !force_reload:
if Engine.get_main_loop().has_meta('dialogic_indexers') and not force_reload:
return Engine.get_main_loop().get_meta('dialogic_indexers')
var indexers: Array[DialogicIndexer] = []
for file in listdir(DialogicUtil.get_module_path(''), false):
var possible_script: String = DialogicUtil.get_module_path(file).path_join("index.gd")
if ResourceLoader.exists(possible_script):
@ -287,40 +296,6 @@ static func _get_value_in_dictionary(path:String, dictionary:Dictionary, default
#endregion
#region STYLES
################################################################################
static func get_default_layout_base() -> PackedScene:
return load(DialogicUtil.get_module_path('DefaultLayoutParts').path_join("Base_Default/default_layout_base.tscn"))
static func get_fallback_style() -> DialogicStyle:
return load(DialogicUtil.get_module_path('DefaultLayoutParts').path_join("Style_VN_Default/default_vn_style.tres"))
static func get_default_style() -> DialogicStyle:
var default: String = ProjectSettings.get_setting('dialogic/layout/default_style', '')
if !ResourceLoader.exists(default):
return get_fallback_style()
return load(default)
static func get_style_by_name(name:String) -> DialogicStyle:
if name.is_empty():
return get_default_style()
var styles: Array = ProjectSettings.get_setting('dialogic/layout/style_list', [])
for style in styles:
if not ResourceLoader.exists(style):
continue
if load(style).name == name:
return load(style)
return get_default_style()
#endregion
#region SCENE EXPORT OVERRIDES
################################################################################
@ -458,39 +433,53 @@ static func setup_script_property_edit_node(property_info: Dictionary, value:Var
input.select(value)
input.item_selected.connect(DialogicUtil._on_export_int_enum_submitted.bind(property_info.name, property_changed))
else:
input = SpinBox.new()
input.value_changed.connect(DialogicUtil._on_export_number_submitted.bind(property_info.name, property_changed))
if property_info.hint_string == 'int':
input.step = 1
input.allow_greater = true
input.allow_lesser = true
elif ',' in property_info.hint_string:
input = load("res://addons/dialogic/Editor/Events/Fields/field_number.tscn").instantiate()
input.property_name = property_info['name']
input.use_int_mode()
if ',' in property_info.hint_string:
input.min_value = int(property_info.hint_string.get_slice(',', 0))
input.max_value = int(property_info.hint_string.get_slice(',', 1))
if property_info.hint_string.count(',') > 1:
input.step = int(property_info.hint_string.get_slice(',', 2))
else:
input.step = 1
input.max_value = INF
input.min_value = -INF
if value != null:
input.value = value
input.set_value(value)
input.value_changed.connect(DialogicUtil._on_export_number_submitted.bind(property_changed))
TYPE_FLOAT:
input = SpinBox.new()
input = load("res://addons/dialogic/Editor/Events/Fields/field_number.tscn").instantiate()
input.property_name = property_info['name']
input.use_float_mode()
input.step = 0.01
if ',' in property_info.hint_string:
input.min_value = float(property_info.hint_string.get_slice(',', 0))
input.max_value = float(property_info.hint_string.get_slice(',', 1))
if property_info.hint_string.count(',') > 1:
input.step = float(property_info.hint_string.get_slice(',', 2))
input.value_changed.connect(DialogicUtil._on_export_number_submitted.bind(property_info.name, property_changed))
if value != null:
input.value = value
input.set_value(value)
input.value_changed.connect(DialogicUtil._on_export_number_submitted.bind(property_changed))
TYPE_VECTOR2, TYPE_VECTOR3, TYPE_VECTOR4:
var vectorSize: String = type_string(typeof(value))[-1]
input = load("res://addons/dialogic/Editor/Events/Fields/field_vector" + vectorSize + ".tscn").instantiate()
input.property_name = property_info['name']
input.set_value(value)
input.value_changed.connect(DialogicUtil._on_export_vector_submitted.bind(property_changed))
TYPE_VECTOR2I, TYPE_VECTOR3I, TYPE_VECTOR4I:
var vectorSize: String = type_string(typeof(value))[-2]
input = load("res://addons/dialogic/Editor/Events/Fields/field_vector" + vectorSize + ".tscn").instantiate()
input.step = 1
input.property_name = property_info['name']
input.set_value(value)
input.value_changed.connect(DialogicUtil._on_export_vectori_submitted.bind(property_changed))
TYPE_STRING:
if property_info['hint'] & PROPERTY_HINT_FILE or property_info['hint'] & PROPERTY_HINT_DIR:
input = load("res://addons/dialogic/Editor/Events/Fields/field_file.tscn").instantiate()
input.show_editing_button = true
input.file_filter = property_info['hint_string']
input.file_mode = FileDialog.FILE_MODE_OPEN_FILE
if property_info['hint'] == PROPERTY_HINT_DIR:
@ -518,6 +507,7 @@ static func setup_script_property_edit_node(property_info: Dictionary, value:Var
TYPE_DICTIONARY:
input = load("res://addons/dialogic/Editor/Events/Fields/field_dictionary.tscn").instantiate()
input.property_name = property_info["name"]
input.set_value(value)
input.value_changed.connect(_on_export_dict_submitted.bind(property_changed))
TYPE_OBJECT:
input = load("res://addons/dialogic/Editor/Common/hint_tooltip_icon.tscn").instantiate()
@ -543,7 +533,7 @@ static func _on_export_color_submitted(color:Color, property_name:String, callab
static func _on_export_int_enum_submitted(item:int, property_name:String, callable: Callable) -> void:
callable.call(property_name, var_to_str(item))
static func _on_export_number_submitted(value:float, property_name:String, callable: Callable) -> void:
static func _on_export_number_submitted(property_name:String, value:float, callable: Callable) -> void:
callable.call(property_name, var_to_str(value))
static func _on_export_file_submitted(property_name:String, value:String, callable: Callable) -> void:
@ -555,6 +545,13 @@ static func _on_export_string_enum_submitted(value:int, property_name:String, li
static func _on_export_vector_submitted(property_name:String, value:Variant, callable: Callable) -> void:
callable.call(property_name, var_to_str(value))
static func _on_export_vectori_submitted(property_name:String, value:Variant, callable: Callable) -> void:
match typeof(value):
TYPE_VECTOR2: value = Vector2i(value)
TYPE_VECTOR3: value = Vector3i(value)
TYPE_VECTOR4: value = Vector4i(value)
callable.call(property_name, var_to_str(value))
static func _on_export_dict_submitted(property_name:String, value:Variant, callable: Callable) -> void:
callable.call(property_name, var_to_str(value))
@ -674,3 +671,133 @@ static func get_portrait_position_suggestions(search_text := "") -> Dictionary:
suggestions.erase(search_text)
return suggestions
static func get_autoload_suggestions(filter:String="") -> Dictionary:
var suggestions := {}
for prop in ProjectSettings.get_property_list():
if prop.name.begins_with('autoload/'):
var some_autoload: String = prop.name.trim_prefix('autoload/')
suggestions[some_autoload] = {'value': some_autoload, 'tooltip':some_autoload, 'editor_icon': ["Node", "EditorIcons"]}
if filter.begins_with(some_autoload):
suggestions[filter] = {'value': filter, 'editor_icon':["GuiScrollArrowRight", "EditorIcons"]}
return suggestions
static func get_autoload_script_resource(autoload_name:String) -> Script:
var script: Script
if autoload_name and ProjectSettings.has_setting('autoload/'+autoload_name):
var loaded_autoload := load(ProjectSettings.get_setting('autoload/'+autoload_name).trim_prefix('*'))
if loaded_autoload is PackedScene:
var packed_scene: PackedScene = loaded_autoload
script = packed_scene.instantiate().get_script()
else:
script = loaded_autoload
return script
static func get_autoload_method_suggestions(filter:String, autoload_name:String) -> Dictionary:
var suggestions := {}
var script := get_autoload_script_resource(autoload_name)
if script:
for script_method in script.get_script_method_list():
if script_method.name.begins_with('@') or script_method.name.begins_with('_'):
continue
suggestions[script_method.name] = {'value': script_method.name, 'tooltip':script_method.name, 'editor_icon': ["Callable", "EditorIcons"]}
if not filter.is_empty():
suggestions[filter] = {'value': filter, 'editor_icon':["GuiScrollArrowRight", "EditorIcons"]}
return suggestions
static func get_autoload_property_suggestions(_filter:String, autoload_name:String) -> Dictionary:
var suggestions := {}
var script := get_autoload_script_resource(autoload_name)
if script:
for property in script.get_script_property_list():
if property.name.ends_with('.gd') or property.name.begins_with('_'):
continue
suggestions[property.name] = {'value': property.name, 'tooltip':property.name, 'editor_icon': ["MemberProperty", "EditorIcons"]}
return suggestions
static func get_audio_bus_suggestions(_filter:= "") -> Dictionary:
var bus_name_list := {}
for i in range(AudioServer.bus_count):
if i == 0:
bus_name_list[AudioServer.get_bus_name(i)] = {'value':''}
else:
bus_name_list[AudioServer.get_bus_name(i)] = {'value':AudioServer.get_bus_name(i)}
return bus_name_list
static func get_audio_channel_suggestions(_search_text:String) -> Dictionary:
var suggestions := {}
var channel_defaults := DialogicUtil.get_audio_channel_defaults()
var cached_names := DialogicResourceUtil.get_channel_list()
for i in channel_defaults.keys():
if not cached_names.has(i):
cached_names.append(i)
cached_names.sort()
for i in cached_names:
if i.is_empty():
continue
suggestions[i] = {'value': i}
if i in channel_defaults.keys():
suggestions[i]["editor_icon"] = ["ProjectList", "EditorIcons"]
suggestions[i]["tooltip"] = "A default channel defined in the settings."
else:
suggestions[i]["editor_icon"] = ["AudioStreamPlayer", "EditorIcons"]
suggestions[i]["tooltip"] = "A temporary channel without defaults."
return suggestions
static func get_audio_channel_defaults() -> Dictionary:
return ProjectSettings.get_setting('dialogic/audio/channel_defaults', {
"": {
'volume': 0.0,
'audio_bus': '',
'fade_length': 0.0,
'loop': false,
},
"music": {
'volume': 0.0,
'audio_bus': '',
'fade_length': 0.0,
'loop': true,
}})
static func validate_audio_channel_name(text: String) -> Dictionary:
var result := {}
var channel_name_regex := RegEx.create_from_string(r'(?<dash_only>^-$)|(?<invalid>[^\w-]{1})')
var matches := channel_name_regex.search_all(text)
var invalid_chars := []
for regex_match in matches:
if regex_match.get_string('dash_only'):
result['error_tooltip'] = "Channel name cannot be '-'."
result['valid_text'] = ''
else:
var invalid_char = regex_match.get_string('invalid')
if not invalid_char in invalid_chars:
invalid_chars.append(invalid_char)
if invalid_chars:
result['valid_text'] = channel_name_regex.sub(text, '', true)
result['error_tooltip'] = "Channel names cannot contain the following characters: " + "".join(invalid_chars)
return result

View file

@ -1 +1 @@
uid://7bp2a34fvy0d
uid://c848iwoo6mnms

View file

@ -1 +1 @@
uid://b7qj1lgysmwlc
uid://d4iojsqnbdphm

View file

@ -78,7 +78,7 @@ func list_dir(subdir:='') -> Array:
func list_special_resources(subdir:='', extension:="") -> Dictionary:
var dict := {}
for i in list_dir(subdir):
if extension.is_empty() or i.ends_with(extension):
if extension.is_empty() or i.ends_with(extension) or (extension == ".gd" and i.ends_with(".gdc")):
dict[DialogicUtil.pretty_name(i).to_lower()] = {"path":i}
return dict

View file

@ -1 +1 @@
uid://d06pvy04nmmby
uid://ciwsx3rjhhmg7

View file

@ -1 +1 @@
uid://drwfgv17x3478
uid://bcsda7vbawlgv

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://cfcs7lb6gqnmd"]
[ext_resource type="Script" uid="uid://drwfgv17x3478" path="res://addons/dialogic/Editor/CharacterEditor/char_edit_p_section_exports.gd" id="1_isys8"]
[ext_resource type="Script" uid="uid://bcsda7vbawlgv" path="res://addons/dialogic/Editor/CharacterEditor/char_edit_p_section_exports.gd" id="1_isys8"]
[node name="Settings" type="VBoxContainer"]
custom_minimum_size = Vector2(0, 35)

View file

@ -10,13 +10,13 @@ func _get_title() -> String:
func _load_portrait_data(data:Dictionary) -> void:
%IgnoreScale.set_pressed_no_signal(data.get('ignore_char_scale', false))
%PortraitScale.value = data.get('scale', 1.0)*100
%PortraitScale.set_value(data.get('scale', 1.0)*100)
%PortraitOffset.set_value(data.get('offset', Vector2()))
%PortraitOffset._load_display_info({'step':1})
%PortraitMirror.set_pressed_no_signal(data.get('mirror', false))
func _on_portrait_scale_value_changed(value:float) -> void:
func _on_portrait_scale_value_changed(_property:String, value:float) -> void:
var data: Dictionary = selected_item.get_metadata(0)
data['scale'] = value/100.0
update_preview.emit()
@ -37,7 +37,7 @@ func _on_ignore_scale_toggled(button_pressed:bool) -> void:
changed.emit()
func _on_portrait_offset_value_changed(property:String, value:Vector2) -> void:
func _on_portrait_offset_value_changed(_property:String, value:Vector2) -> void:
var data: Dictionary = selected_item.get_metadata(0)
data['offset'] = value
update_preview.emit()

View file

@ -1 +1 @@
uid://kq0tngakxiwn
uid://uv6dx3sofwae

View file

@ -1,7 +1,8 @@
[gd_scene load_steps=3 format=3 uid="uid://crke8suvv52c6"]
[gd_scene load_steps=4 format=3 uid="uid://crke8suvv52c6"]
[ext_resource type="Script" uid="uid://kq0tngakxiwn" path="res://addons/dialogic/Editor/CharacterEditor/char_edit_p_section_layout.gd" id="1_76vf2"]
[ext_resource type="Script" uid="uid://uv6dx3sofwae" path="res://addons/dialogic/Editor/CharacterEditor/char_edit_p_section_layout.gd" id="1_76vf2"]
[ext_resource type="PackedScene" uid="uid://dtimnsj014cu" path="res://addons/dialogic/Editor/Events/Fields/field_vector2.tscn" id="2_c8kyi"]
[ext_resource type="PackedScene" uid="uid://kdpp3mibml33" path="res://addons/dialogic/Editor/Events/Fields/field_number.tscn" id="2_daw3l"]
[node name="Layout" type="HFlowContainer"]
offset_right = 428.0
@ -25,13 +26,13 @@ layout_mode = 2
layout_mode = 2
text = "Scale:"
[node name="PortraitScale" type="SpinBox" parent="HBoxContainer"]
[node name="PortraitScale" parent="HBoxContainer" instance=ExtResource("2_daw3l")]
unique_name_in_owner = true
layout_mode = 2
tooltip_text = "A scale to be applied on top of the main scale
(unless ignore main scale is pressed)."
value = 100.0
allow_greater = true
mode = 1
step = 1.0
min_value = 0.0
max_value = 100.0
suffix = "%"
[node name="HBoxContainer2" type="HBoxContainer" parent="."]

View file

@ -1 +1 @@
uid://b2026s2q7x8d4
uid://busjn8oo7kl1s

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=6 format=3 uid="uid://djq4aasoihexj"]
[ext_resource type="Script" uid="uid://b2026s2q7x8d4" path="res://addons/dialogic/Editor/CharacterEditor/char_edit_p_section_main.gd" id="1_ht8lu"]
[ext_resource type="Script" uid="uid://busjn8oo7kl1s" path="res://addons/dialogic/Editor/CharacterEditor/char_edit_p_section_main.gd" id="1_ht8lu"]
[ext_resource type="PackedScene" uid="uid://7mvxuaulctcq" path="res://addons/dialogic/Editor/Events/Fields/field_file.tscn" id="2_k8xs0"]
[ext_resource type="PackedScene" uid="uid://b1wn8r84uh11b" path="res://addons/dialogic/Editor/CharacterEditor/portrait_scene_browser.tscn" id="3_ngvgq"]

View file

@ -1 +1 @@
uid://tmtk8wwimgxt
uid://cp0o6sycac85b

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://ba5w02lm3ewkj"]
[ext_resource type="Script" uid="uid://tmtk8wwimgxt" path="res://addons/dialogic/Editor/CharacterEditor/char_edit_p_section_main_exports.gd" id="1_mttrr"]
[ext_resource type="Script" uid="uid://cp0o6sycac85b" path="res://addons/dialogic/Editor/CharacterEditor/char_edit_p_section_main_exports.gd" id="1_mttrr"]
[node name="MainExports" type="VBoxContainer"]
offset_right = 374.0

View file

@ -1 +1 @@
uid://ckh08sqv1a081
uid://c0nilv2pybryh

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=5 format=3 uid="uid://bnkck3hocbkk5"]
[ext_resource type="Script" uid="uid://ckh08sqv1a081" path="res://addons/dialogic/Editor/CharacterEditor/char_edit_section_general.gd" id="1_3e1i1"]
[ext_resource type="Script" uid="uid://c0nilv2pybryh" path="res://addons/dialogic/Editor/CharacterEditor/char_edit_section_general.gd" id="1_3e1i1"]
[ext_resource type="PackedScene" uid="uid://dbpkta2tjsqim" path="res://addons/dialogic/Editor/Common/hint_tooltip_icon.tscn" id="2_cxfqm"]
[sub_resource type="Image" id="Image_ywoka"]

View file

@ -19,7 +19,7 @@ func _ready() -> void:
# Setting up Default Portrait Picker
%DefaultPortraitPicker.resource_icon = load("res://addons/dialogic/Editor/Images/Resources/portrait.svg")
%DefaultPortraitPicker.get_suggestions_func = suggest_portraits
%DefaultPortraitPicker.suggestions_func = suggest_portraits
## Make sure preview get's updated when portrait settings change
@ -33,7 +33,7 @@ func main_portrait_settings_update(_something=null, _value=null) -> void:
character_editor.something_changed()
func default_portrait_changed(property:String, value:String) -> void:
func default_portrait_changed(_property:String, value:String) -> void:
character_editor.current_resource.default_portrait = value
character_editor.update_default_portrait_star(value)
@ -47,7 +47,7 @@ func _load_character(resource:DialogicCharacter) -> void:
loading = true
%DefaultPortraitPicker.set_value(resource.default_portrait)
%MainScale.value = 100*resource.scale
%MainScale.set_value(100*resource.scale)
%MainOffset.set_value(resource.offset)
%MainMirror.button_pressed = resource.mirror
loading = false
@ -69,9 +69,8 @@ func _save_changes(resource:DialogicCharacter) -> DialogicCharacter:
## Get suggestions for DefaultPortraitPicker
func suggest_portraits(search:String) -> Dictionary:
func suggest_portraits(_search:String) -> Dictionary:
var suggestions := {}
for portrait in character_editor.get_updated_portrait_dict().keys():
suggestions[portrait] = {'value':portrait}
return suggestions

View file

@ -1 +1 @@
uid://0pki4ffx8ix4
uid://yulfiomudcob

View file

@ -1,8 +1,9 @@
[gd_scene load_steps=4 format=3 uid="uid://cmrgbo8qi145o"]
[gd_scene load_steps=5 format=3 uid="uid://cmrgbo8qi145o"]
[ext_resource type="Script" uid="uid://0pki4ffx8ix4" path="res://addons/dialogic/Editor/CharacterEditor/char_edit_section_portraits.gd" id="1_6sxsl"]
[ext_resource type="Script" uid="uid://yulfiomudcob" path="res://addons/dialogic/Editor/CharacterEditor/char_edit_section_portraits.gd" id="1_6sxsl"]
[ext_resource type="PackedScene" uid="uid://dpwhshre1n4t6" path="res://addons/dialogic/Editor/Events/Fields/field_options_dynamic.tscn" id="2_birla"]
[ext_resource type="PackedScene" uid="uid://dtimnsj014cu" path="res://addons/dialogic/Editor/Events/Fields/field_vector2.tscn" id="3_vcvin"]
[ext_resource type="PackedScene" uid="uid://kdpp3mibml33" path="res://addons/dialogic/Editor/Events/Fields/field_number.tscn" id="4_w4pvv"]
[node name="Portraits" type="GridContainer"]
offset_right = 453.0
@ -29,8 +30,9 @@ layout_mode = 2
size_flags_vertical = 0
text = "Main Scale"
[node name="MainScale" type="SpinBox" parent="."]
[node name="MainScaleOld" type="SpinBox" parent="."]
unique_name_in_owner = true
visible = false
layout_mode = 2
size_flags_horizontal = 8
value = 100.0
@ -38,6 +40,16 @@ allow_greater = true
alignment = 1
suffix = "%"
[node name="MainScale" parent="." instance=ExtResource("4_w4pvv")]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 8
mode = 1
step = 1.0
min_value = 0.0
max_value = 100.0
suffix = "%"
[node name="Label2" type="Label" parent="."]
layout_mode = 2
size_flags_vertical = 0

View file

@ -71,9 +71,9 @@ func _open_resource(resource:Resource) -> void:
load_portrait_tree()
loading = false
character_loaded.emit(resource.resource_path)
character_loaded.emit(current_resource.resource_path)
%CharacterName.text = DialogicResourceUtil.get_unique_identifier(resource.resource_path)
%CharacterName.text = current_resource.get_identifier()
$NoCharacterScreen.hide()
%PortraitChangeInfo.hide()
@ -119,6 +119,9 @@ func _save() -> void:
## Saves a new empty character to the given path
func new_character(path: String) -> void:
if not path.ends_with(".dch"):
path = path.trim_suffix(".")
path += ".dch"
var resource := DialogicCharacter.new()
resource.resource_path = path
resource.display_name = path.get_file().trim_suffix("."+path.get_extension())
@ -165,6 +168,7 @@ func _ready() -> void:
## Add general tabs
add_settings_section(load("res://addons/dialogic/Editor/CharacterEditor/char_edit_section_general.tscn").instantiate(), %MainSettingsSections)
add_settings_section(load("res://addons/dialogic/Editor/CharacterEditor/char_edit_section_portraits.tscn").instantiate(), %MainSettingsSections)
add_settings_section(load("res://addons/dialogic/Editor/CharacterEditor/character_prefix_suffix.tscn").instantiate(), %MainSettingsSections)
add_settings_section(load("res://addons/dialogic/Editor/CharacterEditor/char_edit_p_section_main_exports.tscn").instantiate(), %PortraitSettingsSection)
@ -188,10 +192,12 @@ func _ready() -> void:
func add_settings_section(edit:Control, parent:Node) -> void:
edit.changed.connect(something_changed)
edit.character_editor = self
if edit.has_signal('update_preview'):
edit.update_preview.connect(update_preview)
var button: Button
if edit._show_title():
var hbox := HBoxContainer.new()
hbox.name = edit._get_title()+"BOX"
@ -365,7 +371,7 @@ func add_portrait(portrait_name:String='New portrait', portrait_data:Dictionary=
func add_portrait_group() -> void:
var parent_item: TreeItem = %PortraitTree.get_root()
if %PortraitTree.get_selected() and %PortraitTree.get_selected().get_metadata(0).has('group'):
if %PortraitTree.get_selected() and %PortraitTree.get_selected().get_metadata(0) and %PortraitTree.get_selected().get_metadata(0).has('group'):
parent_item = %PortraitTree.get_selected()
var item: TreeItem = %PortraitTree.add_portrait_group("Group", parent_item)
item.set_meta('new', true)
@ -543,7 +549,7 @@ func report_name_change(item: TreeItem) -> void:
editors_manager.reference_manager.add_portrait_ref_change(
item.get_meta('previous_name'),
%PortraitTree.get_full_item_name(item),
[DialogicResourceUtil.get_unique_identifier(current_resource.resource_path)])
[current_resource.get_identifier()])
item.set_meta('previous_name', %PortraitTree.get_full_item_name(item))
%PortraitChangeInfo.show()

View file

@ -1 +1 @@
uid://b05ouwe0s28rb
uid://cwhe7tpe75oh7

View file

@ -1,8 +1,8 @@
[gd_scene load_steps=11 format=3 uid="uid://dlskc36c5hrwv"]
[ext_resource type="Script" uid="uid://b05ouwe0s28rb" path="res://addons/dialogic/Editor/CharacterEditor/character_editor.gd" id="2"]
[ext_resource type="Script" uid="uid://cwhe7tpe75oh7" path="res://addons/dialogic/Editor/CharacterEditor/character_editor.gd" id="2"]
[ext_resource type="PackedScene" uid="uid://dbpkta2tjsqim" path="res://addons/dialogic/Editor/Common/hint_tooltip_icon.tscn" id="2_uhhqs"]
[ext_resource type="Script" uid="uid://b0elpsugbconk" path="res://addons/dialogic/Editor/CharacterEditor/character_editor_portrait_tree.gd" id="2_vad0i"]
[ext_resource type="Script" uid="uid://deliic6d8vajo" path="res://addons/dialogic/Editor/CharacterEditor/character_editor_portrait_tree.gd" id="2_vad0i"]
[ext_resource type="Texture2D" uid="uid://babwe22dqjta" path="res://addons/dialogic/Editor/Images/Pieces/add-folder.svg" id="3_v1qnr"]
[sub_resource type="Image" id="Image_r5ayh"]

View file

@ -5,6 +5,7 @@ extends Control
## Base class for all character editor main sections. Methods should be overriden.
## Emit this, if something changed
@warning_ignore("unused_signal") # this is used by extending scripts
signal changed
## Reference to the character editor, set when instantiated
@ -30,7 +31,7 @@ func _start_opened() -> bool:
## Overwrite to load all the information from the character into this section.
func _load_character(resource:DialogicCharacter) -> void:
func _load_character(_resource:DialogicCharacter) -> void:
pass

View file

@ -1 +1 @@
uid://cm0wi5jwnqitc
uid://wltbab3qq63b

View file

@ -1 +1 @@
uid://d11n63mblxvlw
uid://ckblurnjla80i

View file

@ -1 +1 @@
uid://b0elpsugbconk
uid://deliic6d8vajo

View file

@ -0,0 +1,79 @@
@tool
class_name DialogicCharacterPrefixSuffixSection
extends DialogicCharacterEditorMainSection
## Character Editor Section for setting the prefix and suffix of a character.
##
## loads and sets the prefix and suffix of a character.
## Provides [const PREFIX_CUSTOM_KEY] and [const SUFFIX_CUSTOM_KEY] to
## access the `custom_info` dictionary of the [class DialogicCharacter].
@export var prefix_input: LineEdit
@export var suffix_input: LineEdit
## We won't force any prefixes or suffixes onto the player,
## to ensure their games are working as previously when updating.
const DEFAULT_PREFIX = ""
const DEFAULT_SUFFIX = ""
## `custom_info` dictionary keys for the prefix.
const PREFIX_CUSTOM_KEY = "prefix"
## `custom_info` dictionary keys for the prefix.
const SUFFIX_CUSTOM_KEY = "suffix"
var suffix := ""
var prefix := ""
func _ready() -> void:
suffix_input.text_changed.connect(_suffix_changed)
prefix_input.text_changed.connect(_prefix_changed)
func _suffix_changed(text: String) -> void:
suffix = text
func _prefix_changed(text: String) -> void:
prefix = text
func _get_title() -> String:
return "Character Prefix & Suffix"
func _show_title() -> bool:
return true
func _start_opened() -> bool:
return false
func _load_portrait_data(portrait_data: Dictionary) -> void:
_load_prefix_data(portrait_data)
## We load the prefix and suffix from the character's `custom_info` dictionary.
func _load_character(resource: DialogicCharacter) -> void:
_load_prefix_data(resource.custom_info)
func _load_prefix_data(data: Dictionary) -> void:
suffix = data.get(SUFFIX_CUSTOM_KEY, DEFAULT_SUFFIX)
prefix = data.get(PREFIX_CUSTOM_KEY, DEFAULT_PREFIX)
suffix_input.text = suffix
prefix_input.text = prefix
## Whenever the user makes a save to the character, we save the prefix and suffix.
func _save_changes(character: DialogicCharacter) -> DialogicCharacter:
if not character:
printerr("[Dialogic] Unable to save Prefix and Suffix, the character is missing.")
return character
character.custom_info[PREFIX_CUSTOM_KEY] = prefix
character.custom_info[SUFFIX_CUSTOM_KEY] = suffix
return character

View file

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

View file

@ -0,0 +1,48 @@
[gd_scene load_steps=3 format=3 uid="uid://1ctcs6ywjjtd"]
[ext_resource type="PackedScene" uid="uid://dbpkta2tjsqim" path="res://addons/dialogic/Editor/Common/hint_tooltip_icon.tscn" id="1_o3alv"]
[ext_resource type="Script" uid="uid://i1ujoar8jf80" path="res://addons/dialogic/Editor/CharacterEditor/character_prefix_suffix.gd" id="1_tkxff"]
[node name="CharacterPrefixSuffix" type="GridContainer" node_paths=PackedStringArray("prefix_input", "suffix_input")]
offset_right = 121.0
offset_bottom = 66.0
columns = 2
script = ExtResource("1_tkxff")
prefix_input = NodePath("PrefixInput")
suffix_input = NodePath("SuffixInput")
[node name="Prefix" type="HBoxContainer" parent="."]
layout_mode = 2
[node name="Label" type="Label" parent="Prefix"]
layout_mode = 2
text = "Prefix"
[node name="HintTooltip" parent="Prefix" instance=ExtResource("1_o3alv")]
layout_mode = 2
texture = null
hint_text = "If a character speaks, this appears before their text.
Example: Color Tags or Quotation Marks."
[node name="PrefixInput" type="LineEdit" parent="."]
layout_mode = 2
size_flags_horizontal = 3
caret_blink = true
[node name="Suffix" type="HBoxContainer" parent="."]
layout_mode = 2
[node name="Label" type="Label" parent="Suffix"]
layout_mode = 2
text = "Suffix"
[node name="HintTooltip" parent="Suffix" instance=ExtResource("1_o3alv")]
layout_mode = 2
texture = null
hint_text = "If a character speaks, this appears after their text.
Example: Color Tags or Quotation Marks."
[node name="SuffixInput" type="LineEdit" parent="."]
layout_mode = 2
size_flags_horizontal = 3
caret_blink = true

View file

@ -1 +1 @@
uid://duj68ruvoapq0
uid://iwv7qff6g0f0

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=11 format=3 uid="uid://b1wn8r84uh11b"]
[ext_resource type="Script" uid="uid://duj68ruvoapq0" path="res://addons/dialogic/Editor/CharacterEditor/portrait_scene_browser.gd" id="1_an6nc"]
[ext_resource type="Script" uid="uid://iwv7qff6g0f0" path="res://addons/dialogic/Editor/CharacterEditor/portrait_scene_browser.gd" id="1_an6nc"]
[sub_resource type="Gradient" id="Gradient_0o1u0"]
colors = PackedColorArray(0.100572, 0.303996, 0.476999, 1, 0.296448, 0.231485, 0.52887, 1)

View file

@ -1 +1 @@
uid://convbgmij84l4
uid://ckthmmkodqqwt

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=6 format=3 uid="uid://ddlxjde1cx035"]
[ext_resource type="Script" uid="uid://convbgmij84l4" path="res://addons/dialogic/Editor/Common/BrowserItem.gd" id="1_s3kf0"]
[ext_resource type="Script" uid="uid://ckthmmkodqqwt" path="res://addons/dialogic/Editor/Common/BrowserItem.gd" id="1_s3kf0"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_pfw08"]
bg_color = Color(1, 1, 1, 0.32549)

View file

@ -1 +1 @@
uid://cebtnppbckjw0
uid://m3ufop8ao16l

View file

@ -11,7 +11,7 @@ var item: TreeItem = null
func _ready() -> void:
hide()
%Character.resource_icon = load("res://addons/dialogic/Editor/Images/Resources/character.svg")
%Character.get_suggestions_func = get_character_suggestions
%Character.suggestions_func = get_character_suggestions
%WholeWords.icon = get_theme_icon("FontItem", "EditorIcons")
%MatchCase.icon = get_theme_icon("MatchCase", "EditorIcons")
@ -52,6 +52,9 @@ func open_existing(_item:TreeItem, info:Dictionary):
%Old.text = info.what
%New.text = info.forwhat
%MatchCase.button_pressed = info.case_sensitive
%WholeWords.button_pressed = info.whole_words
func _on_type_item_selected(index:int) -> void:
match index:
0:

View file

@ -1 +1 @@
uid://dx58wywm7min8
uid://dca6a1a74jfur

View file

@ -158,6 +158,8 @@ func display_search_results(finds:Array[Dictionary]) -> void:
%ReferenceTree.clear()
%ReferenceTree.set_column_expand(0, false)
%ReferenceTree.set_column_expand(1, false)
%ReferenceTree.set_column_custom_minimum_width(1, 50)
%ReferenceTree.create_item()
var timelines := {}
@ -166,20 +168,25 @@ func display_search_results(finds:Array[Dictionary]) -> void:
var parent: TreeItem = null
if !i.timeline in timelines:
parent = %ReferenceTree.create_item()
parent.set_text(1, i.timeline)
parent.set_custom_color(1, get_theme_color("disabled_font_color", "Editor"))
parent.set_text(0, i.timeline)
parent.set_custom_color(0, get_theme_color("disabled_font_color", "Editor"))
parent.set_expand_right(0, true)
timelines[i.timeline] = parent
height += %ReferenceTree.get_item_area_rect(parent).size.y+10
else:
parent = timelines[i.timeline]
var item: TreeItem = %ReferenceTree.create_item(parent)
item.set_text(1, 'Line '+str(i.line_number)+': '+i.line)
item.set_tooltip_text(1, i.info.what+' -> '+i.info.forwhat)
item.set_cell_mode(0, TreeItem.CELL_MODE_CHECK)
item.set_checked(0, true)
item.set_editable(0, true)
item.set_metadata(0, i)
item.set_text(1, str(i.line_number)+':')
item.set_text_alignment(1, HORIZONTAL_ALIGNMENT_RIGHT)
item.set_cell_mode(2, TreeItem.CELL_MODE_CUSTOM)
item.set_text(2, i.line)
item.set_tooltip_text(2, i.info.what+' -> '+i.info.forwhat)
item.set_custom_draw_callback(2, _custom_draw)
height += %ReferenceTree.get_item_area_rect(item).size.y+10
var change_item: TreeItem = i.info.item
change_item.set_meta('found_items', change_item.get_meta('found_items', [])+[item])
@ -194,6 +201,27 @@ func display_search_results(finds:Array[Dictionary]) -> void:
%Replace.grab_focus()
## Highlights the found text in the result tree
## Inspired by how godot highlights stuff in its search results
func _custom_draw(item:TreeItem, rect:Rect2) -> void:
var text := item.get_text(2)
var find: Dictionary = item.get_metadata(0)
var font: Font = %ReferenceTree.get_theme_font("font")
var font_size: int = %ReferenceTree.get_theme_font_size("font_size")
var match_rect := rect
var beginning_index: int = find.match.get_start("replace")-find.line_start-1
match_rect.position.x += font.get_string_size(text.left(beginning_index), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).x -1
match_rect.size.x = font.get_string_size(find.info.what, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).x + 1
match_rect.position.y += 1 * DialogicUtil.get_editor_scale()
match_rect.size.y -= 2 * DialogicUtil.get_editor_scale()
match_rect.position.x += 4
%ReferenceTree.draw_rect(match_rect, get_theme_color("highlight_color", "Editor"), true)
%ReferenceTree.draw_rect(match_rect, get_theme_color("box_selection_stroke_color", "Editor"), false)
func search_timelines(regexes:Array[Array]) -> Array[Dictionary]:
var finds: Array[Dictionary] = []

View file

@ -1 +1 @@
uid://cxy2bedubs15y
uid://nrhtjk2rgmgk

View file

@ -1 +1 @@
uid://b4bvwxge5p8qs
uid://b0vm440bs3ckd

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=4 format=3 uid="uid://dbpkta2tjsqim"]
[ext_resource type="Script" uid="uid://b4bvwxge5p8qs" path="res://addons/dialogic/Editor/Common/hint_tooltip_icon.gd" id="1_x8t45"]
[ext_resource type="Script" uid="uid://b0vm440bs3ckd" path="res://addons/dialogic/Editor/Common/hint_tooltip_icon.gd" id="1_x8t45"]
[sub_resource type="Image" id="Image_c5s34"]
data = {
@ -11,11 +11,11 @@ data = {
"width": 16
}
[sub_resource type="ImageTexture" id="ImageTexture_lseut"]
[sub_resource type="ImageTexture" id="ImageTexture_ydy7j"]
image = SubResource("Image_c5s34")
[node name="HintTooltip" type="TextureRect"]
modulate = Color(0, 0, 0, 1)
texture = SubResource("ImageTexture_lseut")
texture = SubResource("ImageTexture_ydy7j")
stretch_mode = 3
script = ExtResource("1_x8t45")

View file

@ -1 +1 @@
uid://d1163xkcv1c8w
uid://dugy11ebty3yq

View file

@ -1,14 +1,15 @@
[gd_scene load_steps=13 format=3 uid="uid://c7lmt5cp7bxcm"]
[gd_scene load_steps=14 format=3 uid="uid://c7lmt5cp7bxcm"]
[ext_resource type="Script" uid="uid://d1163xkcv1c8w" path="res://addons/dialogic/Editor/Common/reference_manager.gd" id="1_3t531"]
[ext_resource type="Script" uid="uid://cxy2bedubs15y" path="res://addons/dialogic/Editor/Common/broken_reference_manager.gd" id="1_agmg4"]
[ext_resource type="Script" uid="uid://dx58wywm7min8" path="res://addons/dialogic/Editor/Common/ReferenceManager_AddReplacementPanel.gd" id="2_tt4jd"]
[ext_resource type="Script" uid="uid://dugy11ebty3yq" path="res://addons/dialogic/Editor/Common/reference_manager.gd" id="1_3t531"]
[ext_resource type="Script" uid="uid://nrhtjk2rgmgk" path="res://addons/dialogic/Editor/Common/broken_reference_manager.gd" id="1_agmg4"]
[ext_resource type="Script" uid="uid://dca6a1a74jfur" path="res://addons/dialogic/Editor/Common/ReferenceManager_AddReplacementPanel.gd" id="2_tt4jd"]
[ext_resource type="PackedScene" uid="uid://dpwhshre1n4t6" path="res://addons/dialogic/Editor/Events/Fields/field_options_dynamic.tscn" id="3_yomsc"]
[ext_resource type="Script" uid="uid://dwkxd7m2p2lkj" path="res://addons/dialogic/Editor/Common/unique_identifiers_manager.gd" id="5_wnvbq"]
[ext_resource type="PackedScene" uid="uid://dbpkta2tjsqim" path="res://addons/dialogic/Editor/Common/hint_tooltip_icon.tscn" id="5_sdymt"]
[ext_resource type="Script" uid="uid://bvbsqai5sh0na" path="res://addons/dialogic/Editor/Common/unique_identifiers_manager.gd" id="5_wnvbq"]
[sub_resource type="ButtonGroup" id="ButtonGroup_l6uiy"]
[sub_resource type="Image" id="Image_n016d"]
[sub_resource type="Image" id="Image_pnutm"]
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, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 255, 224, 224, 224, 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, 224, 224, 224, 255, 224, 224, 224, 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, 224, 224, 224, 255, 224, 224, 224, 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, 224, 224, 224, 255, 224, 224, 224, 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, 224, 224, 224, 255, 224, 224, 224, 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, 224, 224, 224, 255, 224, 224, 224, 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, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 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, 224, 224, 224, 255, 224, 224, 224, 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, 224, 224, 224, 255, 224, 224, 224, 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, 224, 224, 224, 255, 224, 224, 224, 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, 224, 224, 224, 255, 224, 224, 224, 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, 224, 224, 224, 255, 224, 224, 224, 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, 224, 224, 224, 255, 224, 224, 224, 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, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0),
"format": "RGBA8",
@ -18,18 +19,6 @@ data = {
}
[sub_resource type="ImageTexture" id="ImageTexture_a0gfq"]
image = SubResource("Image_n016d")
[sub_resource type="Image" id="Image_pnutm"]
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="ImageTexture" id="ImageTexture_mr0fw"]
image = SubResource("Image_pnutm")
[sub_resource type="Image" id="Image_asrh0"]
@ -41,9 +30,21 @@ data = {
"width": 16
}
[sub_resource type="ImageTexture" id="ImageTexture_lce2m"]
[sub_resource type="ImageTexture" id="ImageTexture_2hc6a"]
image = SubResource("Image_asrh0")
[sub_resource type="Image" id="Image_xvpjt"]
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="ImageTexture" id="ImageTexture_lce2m"]
image = SubResource("Image_xvpjt")
[node name="Manager" type="PanelContainer"]
anchors_preset = 15
anchor_right = 1.0
@ -119,11 +120,10 @@ layout_mode = 2
[node name="Type" type="OptionButton" parent="Tabs/BrokenReferences/ChangesList/VBox/ReplacementEditPanel/VBox/HBoxContainer3"]
unique_name_in_owner = true
layout_mode = 2
tooltip_text = "This decides the regexes for searching. Pure text allows you to enter your own regex into into \"Old\". "
item_count = 5
tooltip_text = "This decides the regexes for searching. Pure text allows you to enter your own regex into \"Old\". "
selected = 0
item_count = 5
popup/item_0/text = "Pure Text"
popup/item_0/id = 0
popup/item_1/text = "Variable"
popup/item_1/id = 1
popup/item_2/text = "Portrait"
@ -163,14 +163,14 @@ unique_name_in_owner = true
layout_mode = 2
tooltip_text = "Match Case"
toggle_mode = true
icon = SubResource("ImageTexture_mr0fw")
icon = SubResource("ImageTexture_2hc6a")
[node name="WholeWords" type="Button" parent="Tabs/BrokenReferences/ChangesList/VBox/ReplacementEditPanel/VBox/PureTextFlags"]
unique_name_in_owner = true
layout_mode = 2
tooltip_text = "Whole World"
toggle_mode = true
icon = SubResource("ImageTexture_mr0fw")
icon = SubResource("ImageTexture_2hc6a")
[node name="HBoxContainer4" type="HBoxContainer" parent="Tabs/BrokenReferences/ChangesList/VBox/ReplacementEditPanel/VBox"]
layout_mode = 2
@ -178,11 +178,10 @@ layout_mode = 2
[node name="Where" type="OptionButton" parent="Tabs/BrokenReferences/ChangesList/VBox/ReplacementEditPanel/VBox/HBoxContainer4"]
unique_name_in_owner = true
layout_mode = 2
item_count = 3
selected = 0
fit_to_longest_item = false
item_count = 3
popup/item_0/text = "Everywhere"
popup/item_0/id = 0
popup/item_1/text = "Only for Character"
popup/item_1/id = 1
popup/item_2/text = "Texts only"
@ -247,7 +246,7 @@ unique_name_in_owner = true
layout_mode = 2
size_flags_vertical = 3
theme_override_constants/draw_relationship_lines = 1
columns = 2
columns = 3
hide_root = true
[node name="Progress" type="ProgressBar" parent="Tabs/BrokenReferences/ReplacementSection/FindList"]
@ -255,7 +254,11 @@ unique_name_in_owner = true
layout_mode = 2
max_value = 1.0
[node name="Replace" type="Button" parent="Tabs/BrokenReferences/ReplacementSection/FindList"]
[node name="HBoxContainer" type="HBoxContainer" parent="Tabs/BrokenReferences/ReplacementSection/FindList"]
layout_mode = 2
alignment = 1
[node name="Replace" type="Button" parent="Tabs/BrokenReferences/ReplacementSection/FindList/HBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 4
@ -263,6 +266,12 @@ tooltip_text = "Replace all selected findings (Careful, no undo!)"
text = "Replace Selected"
icon = SubResource("ImageTexture_lce2m")
[node name="HintTooltip" parent="Tabs/BrokenReferences/ReplacementSection/FindList/HBoxContainer" instance=ExtResource("5_sdymt")]
layout_mode = 2
texture = null
hint_text = "Note that searching and replacing is only implemented for timelines.
E.g. variables used in character display names or glossary entries will have to be replaced manually."
[node name="UniqueIdentifiers" type="PanelContainer" parent="Tabs"]
visible = false
layout_mode = 2
@ -317,7 +326,7 @@ uri = "https://docs.dialogic.pro/reference-manager.html"
[connection signal="button_clicked" from="Tabs/BrokenReferences/ChangesList/VBox/ChangeTree" to="Tabs/BrokenReferences" method="_on_change_tree_button_clicked"]
[connection signal="item_edited" from="Tabs/BrokenReferences/ChangesList/VBox/ChangeTree" to="Tabs/BrokenReferences" method="_on_change_tree_item_edited"]
[connection signal="pressed" from="Tabs/BrokenReferences/ChangesList/VBox/CheckButton" to="Tabs/BrokenReferences" method="_on_check_button_pressed"]
[connection signal="pressed" from="Tabs/BrokenReferences/ReplacementSection/FindList/Replace" to="Tabs/BrokenReferences" method="_on_replace_pressed"]
[connection signal="pressed" from="Tabs/BrokenReferences/ReplacementSection/FindList/HBoxContainer/Replace" to="Tabs/BrokenReferences" method="_on_replace_pressed"]
[connection signal="text_changed" from="Tabs/UniqueIdentifiers/VBox/Tools/Search" to="Tabs/UniqueIdentifiers" method="_on_search_text_changed"]
[connection signal="button_clicked" from="Tabs/UniqueIdentifiers/VBox/IdentifierTable" to="Tabs/UniqueIdentifiers" method="_on_identifier_table_button_clicked"]
[connection signal="item_edited" from="Tabs/UniqueIdentifiers/VBox/IdentifierTable" to="Tabs/UniqueIdentifiers" method="_on_identifier_table_item_edited"]

View file

@ -111,7 +111,9 @@ func add_ref_change(old_name:String, new_name:String, type:Types, where:=Where.T
'category':category_name,
'character_names':character_names,
'texts_only':where == Where.TEXTS_ONLY,
'type':type
'type':type,
'case_sensitive':case_sensitive,
'whole_words':whole_words,
})
update_indicator()
@ -161,7 +163,6 @@ func open() -> void:
DialogicResourceUtil.update_directory('dch')
DialogicResourceUtil.update_directory('dtl')
popup_centered_ratio(0.5)
move_to_foreground()
grab_focus()
@ -170,6 +171,10 @@ func _on_close_requested() -> void:
broken_manager.close()
func get_change_count() -> int:
return len(broken_manager.reference_changes)
func update_indicator() -> void:
icon_button.get_child(0).visible = !broken_manager.reference_changes.is_empty()

View file

@ -1 +1 @@
uid://bwsjqnvqt6dp2
uid://bxr2qomm7wm85

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=7 format=3 uid="uid://cwe3r2tbh2og1"]
[ext_resource type="Script" uid="uid://lwjkgosd1r60" path="res://addons/dialogic/Editor/Common/sidebar.gd" id="1_jnq65"]
[ext_resource type="Script" uid="uid://myogqmakusx3" path="res://addons/dialogic/Editor/Common/sidebar.gd" id="1_jnq65"]
[ext_resource type="Texture2D" uid="uid://bff65e82555qr" path="res://addons/dialogic/Editor/Images/Pieces/close-icon.svg" id="2_54pks"]
[ext_resource type="Texture2D" uid="uid://dx3o2ild56i76" path="res://addons/dialogic/Editor/Images/Pieces/closed-icon.svg" id="2_ilyps"]

View file

@ -168,7 +168,7 @@ func update_resource_list(resources_list: PackedStringArray = []) -> void:
resource_tree.clear()
var character_items: Array = get_directory_items.call(character_directory, filter, load("res://addons/dialogic/Editor/Images/Resources/character.svg"), resources_list)
var timeline_items: Array = get_directory_items.call(timeline_directory, filter, get_theme_icon("TripleBar", "EditorIcons"), resources_list)
var timeline_items: Array = get_directory_items.call(timeline_directory, filter, load("res://addons/dialogic/Editor/Images/Resources/timeline.svg"), resources_list)
var all_items := character_items + timeline_items
# BUILD TREE
@ -391,7 +391,7 @@ func _on_resources_tree_item_clicked(_pos: Vector2, mouse_button_index: int) ->
func _on_resources_tree_item_collapsed(item:TreeItem) -> void:
var collapsed_info := DialogicUtil.get_editor_setting("resource_list_collapsed_info", [])
var collapsed_info: Array = DialogicUtil.get_editor_setting("resource_list_collapsed_info", [])
if item.get_text(0) in collapsed_info:
if not item.collapsed:
collapsed_info.erase(item.get_text(0))
@ -433,7 +433,7 @@ func _on_right_click_menu_id_pressed(id: int) -> void:
)
4: # COPY IDENTIFIER
DisplayServer.clipboard_set(
DialogicResourceUtil.get_unique_identifier(
DialogicResourceUtil.get_unique_identifier_by_path(
%RightClickMenu.get_meta("item_clicked").get_metadata(0)
)
)

View file

@ -1 +1 @@
uid://lwjkgosd1r60
uid://myogqmakusx3

View file

@ -4,7 +4,7 @@ extends HBoxContainer
# Dialogic Editor toolbar. Works together with editors_mangager.
################################################################################
## EDITOR BUTTONS/LABELS
## EDITOR BUTTONS/LABELS
################################################################################
func _ready() -> void:
if owner.get_parent() is SubViewport:
@ -44,6 +44,3 @@ func add_custom_button(label:String, icon:Texture) -> Button:
func hide_all_custom_buttons() -> void:
for button in %CustomButtons.get_children():
button.hide()

View file

@ -1 +1 @@
uid://ckucbhl6k6w3r
uid://1m3sqaws1hin

View file

@ -1 +1 @@
uid://dwkxd7m2p2lkj
uid://bvbsqai5sh0na

View file

@ -19,7 +19,6 @@ func _ready() -> void:
func open() -> void:
get_parent().popup_centered_ratio(0.5)
get_parent().mode = Window.MODE_WINDOWED
get_parent().move_to_foreground()
get_parent().grab_focus()
@ -108,7 +107,7 @@ func _on_update_manager_downdload_completed(result:int):
func _on_resources_reimported(resources:Array) -> void:
if is_inside_tree():
await get_tree().process_frame
get_parent().move_to_foreground()
get_parent().grab_focus()
func markdown_to_bbcode(text:String) -> String:

View file

@ -1 +1 @@
uid://db4gl62lskryf
uid://cskkip1wso0pu

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=9 format=3 uid="uid://vv3m5m68fwg7"]
[ext_resource type="Script" uid="uid://db4gl62lskryf" path="res://addons/dialogic/Editor/Common/update_install_window.gd" id="1_p1pbx"]
[ext_resource type="Script" uid="uid://cskkip1wso0pu" path="res://addons/dialogic/Editor/Common/update_install_window.gd" id="1_p1pbx"]
[ext_resource type="Texture2D" uid="uid://dybg3l5pwetne" path="res://addons/dialogic/Editor/Images/plugin-icon.svg" id="2_20ke0"]
[sub_resource type="Gradient" id="Gradient_lt7uf"]

View file

@ -1 +1 @@
uid://dm3a08uuk04ky
uid://1tph6ios6ry2

View file

@ -1 +1 @@
uid://bbcblody1vn3k
uid://cyjmcay08lmr8

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=4 format=3 uid="uid://de13fdeebrkcb"]
[ext_resource type="Script" uid="uid://bbcblody1vn3k" path="res://addons/dialogic/Editor/Events/BranchEnd.gd" id="1"]
[ext_resource type="Script" uid="uid://cyjmcay08lmr8" path="res://addons/dialogic/Editor/Events/BranchEnd.gd" id="1"]
[sub_resource type="Image" id="Image_6aqdp"]
data = {

View file

@ -55,6 +55,8 @@ func _ready() -> void:
func initialize_ui() -> void:
var _scale := DialogicUtil.get_editor_scale()
add_theme_constant_override("margin_bottom", DialogicUtil.get_editor_setting("event_block_margin", 0) * _scale)
$PanelContainer.self_modulate = get_theme_color("accent_color", "Editor")
# Warning Icon
@ -168,6 +170,7 @@ var FIELD_SCENES := {
DialogicEvent.ValueType.VECTOR4: "res://addons/dialogic/Editor/Events/Fields/field_vector4.tscn",
DialogicEvent.ValueType.COLOR: "res://addons/dialogic/Editor/Events/Fields/field_color.tscn",
DialogicEvent.ValueType.AUDIO_PREVIEW: "res://addons/dialogic/Editor/Events/Fields/field_audio_preview.tscn",
DialogicEvent.ValueType.IMAGE_PREVIEW: "res://addons/dialogic/Editor/Events/Fields/field_image_preview.tscn",
}
func build_editor(build_header:bool = true, build_body:bool = false) -> void:
@ -356,6 +359,13 @@ func _evaluate_visibility_condition(p: Dictionary) -> bool:
return result
func get_field_node(property_name:String) -> Node:
for i in field_list:
if i.get("property", "") == property_name:
return i.node
return null
func _on_resource_ui_update_needed() -> void:
for node_info in field_list:
if node_info.node and node_info.node.has_method('set_value'):
@ -415,6 +425,6 @@ func _on_EventNode_gui_input(event:InputEvent) -> void:
popup.current_event = self
popup.popup_on_parent(Rect2(get_global_mouse_position(),Vector2()))
if resource.help_page_path == "":
popup.set_item_disabled(2, true)
popup.set_item_disabled(4, true)
else:
popup.set_item_disabled(2, false)
popup.set_item_disabled(4, false)

View file

@ -1 +1 @@
uid://dprlmuv5kwkpa
uid://dbncx2w0btjyx

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=8 format=3 uid="uid://bwaxj1n401fp4"]
[ext_resource type="Script" uid="uid://dprlmuv5kwkpa" path="res://addons/dialogic/Editor/Events/EventBlock/event_block.gd" id="1"]
[ext_resource type="Script" uid="uid://dbncx2w0btjyx" path="res://addons/dialogic/Editor/Events/EventBlock/event_block.gd" id="1"]
[ext_resource type="StyleBox" uid="uid://cl75ikyq2is7c" path="res://addons/dialogic/Editor/Events/styles/unselected_stylebox.tres" id="2_axj84"]
[ext_resource type="Texture2D" uid="uid://dybg3l5pwetne" path="res://addons/dialogic/Editor/Images/plugin-icon.svg" id="6"]

View file

@ -5,15 +5,17 @@ var current_event: Node = null
func _ready() -> void:
clear()
add_icon_item(get_theme_icon("Duplicate", "EditorIcons"), "Duplicate")
add_icon_item(get_theme_icon("Duplicate", "EditorIcons"), "Duplicate", 0)
add_separator()
add_icon_item(get_theme_icon("Help", "EditorIcons"), "Documentation")
add_icon_item(get_theme_icon("CodeHighlighter", "EditorIcons"), "Open Code")
add_icon_item(get_theme_icon("PlayStart", "EditorIcons"), "Play from here", 1)
add_separator()
add_icon_item(get_theme_icon("ArrowUp", "EditorIcons"), "Move up")
add_icon_item(get_theme_icon("ArrowDown", "EditorIcons"), "Move down")
add_icon_item(get_theme_icon("Help", "EditorIcons"), "Documentation", 2)
add_icon_item(get_theme_icon("CodeHighlighter", "EditorIcons"), "Open Code", 3)
add_separator()
add_icon_item(get_theme_icon("Remove", "EditorIcons"), "Delete")
add_icon_item(get_theme_icon("ArrowUp", "EditorIcons"), "Move up", 4)
add_icon_item(get_theme_icon("ArrowDown", "EditorIcons"), "Move down", 5)
add_separator()
add_icon_item(get_theme_icon("Remove", "EditorIcons"), "Delete", 6)
var menu_background := StyleBoxFlat.new()
menu_background.bg_color = get_parent().get_theme_color("base_color", "Editor")

View file

@ -1 +1 @@
uid://doek0kltvf65w
uid://n1knm2ohcehu

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:

Some files were not shown because too many files have changed in this diff Show more