Add a shorthand for setting the exit code using SceneTree::quit()

This reduces the amount of code required to exit a process with a
non-zero exit code. This pattern is also found in most other
programming languages.
This commit is contained in:
Hugo Locurcio
2019-12-29 16:39:24 +01:00
parent 9d3424f61d
commit cc626acf45
4 changed files with 13 additions and 6 deletions

View File

@@ -185,8 +185,10 @@
<method name="quit">
<return type="void">
</return>
<argument index="0" name="exit_code" type="int" default="-1">
</argument>
<description>
Quits the application.
Quits the application. A process [code]exit_code[/code] can optionally be passed as an argument. If this argument is [code]0[/code] or greater, it will override the [member OS.exit_code] defined before quitting the application.
</description>
</method>
<method name="reload_current_scene">