doc: Sync classref with current source

This commit is contained in:
Rémi Verschelde 2020-07-28 01:08:44 +02:00
parent 4e825539e5
commit 932b75e247
6 changed files with 21 additions and 58 deletions

View file

@ -20,9 +20,7 @@
</method>
</methods>
<members>
<member name="scroll_horizontal_enabled" type="bool" setter="set_enable_h_scroll" getter="is_h_scroll_enabled" override="true" default="false">
If [code]true[/code], horizontal scrolling is enabled. An horizontal scroll bar will display at the bottom of the inspector.
</member>
<member name="scroll_horizontal_enabled" type="bool" setter="set_enable_h_scroll" getter="is_h_scroll_enabled" override="true" default="false" />
</members>
<signals>
<signal name="object_id_selected">

View file

@ -122,6 +122,8 @@
<member name="caret_blink_speed" type="float" setter="cursor_set_blink_speed" getter="cursor_get_blink_speed" default="0.65">
Duration (in seconds) of a caret's blinking cycle.
</member>
<member name="caret_force_displayed" type="bool" setter="cursor_set_force_displayed" getter="cursor_get_force_displayed" default="false">
</member>
<member name="caret_position" type="int" setter="set_cursor_position" getter="get_cursor_position" default="0">
The cursor's position inside the [LineEdit]. When set, the text may scroll to accommodate it.
</member>

View file

@ -120,7 +120,7 @@
[codeblock]
var arguments = {}
for argument in OS.get_cmdline_args():
if argument.find("=") > -1:
if argument.find("=") &gt; -1:
var key_value = argument.split("=")
arguments[key_value[0].lstrip("--")] = key_value[1]
[/codeblock]

View file

@ -280,6 +280,10 @@
<member name="debug/gdscript/completion/autocomplete_setters_and_getters" type="bool" setter="" getter="" default="false">
If [code]true[/code], displays getters and setters in autocompletion results in the script editor. This setting is meant to be used when porting old projects (Godot 2), as using member variables is the preferred style from Godot 3 onwards.
</member>
<member name="debug/gdscript/warnings/assert_always_false" type="bool" setter="" getter="" default="true">
</member>
<member name="debug/gdscript/warnings/assert_always_true" type="bool" setter="" getter="" default="true">
</member>
<member name="debug/gdscript/warnings/constant_used_as_function" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when a constant is used as a function.
</member>
@ -292,15 +296,6 @@
<member name="debug/gdscript/warnings/exclude_addons" type="bool" setter="" getter="" default="true">
If [code]true[/code], scripts in the [code]res://addons[/code] folder will not generate warnings.
</member>
<member name="debug/gdscript/warnings/function_conflicts_constant" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when a function is declared with the same name as a constant.
</member>
<member name="debug/gdscript/warnings/function_conflicts_variable" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when a function is declared with the same name as a variable. This will turn into an error in a future version when first-class functions become supported in GDScript.
</member>
<member name="debug/gdscript/warnings/function_may_yield" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when a function assigned to a variable may yield and return a function state instead of a value.
</member>
<member name="debug/gdscript/warnings/function_used_as_property" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when using a function as if it was a property.
</member>
@ -316,12 +311,16 @@
<member name="debug/gdscript/warnings/property_used_as_function" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when using a property as if it was a function.
</member>
<member name="debug/gdscript/warnings/redundant_await" type="bool" setter="" getter="" default="true">
</member>
<member name="debug/gdscript/warnings/return_value_discarded" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when calling a function without using its return value (by assigning it to a variable or using it as a function argument). Such return values are sometimes used to denote possible errors using the [enum Error] enum.
</member>
<member name="debug/gdscript/warnings/shadowed_variable" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when defining a local or subclass member variable that would shadow a variable at an upper level (such as a member variable).
</member>
<member name="debug/gdscript/warnings/shadowed_variable_base_class" type="bool" setter="" getter="" default="true">
</member>
<member name="debug/gdscript/warnings/standalone_expression" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when calling an expression that has no effect on the surrounding code, such as writing [code]2 + 2[/code] as a statement.
</member>
@ -340,6 +339,8 @@
<member name="debug/gdscript/warnings/unreachable_code" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when unreachable code is detected (such as after a [code]return[/code] statement that will always be executed).
</member>
<member name="debug/gdscript/warnings/unreachable_pattern" type="bool" setter="" getter="" default="true">
</member>
<member name="debug/gdscript/warnings/unsafe_call_argument" type="bool" setter="" getter="" default="false">
If [code]true[/code], enables warnings when using an expression whose type may not be compatible with the function parameter expected.
</member>
@ -352,11 +353,11 @@
<member name="debug/gdscript/warnings/unsafe_property_access" type="bool" setter="" getter="" default="false">
If [code]true[/code], enables warnings when accessing a property whose presence is not guaranteed at compile-time in the class.
</member>
<member name="debug/gdscript/warnings/unused_argument" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when a function parameter is unused.
<member name="debug/gdscript/warnings/unused_local_constant" type="bool" setter="" getter="" default="true">
</member>
<member name="debug/gdscript/warnings/unused_class_variable" type="bool" setter="" getter="" default="false">
If [code]true[/code], enables warnings when a member variable is unused.
<member name="debug/gdscript/warnings/unused_parameter" type="bool" setter="" getter="" default="true">
</member>
<member name="debug/gdscript/warnings/unused_private_class_variable" type="bool" setter="" getter="" default="true">
</member>
<member name="debug/gdscript/warnings/unused_signal" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when a signal is unused.
@ -364,9 +365,6 @@
<member name="debug/gdscript/warnings/unused_variable" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when a local variable is unused.
</member>
<member name="debug/gdscript/warnings/variable_conflicts_function" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when a variable is declared with the same name as a function. This will turn into an error in a future version when first-class functions become supported in GDScript.
</member>
<member name="debug/gdscript/warnings/void_assignment" type="bool" setter="" getter="" default="true">
If [code]true[/code], enables warnings when assigning the result of a function that returns [code]void[/code] to a variable.
</member>

View file

@ -1367,42 +1367,6 @@
[code]wrapi[/code] is more flexible than using the [method posmod] approach by giving the user control over the minimum value.
</description>
</method>
<method name="yield">
<return type="GDScriptFunctionState">
</return>
<argument index="0" name="object" type="Object" default="null">
</argument>
<argument index="1" name="signal" type="String" default="&quot;&quot;">
</argument>
<description>
Stops the function execution and returns the current suspended state to the calling function.
From the caller, call [method GDScriptFunctionState.resume] on the state to resume execution. This invalidates the state. Within the resumed function, [code]yield()[/code] returns whatever was passed to the [code]resume()[/code] function call.
If passed an object and a signal, the execution is resumed when the object emits the given signal. In this case, [code]yield()[/code] returns the argument passed to [code]emit_signal()[/code] if the signal takes only one argument, or an array containing all the arguments passed to [code]emit_signal()[/code] if the signal takes multiple arguments.
You can also use [code]yield[/code] to wait for a function to finish:
[codeblock]
func _ready():
yield(countdown(), "completed") # waiting for the countdown() function to complete
print('Ready')
func countdown():
yield(get_tree(), "idle_frame") # returns a GDScriptFunctionState object to _ready()
print(3)
yield(get_tree().create_timer(1.0), "timeout")
print(2)
yield(get_tree().create_timer(1.0), "timeout")
print(1)
yield(get_tree().create_timer(1.0), "timeout")
# prints:
# 3
# 2
# 1
# Ready
[/codeblock]
When yielding on a function, the [code]completed[/code] signal will be emitted automatically when the function returns. It can, therefore, be used as the [code]signal[/code] parameter of the [code]yield[/code] method to resume.
In order to yield on a function, the resulting function should also return a [code]GDScriptFunctionState[/code]. Notice [code]yield(get_tree(), "idle_frame")[/code] from the above example.
</description>
</method>
</methods>
<constants>
<constant name="PI" value="3.141593">

View file

@ -4,7 +4,8 @@
State of a function call after yielding.
</brief_description>
<description>
Calling [method @GDScript.yield] within a function will cause that function to yield and return its current state as an object of this type. The yielded function call can then be resumed later by calling [method resume] on this state object.
FIXME: Outdated docs as of GDScript rewrite in 4.0.
Calling [code]yield[/code] within a function will cause that function to yield and return its current state as an object of this type. The yielded function call can then be resumed later by calling [method resume] on this state object.
</description>
<tutorials>
</tutorials>
@ -26,7 +27,7 @@
</argument>
<description>
Resume execution of the yielded function call.
If handed an argument, return the argument from the [method @GDScript.yield] call in the yielded function call. You can pass e.g. an [Array] to hand multiple arguments.
If handed an argument, return the argument from the [code]yield[/code] call in the yielded function call. You can pass e.g. an [Array] to hand multiple arguments.
This function returns what the resumed function call returns, possibly another function state if yielded again.
</description>
</method>