@@ -28,6 +28,16 @@ enum SimSize
2828 WORLD
2929}
3030
31+ enum DocumentationSection
32+ {
33+ TITLE ,
34+ DESCRIPTION ,
35+ ENUMS ,
36+ ARGUMENTS ,
37+ OUTPUTS ,
38+ }
39+
40+
3141#region Description Formatting
3242const PARAM_TEXT_COLOR := Color ("cdbff0" )
3343const PARAM_BG_COLOR := Color ("bfbfbf1a" )
@@ -164,11 +174,16 @@ func get_title() -> String:
164174 return _get_title ()
165175
166176
167- ## Public version of [method get_description ]. Prefer to override that method over this one.
177+ ## Public version of [method _get_description ]. Prefer to override that method over this one.
168178func get_description () -> String :
169179 return _get_description ()
170180
171181
182+ ## Public version of [method _get_extra_documentation]. Prefer to override that method over this one.
183+ func get_extra_documentation (for_section : DocumentationSection ) -> String :
184+ return _get_extra_documentation (for_section ).strip_edges ()
185+
186+
172187func get_type () -> GaeaValue .Type :
173188 if not _get_output_ports_list ().is_empty ():
174189 return _get_output_port_type (_get_output_ports_list ().back ())
@@ -180,6 +195,16 @@ func get_enums_count() -> int:
180195 return _get_enums_count ()
181196
182197
198+ ## Public version of [method _get_enum_title]. Prefer to override that method over this one.
199+ func get_enum_title (enum_idx : int ) -> String :
200+ return _get_enum_title (enum_idx )
201+
202+
203+ ## Public version of [method _get_enum_description]. Prefer to override that method over this one.
204+ func get_enum_description (enum_idx : int ) -> String :
205+ return _get_enum_description (enum_idx )
206+
207+
183208## Public version of [_get_preview_simulation_size]. Prefer to override that method over this one.
184209func get_preview_simulation_size () -> SimSize :
185210 return SimSize .PREVIEW
@@ -235,6 +260,11 @@ func get_argument_default_value(arg_name: StringName) -> Variant:
235260 return default_value_overrides .get (arg_name , _get_argument_default_value (arg_name ))
236261
237262
263+ ## Public version of [method _get_argument_description]. Prefer to override that method over this one.
264+ func get_argument_description (arg_name : StringName ) -> String :
265+ return _get_argument_description (arg_name )
266+
267+
238268## Public version of [method _get_argument_hint]. Prefer to override that method over this one.
239269func get_argument_hint (arg_name : StringName ) -> Dictionary [String , Variant ]:
240270 return _get_argument_hint (arg_name )
@@ -255,6 +285,11 @@ func get_output_port_display_name(output_name: StringName) -> String:
255285 return _get_output_port_display_name (output_name )
256286
257287
288+ ## Public version of [method _get_output_port_display_name]. Prefer to override that method over this one.
289+ func get_output_port_description (output_name : StringName ) -> String :
290+ return _get_output_port_description (output_name )
291+
292+
258293## Public version of [method _get_output_port_type]. Prefer to override that method over this one.
259294func get_output_port_type (output_name : StringName ) -> GaeaValue .Type :
260295 return _get_output_port_type (output_name )
@@ -289,8 +324,14 @@ func _get_title() -> String
289324
290325## Override this method to define the description shown in the 'Create Node' dialog and in a
291326## tooltip when hovering over this node in the graph editor.
292- ## Defining this method is [b]optional[/b], but recommended. If not defined, the description will be empty.
327+ ## Defining this method is [b]optional[/b], but recommended.
293328func _get_description () -> String :
329+ return "There is currently no description for this node."
330+
331+
332+ ## Override this method to define extra text shown in the documentation.
333+ ## Defining this method is [b]optional[/b].
334+ func _get_extra_documentation (_for_section : DocumentationSection ) -> String :
294335 return ""
295336
296337
@@ -307,6 +348,19 @@ func _get_enums_count() -> int:
307348 return 0
308349
309350
351+ ## Override this method if you want to change the display name for the enum in the documentation.[br][br]
352+ ## Defining this method is [b]optional[/b].
353+ ## If not defined, the name will be Enum # followed by the index + 1
354+ func _get_enum_title (enum_idx : int ) -> String :
355+ return "Enum #%d " % (enum_idx + 1)
356+
357+
358+ ## Override this method if you want to change the description for the enum in the documentation.[br][br]
359+ ## Defining this method is [b]optional[/b].
360+ func _get_enum_description (enum_idx : int ) -> String :
361+ return "There is currently no description for the enum #%d ." % (enum_idx + 1)
362+
363+
310364## Override this method to change what simulation size to use in previews. Returns a [SimSize].
311365func _get_preview_simulation_size () -> SimSize :
312366 return SimSize .PREVIEW
@@ -367,6 +421,13 @@ func _get_argument_default_value(arg_name: StringName) -> Variant:
367421 return GaeaValue .get_default_value (_get_argument_type (arg_name ))
368422
369423
424+ ## Override this method to define the description of the arguments defined in [method _get_arguments_list].[br][br]
425+ ## Defining this method is [b]optional[/b], but recommended.
426+ ## If not defined, the argument will have no description.
427+ func _get_argument_description (arg_name : StringName ) -> String :
428+ return "There is currently no description for the argument [code]%s [/code]." % arg_name
429+
430+
370431## Override this method to change the way the editors for the arguments behave. For example,
371432## if the returned [Dictionary] has a [code]"min"[/code] key, [GaeaNumberArgumentEditor] will not be able to go below that number.[br][br]
372433## Defining this method is [b]optional[/b].
@@ -393,6 +454,12 @@ func _get_output_port_display_name(output_name: StringName) -> String:
393454 return output_name.capitalize ()
394455
395456
457+ ## Override this method to define the description for any outputs in [method _get_output_ports_list].[br][br]
458+ ## Defining this method is [b]optional[/b].
459+ func _get_output_port_description (output_name : StringName ) -> String :
460+ return "There is currently no description for output [code]%s [/code]." % output_name
461+
462+
396463## Override this method to define the type of the outputs defined in [method _get_output_ports_list].[br][br]
397464## Defining this method is [b]required[/b].
398465@abstract
0 commit comments