Compare commits

...

2 Commits

Author SHA1 Message Date
Serhii Snitsaruk 85d5af180b
Clarify add_event_handler in docs 2024-08-10 15:01:43 +02:00
Serhii Snitsaruk b4eec2c364
Fix event handler signature example in docs 2024-08-10 14:58:20 +02:00
2 changed files with 4 additions and 4 deletions

View File

@ -274,9 +274,9 @@ Registers a ``handler`` to be called when ``event`` is dispatched. The handler f
:: ::
func my_event_handler(cargo=null) -> void: func my_event_handler(cargo=null) -> bool:
Cargo is an optional parameter that can be passed to the handler. See also :ref:`dispatch<class_LimboState_method_dispatch>`. If the handler returns ``true``, the event will be consumed. Cargo is an optional parameter that can be passed to the handler. See also :ref:`dispatch<class_LimboState_method_dispatch>`.
.. rst-class:: classref-item-separator .. rst-class:: classref-item-separator

View File

@ -43,9 +43,9 @@
<description> <description>
Registers a [param handler] to be called when [param event] is dispatched. The handler function should have the following signature: Registers a [param handler] to be called when [param event] is dispatched. The handler function should have the following signature:
[codeblock] [codeblock]
func my_event_handler(cargo=null) -> void: func my_event_handler(cargo=null) -> bool:
[/codeblock] [/codeblock]
Cargo is an optional parameter that can be passed to the handler. See also [method dispatch]. If the handler returns [code]true[/code], the event will be consumed. Cargo is an optional parameter that can be passed to the handler. See also [method dispatch].
</description> </description>
</method> </method>
<method name="call_on_enter"> <method name="call_on_enter">