diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..ac1becab --- /dev/null +++ b/.editorconfig @@ -0,0 +1,8 @@ +root = true + +[*] +charset = utf-8 + +[*.gd] +indent_style = tab +max_line_length = 200 diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index 73011e50..00000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,5 +0,0 @@ -blank_issues_enabled: false -contact_links: - - name: Create Internal Task - url: https://phabricator.endlessm.com/tag/baby_godot/ - about: Endless OS Foundation employees, please use this tag on Phabricator diff --git a/.github/ISSUE_TEMPLATE/public.yml b/.github/ISSUE_TEMPLATE/issue.yml similarity index 85% rename from .github/ISSUE_TEMPLATE/public.yml rename to .github/ISSUE_TEMPLATE/issue.yml index 4e749039..d7c86765 100644 --- a/.github/ISSUE_TEMPLATE/public.yml +++ b/.github/ISSUE_TEMPLATE/issue.yml @@ -1,9 +1,9 @@ -name: Report Public Issue +name: Report Issue description: Report an issue with using the Godot Block Coding plugin body: - type: markdown attributes: - value: Thanks for taking the time to report an issue! If you're an employee of Endless OS Foundation, please track internal tasks [on Phabricator](https://phabricator.endlessm.com/tag/baby_godot/) instead. + value: Thanks for taking the time to report an issue! - type: textarea id: what-happened attributes: @@ -20,7 +20,7 @@ body: description: Can it be reliably reproduced, and if so, how? placeholder: | 1. Add a BlockCode child node - 2. Drag blocks X, Y, and Z to the editor + 2. Drag blocks X, Y, and Z to the editor 3. ... validations: required: true diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index f8057221..12cd71c5 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -6,6 +6,11 @@ on: branches: - main +# Cancel any ongoing previous run if a PR is updated +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: pre-commit: name: Linting and Formatting @@ -42,4 +47,4 @@ jobs: godot --path . --headless --import - name: Run tests run: | - godot --path . --headless --script addons/gut/gut_cmdln.gd -gexit + godot --path . --headless -s addons/gut/gut_cmdln.gd -gexit diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f5954e68..0b6a47d2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,17 +2,15 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-yaml - id: check-added-large-files - repo: https://github.com/Scony/godot-gdscript-toolkit - # Use this commit from the master branch until the next stable release with - # - rev: f836958a4487e31e3c5ab35c57c7a2128b7e2303 + rev: 4.3.3 hooks: - id: gdformat args: [--line-length=200] -files: ^(addons/block_code/(?!lib/).*|tests/.*)$ +files: ^(addons/block_code/(?!lib/|locale/).*|tests/.*)$ diff --git a/.tx/config b/.tx/config new file mode 100644 index 00000000..71af3289 --- /dev/null +++ b/.tx/config @@ -0,0 +1,8 @@ +[main] +host = https://www.transifex.com + +[o:endless-os:p:godot-block-coding:r:all] +source_file = addons/block_code/locale/godot_block_coding.pot +source_lang = en +file_filter = addons/block_code/locale/.po +type = PO diff --git a/addons/block_code/README.md b/addons/block_code/README.md index d349988f..77003bec 100644 --- a/addons/block_code/README.md +++ b/addons/block_code/README.md @@ -62,10 +62,78 @@ We have some high level blocks for simplifying common game elements. Add a Simpl Lean into animations! Godot's animations functionality goes beyond just simple animations of graphics. You can do so much by combining block coding with Godot's powerful animations editor. +If you want to access the node's property, you can drag the property from the Inspector dock and drop it into the block script as a getter block. And, if you want to modify the property's value, please press & hold Ctrl key when you drop the property, then it will be a setter block of the property in the block script. + + ## Feedback Please share feedback in the [Godot Forum Block Coding thread](https://forum.godotengine.org/t/block-coding-high-level-block-based-visual-programming/68941). +## Localization + +The plugin supports translations through Godot's [gettext][godot-gettext] +support. We welcome contributions to make the plugin work better in your +language! However, please note that translations in the Godot editor **will +only work with Godot 4.4 or newer**. + +The gettext PO files are located in the `addons/block_code/locale` directory. +See the Godot [documentation][godot-gettext] for instructions on working with +PO files. You can also join our project on [Transifex][transifex-project] to +collaborate with others translating the Block Coding content. + +[godot-gettext]: https://docs.godotengine.org/en/stable/tutorials/i18n/localization_using_gettext.html +[transifex-project]: https://explore.transifex.com/endless-os/godot-block-coding/ + +For developers, a few things need to be done to keep the translatable strings +up to date. + +* If files are added or removed, the list of translatable files needs to be + updated. This can be done by using the **Add** dialog in the [POT + Generation][pot-generation] tab. Or you can use the **Project → Tools → + Update BlockCode translated files** menu item in the editor. From the command + line, the POT file can be regenerated with the `scripts/update-pot-files.sh` + shell script. + +* If translatable strings have changed, the POT file needs to be updated. This + can be done by using the **Generate POT** dialog in the [POT + Generation][pot-generation] tab. Or you can use the **Project → Tools → + Regenerate BlockCode POT file** menu item in the editor. From the command + line, the POT file can be regenerated with the `scripts/regenerate-pot.sh` + shell script. + +* If the POT file has changed, the PO message files need to be updated. This + can be done using the gettext `msgmerge` tool with the + `scripts/merge-messages.sh` shell script. + +[pot-generation]: https://docs.godotengine.org/en/stable/tutorials/i18n/localization_using_gettext.html#automatic-generation-using-the-editor + +Strings added in scene files or block definition resources will usually be +extracted for localization and translated in the editor automatically. Strings +in scripts need more consideration. + +* `Object`s or `Node`s that are not descendents of the Block Coding panel need + to have their translation domain set with the `set_block_translation_domain` + helper function. This should usually be done in the object's `_init` method + to make sure the translation domain is set before that object or any of its + descendents (which inherit the translation domain by default) try to use + localized strings. + +* Usually [`tr`][object-tr] and [`tr_n`][object-tr-n] (or [`atr`][node-atr] and + [`atr_n`][node-atr-n] for `Node`s) should be used to mark translatable + strings. These will eventually call the domain's + [`translate`][domain-translate] or + [`translate_plural`][domain-translate-plural] methods, but the `tr` methods + respect translation settings on the object instances. The only time the + `translate` methods should be called directly is within a static context when + an object instance isn't available. + +[object-tr]: https://docs.godotengine.org/en/stable/classes/class_object.html#class-object-method-tr +[object-tr-n]: https://docs.godotengine.org/en/stable/classes/class_object.html#class-object-method-tr-n +[node-atr]: https://docs.godotengine.org/en/stable/classes/class_node.html#class-node-method-atr +[node-atr-n]: https://docs.godotengine.org/en/stable/classes/class_node.html#class-node-method-atr-n +[domain-translate]: https://docs.godotengine.org/en/latest/classes/class_translationdomain.html#class-translationdomain-method-translate +[domain-translate-plural]: https://docs.godotengine.org/en/latest/classes/class_translationdomain.html#class-translationdomain-method-translate-plural + ## Development ### pre-commit @@ -89,14 +157,19 @@ This plugin uses the [Godot Unit Test](https://gut.readthedocs.io/en/latest/) (G Tests can also be run from the command line using the GUT command line script: ``` -godot --path . --headless --script addons/gut/gut_cmdln.gd -gexit +godot --path . --headless -s addons/gut/gut_cmdln.gd -gexit ``` -A few options are of note here. `--path` instructs Godot to use the project in -the current directory. `--headless` instructs Godot to run without a display or -sound. `--script` instructs Godot to run the GUT command line script instead of -running the main scene. `-gexit` is an option for the GUT command line script -that instructs GUT to exit after the tests complete. +A few options are of note here: + +- `--path` instructs Godot to use the project in the current directory. +- `--headless` instructs Godot to run without a display or sound. +- `-s` instructs Godot to run the GUT command line script instead of + running the main scene. Due to a [bug in + GUT](https://github.com/bitwes/Gut/issues/667), the long form `--script` + cannot be used. +- `-gexit` is an option for the GUT command line script that instructs GUT to + exit after the tests complete. There are several other GUT command line options for running specific tests. For example, `-gtest=path/to/test_script_1.gd,path/to/test_script_2.gd` can be diff --git a/addons/block_code/block_code_node/block_code.gd b/addons/block_code/block_code_node/block_code.gd index 97f81e7d..6ea295ba 100644 --- a/addons/block_code/block_code_node/block_code.gd +++ b/addons/block_code/block_code_node/block_code.gd @@ -3,7 +3,14 @@ class_name BlockCode extends Node -@export var block_script: BlockScriptSerialization = null +const TxUtils := preload("res://addons/block_code/translation/utils.gd") + +@export var block_script: BlockScriptSerialization = null: + set = _set_block_script + + +func _init(): + TxUtils.set_block_translation_domain(self) func _ready(): @@ -31,6 +38,17 @@ func _enter_tree(): block_script = new_block_script +func _set_block_script(value): + if value == null: + # Wipe out the bidirectional link between this block code node and the + # block script + if block_script: + block_script.block_code_node = null + else: + value.block_code_node = self + block_script = value + + func _update_parent_script(): if Engine.is_editor_hint(): push_error("Updating the parent script must happen in game.") diff --git a/addons/block_code/block_code_plugin.gd b/addons/block_code/block_code_plugin.gd index 0067b7f2..ff960f1c 100644 --- a/addons/block_code/block_code_plugin.gd +++ b/addons/block_code/block_code_plugin.gd @@ -4,6 +4,7 @@ extends EditorPlugin const MainPanelScene := preload("res://addons/block_code/ui/main_panel.tscn") const MainPanel = preload("res://addons/block_code/ui/main_panel.gd") const Types = preload("res://addons/block_code/types/types.gd") +const TxUtils := preload("res://addons/block_code/translation/utils.gd") const ScriptWindow := preload("res://addons/block_code/ui/script_window/script_window.tscn") static var main_panel: MainPanel @@ -12,6 +13,9 @@ static var block_code_button: Button const BlockInspectorPlugin := preload("res://addons/block_code/inspector_plugin/block_script_inspector.gd") var block_inspector_plugin: BlockInspectorPlugin +const BlockTranslationParserPlugin := preload("res://addons/block_code/translation/parser.gd") +var _tx_parser_plugin: BlockTranslationParserPlugin + var editor_inspector: EditorInspector var _selected_block_code: BlockCode @@ -29,6 +33,11 @@ const DISABLED_CLASSES := [ ] +func _init(): + TxUtils.load_translations() + TxUtils.set_block_translation_domain(self) + + func _enter_tree(): Types.init_cast_graph() @@ -41,6 +50,14 @@ func _enter_tree(): block_inspector_plugin = BlockInspectorPlugin.new() add_inspector_plugin(block_inspector_plugin) + if not _tx_parser_plugin: + _tx_parser_plugin = BlockTranslationParserPlugin.new() + add_translation_parser_plugin(_tx_parser_plugin) + + # Custom Project->Tools menu items. + add_tool_menu_item(tr("Regenerate %s POT file") % "BlockCode", TxUtils.regenerate_pot_file) + add_tool_menu_item(tr("Update %s translated files") % "BlockCode", TxUtils.update_pot_files) + # Remove unwanted class nodes from create node old_feature_profile = EditorInterface.get_current_feature_profile() @@ -61,9 +78,7 @@ func _enter_tree(): func script_window_requested(script: String): var script_window = ScriptWindow.instantiate() script_window.script_content = script - - EditorInterface.get_base_control().add_child(script_window) - + EditorInterface.popup_dialog(script_window) await script_window.close_requested script_window.queue_free() @@ -71,6 +86,7 @@ func script_window_requested(script: String): func _exit_tree(): + remove_translation_parser_plugin(_tx_parser_plugin) remove_inspector_plugin(block_inspector_plugin) if block_code_button: diff --git a/addons/block_code/blocks/communication/area2d_on_entered.tres b/addons/block_code/blocks/communication/area2d_on_entered.tres index 7b358968..66e926cf 100644 --- a/addons/block_code/blocks/communication/area2d_on_entered.tres +++ b/addons/block_code/blocks/communication/area2d_on_entered.tres @@ -11,8 +11,7 @@ category = "Communication | Methods" type = 1 variant_type = 0 display_template = "when this node collides with [something: OBJECT]" -code_template = "func _on_body_entered(something: Node2D): -" +code_template = "func _on_body_entered(something: Node2D):" defaults = {} signal_name = "body_entered" scope = "" diff --git a/addons/block_code/blocks/communication/area2d_on_exited.tres b/addons/block_code/blocks/communication/area2d_on_exited.tres index 7e959b17..1af61a60 100644 --- a/addons/block_code/blocks/communication/area2d_on_exited.tres +++ b/addons/block_code/blocks/communication/area2d_on_exited.tres @@ -11,8 +11,7 @@ category = "Communication | Methods" type = 1 variant_type = 0 display_template = "when this node stops colliding with [something: OBJECT]" -code_template = "func _on_body_exited(something: Node2D): -" +code_template = "func _on_body_exited(something: Node2D):" defaults = {} signal_name = "body_exited" scope = "" diff --git a/addons/block_code/blocks/communication/call_method_node.tres b/addons/block_code/blocks/communication/call_method_node.tres index b677cdb4..3937dddb 100644 --- a/addons/block_code/blocks/communication/call_method_node.tres +++ b/addons/block_code/blocks/communication/call_method_node.tres @@ -10,7 +10,7 @@ description = "Calls the method/function of the given node" category = "Communication | Methods" type = 2 variant_type = 0 -display_template = "call method {method_name: STRING} in node {node: OBJECT}" +display_template = "call method {method_name: STRING} on node {node: OBJECT}" code_template = "{node}.call({method_name})" defaults = {} signal_name = "" diff --git a/addons/block_code/blocks/communication/rigidbody2d_on_entered.tres b/addons/block_code/blocks/communication/rigidbody2d_on_entered.tres index b9859c3c..9ffcfaf6 100644 --- a/addons/block_code/blocks/communication/rigidbody2d_on_entered.tres +++ b/addons/block_code/blocks/communication/rigidbody2d_on_entered.tres @@ -11,8 +11,7 @@ category = "Communication | Methods" type = 1 variant_type = 0 display_template = "when this node collides with [something: OBJECT]" -code_template = "func _on_body_entered(something: Node2D): -" +code_template = "func _on_body_entered(something: Node2D):" defaults = {} signal_name = "body_entered" scope = "" diff --git a/addons/block_code/blocks/communication/rigidbody2d_on_exited.tres b/addons/block_code/blocks/communication/rigidbody2d_on_exited.tres index 7d8cf419..89638d96 100644 --- a/addons/block_code/blocks/communication/rigidbody2d_on_exited.tres +++ b/addons/block_code/blocks/communication/rigidbody2d_on_exited.tres @@ -11,8 +11,7 @@ category = "Communication | Methods" type = 1 variant_type = 0 display_template = "when this node stops colliding with [something: OBJECT]" -code_template = "func _on_body_exited(something: Node2D): -" +code_template = "func _on_body_exited(something: Node2D):" defaults = {} signal_name = "body_exited" scope = "" diff --git a/addons/block_code/blocks/communication/switch_scene.tres b/addons/block_code/blocks/communication/switch_scene.tres new file mode 100644 index 00000000..cf1bfe7e --- /dev/null +++ b/addons/block_code/blocks/communication/switch_scene.tres @@ -0,0 +1,18 @@ +[gd_resource type="Resource" load_steps=2 format=3 uid="uid://dnc2555wnobks"] + +[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_rnqd5"] + +[resource] +script = ExtResource("1_rnqd5") +name = &"switch_scene" +target_node_class = "" +description = "Stop playing the current scene, and switch to a different one. You might use this to switch to a new level." +category = "Communication | Methods" +type = 2 +variant_type = 0 +display_template = "switch the scene to {file_path: STRING}" +code_template = "get_tree().change_scene_to_file({file_path}) +" +defaults = {} +signal_name = "" +scope = "" diff --git a/addons/block_code/blocks/graphics/animationplayer_play.tres b/addons/block_code/blocks/graphics/animationplayer_play.tres index 38149cc1..3a593f83 100644 --- a/addons/block_code/blocks/graphics/animationplayer_play.tres +++ b/addons/block_code/blocks/graphics/animationplayer_play.tres @@ -1,4 +1,4 @@ -[gd_resource type="Resource" load_steps=6 format=3 uid="uid://c5e1byehtxwc0"] +[gd_resource type="Resource" load_steps=7 format=3 uid="uid://c5e1byehtxwc0"] [ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_emeuv"] [ext_resource type="Script" path="res://addons/block_code/code_generation/option_data.gd" id="1_xu43h"] @@ -14,6 +14,11 @@ script = ExtResource("1_xu43h") selected = 0 items = ["forward", "backwards"] +[sub_resource type="Resource" id="Resource_17pec"] +script = ExtResource("1_xu43h") +selected = 0 +items = ["until done", "in the background"] + [resource] script = ExtResource("1_emeuv") name = &"animationplayer_play" @@ -22,15 +27,18 @@ description = "Play the animation." category = "Graphics | Animation" type = 2 variant_type = 0 -display_template = "play {animation: STRING} {direction: NIL}" +display_template = "play {animation: STRING} {direction: NIL} {wait_mode: NIL}" code_template = "if {direction} == \"forward\": play({animation}) else: play_backwards({animation}) +if {wait_mode} == \"until done\": + await animation_finished " defaults = { "animation": SubResource("Resource_qpxn2"), -"direction": SubResource("Resource_vnp2w") +"direction": SubResource("Resource_vnp2w"), +"wait_mode": SubResource("Resource_17pec") } signal_name = "" scope = "" diff --git a/addons/block_code/blocks/lifecycle/queue_free_node.tres b/addons/block_code/blocks/lifecycle/queue_free_node.tres new file mode 100644 index 00000000..4c393087 --- /dev/null +++ b/addons/block_code/blocks/lifecycle/queue_free_node.tres @@ -0,0 +1,17 @@ +[gd_resource type="Resource" load_steps=2 format=3 uid="uid://d31lkxkm5lww7"] + +[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_75fle"] + +[resource] +script = ExtResource("1_75fle") +name = &"queue_free_node" +target_node_class = "" +description = "Queues the given node to be deleted at the end of the current frame" +category = "Lifecycle" +type = 2 +variant_type = 0 +display_template = "remove {node: OBJECT}" +code_template = "{node}.queue_free()" +defaults = {} +signal_name = "" +scope = "" diff --git a/addons/block_code/blocks/math/vector2_x.tres b/addons/block_code/blocks/math/vector2_x.tres new file mode 100644 index 00000000..7e5e3dfa --- /dev/null +++ b/addons/block_code/blocks/math/vector2_x.tres @@ -0,0 +1,19 @@ +[gd_resource type="Resource" load_steps=2 format=3 uid="uid://btsfimn63xhi2"] + +[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_dvsrc"] + +[resource] +script = ExtResource("1_dvsrc") +name = &"vector2_x" +target_node_class = "" +description = "Gives the x of a [i]Vector2[/i]" +category = "Math" +type = 3 +variant_type = 3 +display_template = "x of {vector2: VECTOR2}" +code_template = "{vector2}.x" +defaults = { +"vector2": Vector2(0, 0) +} +signal_name = "" +scope = "" diff --git a/addons/block_code/blocks/math/vector2_y.tres b/addons/block_code/blocks/math/vector2_y.tres new file mode 100644 index 00000000..802f0b56 --- /dev/null +++ b/addons/block_code/blocks/math/vector2_y.tres @@ -0,0 +1,19 @@ +[gd_resource type="Resource" load_steps=2 format=3 uid="uid://ccbrbp4lee3wt"] + +[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_wuold"] + +[resource] +script = ExtResource("1_wuold") +name = &"vector2_y" +target_node_class = "" +description = "Gives the y of a [i]Vector2[/i]" +category = "Math" +type = 3 +variant_type = 3 +display_template = "y of {vector2: VECTOR2}" +code_template = "{vector2}.y" +defaults = { +"vector2": Vector2(0, 0) +} +signal_name = "" +scope = "" diff --git a/addons/block_code/blocks/math/vector_from_angle.tres b/addons/block_code/blocks/math/vector_from_angle.tres new file mode 100644 index 00000000..fce91df3 --- /dev/null +++ b/addons/block_code/blocks/math/vector_from_angle.tres @@ -0,0 +1,17 @@ +[gd_resource type="Resource" load_steps=2 format=3 uid="uid://c7a6wnxegkfd5"] + +[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_1p1ve"] + +[resource] +script = ExtResource("1_1p1ve") +name = &"from_angle" +target_node_class = "" +description = "Creates a unit Vector2 rotated to the given angle in radians." +category = "Math" +type = 3 +variant_type = 5 +display_template = "vector from {angle: FLOAT}" +code_template = "Vector2.from_angle({angle})" +defaults = {} +signal_name = "" +scope = "" diff --git a/addons/block_code/blocks/math/vector_multiply.tres b/addons/block_code/blocks/math/vector_multiply.tres new file mode 100644 index 00000000..8c82607d --- /dev/null +++ b/addons/block_code/blocks/math/vector_multiply.tres @@ -0,0 +1,20 @@ +[gd_resource type="Resource" load_steps=2 format=3 uid="uid://bff7cwmpisihj"] + +[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_52jwf"] + +[resource] +script = ExtResource("1_52jwf") +name = &"vector_multiply" +target_node_class = "" +description = "Multiplies a vector with a number. Use this, for example, to get a point some distance away along an angle." +category = "Math" +type = 3 +variant_type = 5 +display_template = "multiply {vector: VECTOR2} by {number: FLOAT}" +code_template = "{vector} * {number}" +defaults = { +"number": 1.0, +"vector": Vector2(1, 1) +} +signal_name = "" +scope = "" diff --git a/addons/block_code/blocks/spawn/cpuparticles2d_finished.tres b/addons/block_code/blocks/spawn/cpuparticles2d_finished.tres new file mode 100644 index 00000000..7758be63 --- /dev/null +++ b/addons/block_code/blocks/spawn/cpuparticles2d_finished.tres @@ -0,0 +1,17 @@ +[gd_resource type="Resource" load_steps=2 format=3 uid="uid://c188gpgf4rpns"] + +[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_pmpup"] + +[resource] +script = ExtResource("1_pmpup") +name = &"cpuparticles2d_finished" +target_node_class = "CPUParticles2D" +description = "Emitted when all active particles have finished processing." +category = "Lifecycle | Spawn" +type = 1 +variant_type = 0 +display_template = "when particles are finished" +code_template = "func _on_finished():" +defaults = {} +signal_name = "finished" +scope = "" diff --git a/addons/block_code/blocks/ui/label_set_text.tres b/addons/block_code/blocks/ui/label_set_text.tres new file mode 100644 index 00000000..1a4f82ca --- /dev/null +++ b/addons/block_code/blocks/ui/label_set_text.tres @@ -0,0 +1,17 @@ +[gd_resource type="Resource" load_steps=2 format=3 uid="uid://ciqkywxdk4uht"] + +[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_bofov"] + +[resource] +script = ExtResource("1_bofov") +name = &"label_set_text" +target_node_class = "Label" +description = "Set the text for the label." +category = "UI" +type = 2 +variant_type = 0 +display_template = "set text to {text: STRING}" +code_template = "text = {text}" +defaults = {} +signal_name = "" +scope = "" diff --git a/addons/block_code/code_generation/block_definition.gd b/addons/block_code/code_generation/block_definition.gd index 26ac9e70..b9a72e82 100644 --- a/addons/block_code/code_generation/block_definition.gd +++ b/addons/block_code/code_generation/block_definition.gd @@ -3,7 +3,7 @@ extends Resource const Types = preload("res://addons/block_code/types/types.gd") -const FORMAT_STRING_PATTERN = "\\[(?[^\\]]+)\\]|\\{(?[^}]+)\\}|(?