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

@ -19,19 +19,21 @@ var default := ""
var allow_empty := false
################################################################################
## EXECUTION
#region EXECUTION
################################################################################
func _execute() -> void:
dialogic.Inputs.auto_skip.enabled = false
dialogic.current_state = DialogicGameHandler.States.WAITING
dialogic.TextInput.show_text_input(text, default, placeholder, allow_empty)
dialogic.TextInput.show_text_input(
get_property_translated("text"),
get_property_translated("default"),
get_property_translated("placeholder"), allow_empty)
dialogic.TextInput.input_confirmed.connect(_on_DialogicTextInput_input_confirmed, CONNECT_ONE_SHOT)
func _on_DialogicTextInput_input_confirmed(input:String) -> void:
if !dialogic.has_subsystem('VAR'):
if not dialogic.has_subsystem('VAR'):
printerr('[Dialogic] The TextInput event needs the variable subsystem to be present.')
finish()
return
@ -41,8 +43,7 @@ func _on_DialogicTextInput_input_confirmed(input:String) -> void:
finish()
################################################################################
## SAVING/LOADING
#region SETUP
################################################################################
func _init() -> void:
@ -52,8 +53,7 @@ func _init() -> void:
event_sorting_index = 6
################################################################################
## SAVING/LOADING
#region SAVING/LOADING
################################################################################
func get_shortcode() -> String:
@ -70,8 +70,23 @@ func get_shortcode_parameters() -> Dictionary:
"allow_empty" : {"property": "allow_empty", "default": false},
}
################################################################################
## EDITOR
func _get_translatable_properties() -> Array:
return ["text", "placeholder", "default"]
func _get_property_original_translation(property_name:String) -> String:
match property_name:
"text":
return text
"placeholder":
return placeholder
"default":
return default
return ""
#region EDITOR
################################################################################
func build_event_editor() -> void:
@ -86,7 +101,7 @@ func build_event_editor() -> void:
add_body_edit('allow_empty', ValueType.BOOL, {'left_text':'Allow empty:'})
func get_var_suggestions(filter:String="") -> Dictionary:
func get_var_suggestions(filter: String = "") -> Dictionary:
var suggestions := {}
if filter:
suggestions[filter] = {