From a56272a2488a68b3db27c21104da262bc0f0dcce Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Mon, 5 Aug 2024 17:09:55 +0200 Subject: [PATCH] Doc: Clarify `LimboState.add_event_handler()` --- doc/source/classes/class_limbostate.rst | 7 ++++++- doc_classes/LimboState.xml | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/doc/source/classes/class_limbostate.rst b/doc/source/classes/class_limbostate.rst index ad1aef1..49d9522 100644 --- a/doc/source/classes/class_limbostate.rst +++ b/doc/source/classes/class_limbostate.rst @@ -270,7 +270,12 @@ Called during the update. Implement your state's behavior with this method. |void| **add_event_handler**\ (\ event\: ``StringName``, handler\: ``Callable``\ ) :ref:`🔗` -Registers a ``handler`` to be called when ``event`` is dispatched. +Registers a ``handler`` to be called when ``event`` is dispatched. The handler function should have the following signature: + +:: +func my_event_handler(cargo=null) -> void: + +Cargo is an optional parameter that can be passed to the handler. See also :ref:`dispatch`. .. rst-class:: classref-item-separator diff --git a/doc_classes/LimboState.xml b/doc_classes/LimboState.xml index 80cfa4c..4fc520f 100644 --- a/doc_classes/LimboState.xml +++ b/doc_classes/LimboState.xml @@ -41,7 +41,9 @@ - Registers a [param handler] to be called when [param event] is dispatched. + Registers a [param handler] to be called when [param event] is dispatched. The handler function should have the following signature: + [codeblock]func my_event_handler(cargo=null) -> void:[/codeblock] + Cargo is an optional parameter that can be passed to the handler. See also [method dispatch].