diff --git a/doc/source/classes/class_limboutility.rst b/doc/source/classes/class_limboutility.rst index f52fab6..4f9d7d5 100644 --- a/doc/source/classes/class_limboutility.rst +++ b/doc/source/classes/class_limboutility.rst @@ -22,15 +22,23 @@ Methods .. table:: :widths: auto - +-----------+---------------------------------------------------------------------------------------------------------------+ - | String | :ref:`decorate_output_var` **(** String variable **)** |const| | - +-----------+---------------------------------------------------------------------------------------------------------------+ - | String | :ref:`decorate_var` **(** String variable **)** |const| | - +-----------+---------------------------------------------------------------------------------------------------------------+ - | String | :ref:`get_status_name` **(** int status **)** |const| | - +-----------+---------------------------------------------------------------------------------------------------------------+ - | Texture2D | :ref:`get_task_icon` **(** String class_or_script_path **)** |const| | - +-----------+---------------------------------------------------------------------------------------------------------------+ + +-----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | String | :ref:`decorate_output_var` **(** String variable **)** |const| | + +-----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | String | :ref:`decorate_var` **(** String variable **)** |const| | + +-----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | String | :ref:`get_check_operator_string` **(** :ref:`CheckType` check **)** |const| | + +-----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | String | :ref:`get_operation_string` **(** :ref:`Operation` operation **)** |const| | + +-----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | String | :ref:`get_status_name` **(** int status **)** |const| | + +-----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Texture2D | :ref:`get_task_icon` **(** String class_or_script_path **)** |const| | + +-----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | bool | :ref:`perform_check` **(** :ref:`CheckType` check, Variant a, Variant b **)** | + +-----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Variant | :ref:`perform_operation` **(** :ref:`Operation` operation, Variant a, Variant b **)** | + +-----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -234,6 +242,30 @@ Produces a string with a :ref:`Blackboard` variable name that ---- +.. _class_LimboUtility_method_get_check_operator_string: + +.. rst-class:: classref-method + +String **get_check_operator_string** **(** :ref:`CheckType` check **)** |const| + +Returns an operator string for a :ref:`CheckType` enum value. For example, :ref:`CHECK_EQUAL` returns "==". + +.. rst-class:: classref-item-separator + +---- + +.. _class_LimboUtility_method_get_operation_string: + +.. rst-class:: classref-method + +String **get_operation_string** **(** :ref:`Operation` operation **)** |const| + +Returns a string representation of an :ref:`Operation` enum value. + +.. rst-class:: classref-item-separator + +---- + .. _class_LimboUtility_method_get_status_name: .. rst-class:: classref-method @@ -254,6 +286,30 @@ Texture2D **get_task_icon** **(** String class_or_script_path **)** |const| Returns the icon texture associated with a task based on its class name or script resource path. +.. rst-class:: classref-item-separator + +---- + +.. _class_LimboUtility_method_perform_check: + +.. rst-class:: classref-method + +bool **perform_check** **(** :ref:`CheckType` check, Variant a, Variant b **)** + +Performs a ``check`` on two values, ``a`` and ``b``, and returns ``true`` if the check passes. + +.. rst-class:: classref-item-separator + +---- + +.. _class_LimboUtility_method_perform_operation: + +.. rst-class:: classref-method + +Variant **perform_operation** **(** :ref:`Operation` operation, Variant a, Variant b **)** + +Performs an ``operation`` on two values, ``a`` and ``b``, and returns the result. + .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/doc_classes/LimboUtility.xml b/doc_classes/LimboUtility.xml index 1393ca3..75534c0 100644 --- a/doc_classes/LimboUtility.xml +++ b/doc_classes/LimboUtility.xml @@ -22,6 +22,20 @@ Produces a string with a [Blackboard] variable name that is formatted for display or console output. + + + + + Returns an operator string for a [enum CheckType] enum value. For example, [constant CHECK_EQUAL] returns "==". + + + + + + + Returns a string representation of an [enum Operation] enum value. + + @@ -36,6 +50,24 @@ Returns the icon texture associated with a task based on its class name or script resource path. + + + + + + + Performs a [param check] on two values, [param a] and [param b], and returns [code]true[/code] if the check passes. + + + + + + + + + Performs an [param operation] on two values, [param a] and [param b], and returns the result. + + diff --git a/util/limbo_utility.cpp b/util/limbo_utility.cpp index 979f230..2aa271c 100644 --- a/util/limbo_utility.cpp +++ b/util/limbo_utility.cpp @@ -608,6 +608,10 @@ void LimboUtility::_bind_methods() { ClassDB::bind_method(D_METHOD("decorate_output_var", "variable"), &LimboUtility::decorate_output_var); ClassDB::bind_method(D_METHOD("get_status_name", "status"), &LimboUtility::get_status_name); ClassDB::bind_method(D_METHOD("get_task_icon", "class_or_script_path"), &LimboUtility::get_task_icon); + ClassDB::bind_method(D_METHOD("get_check_operator_string", "check"), &LimboUtility::get_check_operator_string); + ClassDB::bind_method(D_METHOD("perform_check", "check", "a", "b"), &LimboUtility::perform_check); + ClassDB::bind_method(D_METHOD("get_operation_string", "operation"), &LimboUtility::get_operation_string); + ClassDB::bind_method(D_METHOD("perform_operation", "operation", "a", "b"), &LimboUtility::perform_operation); BIND_ENUM_CONSTANT(CHECK_EQUAL); BIND_ENUM_CONSTANT(CHECK_LESS_THAN);