@@ -19,19 +19,21 @@ var default := ""
19
19
var allow_empty := false
20
20
21
21
22
- ## ##############################################################################
23
- ## EXECUTION
22
+ #region EXECUTION
24
23
## ##############################################################################
25
24
26
25
func _execute () -> void :
27
26
dialogic .Inputs .auto_skip .enabled = false
28
27
dialogic .current_state = DialogicGameHandler .States .WAITING
29
- dialogic .TextInput .show_text_input (text , default , placeholder , allow_empty )
28
+ dialogic .TextInput .show_text_input (
29
+ get_property_translated ("text" ),
30
+ get_property_translated ("default" ),
31
+ get_property_translated ("placeholder" ), allow_empty )
30
32
dialogic .TextInput .input_confirmed .connect (_on_DialogicTextInput_input_confirmed , CONNECT_ONE_SHOT )
31
33
32
34
33
35
func _on_DialogicTextInput_input_confirmed (input :String ) -> void :
34
- if ! dialogic .has_subsystem ('VAR' ):
36
+ if not dialogic .has_subsystem ('VAR' ):
35
37
printerr ('[Dialogic] The TextInput event needs the variable subsystem to be present.' )
36
38
finish ()
37
39
return
@@ -41,8 +43,7 @@ func _on_DialogicTextInput_input_confirmed(input:String) -> void:
41
43
finish ()
42
44
43
45
44
- ## ##############################################################################
45
- ## SAVING/LOADING
46
+ #region SETUP
46
47
## ##############################################################################
47
48
48
49
func _init () -> void :
@@ -52,8 +53,7 @@ func _init() -> void:
52
53
event_sorting_index = 6
53
54
54
55
55
- ## ##############################################################################
56
- ## SAVING/LOADING
56
+ #region SAVING/LOADING
57
57
## ##############################################################################
58
58
59
59
func get_shortcode () -> String :
@@ -70,8 +70,23 @@ func get_shortcode_parameters() -> Dictionary:
70
70
"allow_empty" : {"property" : "allow_empty" , "default" : false },
71
71
}
72
72
73
- ## ##############################################################################
74
- ## EDITOR
73
+
74
+ func _get_translatable_properties () -> Array :
75
+ return ["text" , "placeholder" , "default" ]
76
+
77
+
78
+ func _get_property_original_translation (property_name :String ) -> String :
79
+ match property_name :
80
+ "text" :
81
+ return text
82
+ "placeholder" :
83
+ return placeholder
84
+ "default" :
85
+ return default
86
+ return ""
87
+
88
+
89
+ #region EDITOR
75
90
## ##############################################################################
76
91
77
92
func build_event_editor () -> void :
@@ -86,7 +101,7 @@ func build_event_editor() -> void:
86
101
add_body_edit ('allow_empty' , ValueType .BOOL , {'left_text' :'Allow empty:' })
87
102
88
103
89
- func get_var_suggestions (filter :String = "" ) -> Dictionary :
104
+ func get_var_suggestions (filter : String = "" ) -> Dictionary :
90
105
var suggestions := {}
91
106
if filter :
92
107
suggestions [filter ] = {
0 commit comments