diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 1d4e315c..179f780a 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -34,12 +34,13 @@ jobs: matrix: godot-version: - 4.3.0 + - 4.4.0-dev7 runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Setup Godot - uses: chickensoft-games/setup-godot@v2.1.1 + uses: chickensoft-games/setup-godot@v2.2.0 with: version: ${{ matrix.godot-version }} use-dotnet: false diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..0818b135 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,128 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, religion, or sexual identity +and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the + overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or + advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email + address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +tech AT endlessos DOT org. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series +of actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or +permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within +the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.0, available at +https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct +enforcement ladder](https://github.com/mozilla/diversity). + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see the FAQ at +https://www.contributor-covenant.org/faq. Translations are available at +https://www.contributor-covenant.org/translations. diff --git a/addons/block_code/README.md b/addons/block_code/README.md index 89036b93..3073ad88 100644 --- a/addons/block_code/README.md +++ b/addons/block_code/README.md @@ -21,7 +21,9 @@ See our [pedagogy and audience documentation](docs/PEDAGOGY.md) for more info. ## Getting Started -1. Install the plugin through the Godot AssetLib searching for the name +1. Make sure you have Godot 4.3 or a newer version installed. + +2. Install the plugin through the Godot AssetLib searching for the name Block Coding. You can also download it from the online [Asset Library](https://godotengine.org/asset-library/asset/3095) and import it through AssetLib. Alternatively, you can clone the git repository and @@ -30,13 +32,9 @@ See our [pedagogy and audience documentation](docs/PEDAGOGY.md) for more info. project, reload the project once after opening it for the first time to resolve any errors. This is a Godot issue.* -2. Make sure to enable the plugin in **Project** → **Project Settings** → **Plugins**. - -3. You're ready to get started! Open a scene, select a node, and observe that there's a **Block Code** section within the lower central pane of the Godot editor, where you usually find debugging, animation and shader functionality. Click **Block Code** and then use the **Add Block Code** button to create a block canvas. - -4. Drag blocks from the picker and snap them together to create a script. You can switch to other Block Code scripts by selecting the respective node from the scene tree. +3. Make sure to enable the plugin in **Project** → **Project Settings** → **Plugins**. -5. **Run** the scene to see your Block Code scripts in action. Block Code scripts are saved within the scene. +You're ready to get started! You can continue reading our [user documentation](docs/USAGE.md). If you clone the plugin's git repository and open it in Godot, you will be presented with a block-built Pong game as an example. @@ -52,25 +50,9 @@ We will now seek feedback from learners, educators and game makers, as well as r There is no language or data format stability implemented or expected in these early stages. If you upgrade the block coding plugin within an existing project, expect any existing block scripts to stop working and need reimplementing from scratch. For now, you probably want to avoid updating the plugin within your project if it's meeting your needs, or only doing that very sporadically. We will consider offering stability guarantees in future stages of development. -## General user guidance - -Block scripts run against the node where you created them. The "Queue Free" block is going to free that node, not any other. - -The selection of available blocks varies based on the node type. For example, create a block script on an `Area2D` and you will notice that you have an `On body entered` signal handling block available. Create a node script on an `AnimationPlayer` node and you will observe blocks for starting and stopping animations. - -If you wish to switch context to another node, you need to define a function in that other node, and then call it. Once execution jumps into that function, blocks will now act against that other node, and you'll have access to type-specific blocks belonging to that other node. You'll need do this kind of thing if you want to trigger the freeing of another node, or trigger an animation to start playing. This is both strong in conveying the concepts of objects and encapsulation, while also a bit tedious - we may revisit in future! - -We have some high level blocks for simplifying common game elements. Add a SimpleCharacter node to get a game element that can be connected to keyboard and gamepad input with just one type-specific block. Add a SimpleScoring node to display a score on-screen, accompanied by simple blocks for adjusting that score. - -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. - -You can also drag a file from the Resource Filesystem dock and drop it into the block script as a getter block. It will become a constant value block holding the file's resource full path. - -## Feedback +## Feedback & Discussion -Please share feedback in the [Godot Forum Block Coding thread](https://forum.godotengine.org/t/block-coding-high-level-block-based-visual-programming/68941). +Please join our [Discussion Board](https://github.com/endlessm/godot-block-coding/discussions) to provide feedback, share ideas, and ask questions about building your games with Block Coding. ## Localization diff --git a/addons/block_code/block_code_node/block_code.gd b/addons/block_code/block_code_node/block_code.gd index 6ea295ba..07e7cdeb 100644 --- a/addons/block_code/block_code_node/block_code.gd +++ b/addons/block_code/block_code_node/block_code.gd @@ -84,6 +84,10 @@ func _get_configuration_warnings(): warnings.append("A BlockCode must not be a root node.") if get_parent() is BlockCode: warnings.append("The parent must not be a BlockCode.") + if get_parent().script: + var parent_script_name: StringName = get_parent().script.get_global_name() + if not (parent_script_name and block_script and parent_script_name == block_script.script_inherits): + warnings.append("This BlockCode will override the existing script in the parent node.") if get_parent().find_children("*", "BlockCode", false).size() > 1: warnings.append("The parent should only contain one BlockCode.") if block_script and _get_custom_or_native_class(get_parent()) != block_script.script_inherits: diff --git a/addons/block_code/block_code_node/block_code.gd.uid b/addons/block_code/block_code_node/block_code.gd.uid new file mode 100644 index 00000000..f194ab11 --- /dev/null +++ b/addons/block_code/block_code_node/block_code.gd.uid @@ -0,0 +1 @@ +uid://cumxsbxj56dmk diff --git a/addons/block_code/block_code_plugin.gd.uid b/addons/block_code/block_code_plugin.gd.uid new file mode 100644 index 00000000..0be7dba6 --- /dev/null +++ b/addons/block_code/block_code_plugin.gd.uid @@ -0,0 +1 @@ +uid://bx7wld2cftncr diff --git a/addons/block_code/blocks/communication/add_node_to_group.tres b/addons/block_code/blocks/communication/add_node_to_group.tres index 0531ce2f..00c2bf7f 100644 --- a/addons/block_code/blocks/communication/add_node_to_group.tres +++ b/addons/block_code/blocks/communication/add_node_to_group.tres @@ -1,8 +1,8 @@ [gd_resource type="Resource" load_steps=5 format=3 uid="uid://bpvefei72nh3a"] -[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_5qal7"] -[ext_resource type="Script" path="res://addons/block_code/code_generation/option_data.gd" id="1_auf06"] -[ext_resource type="Script" path="res://addons/block_code/blocks/communication/groups.gd" id="1_p83c7"] +[ext_resource type="Script" uid="uid://bau6qtv87fcdo" path="res://addons/block_code/code_generation/block_definition.gd" id="1_5qal7"] +[ext_resource type="Script" uid="uid://bkapmk0btnk7y" path="res://addons/block_code/code_generation/option_data.gd" id="1_auf06"] +[ext_resource type="Script" uid="uid://cumj4bsraukca" path="res://addons/block_code/blocks/communication/groups.gd" id="1_p83c7"] [sub_resource type="Resource" id="Resource_sus0f"] script = ExtResource("1_auf06") @@ -23,6 +23,5 @@ defaults = { "group": SubResource("Resource_sus0f") } signal_name = "" -scope = "" is_advanced = false extension_script = ExtResource("1_p83c7") diff --git a/addons/block_code/blocks/communication/add_to_group.tres b/addons/block_code/blocks/communication/add_to_group.tres index 1d00f270..d5cfc713 100644 --- a/addons/block_code/blocks/communication/add_to_group.tres +++ b/addons/block_code/blocks/communication/add_to_group.tres @@ -1,8 +1,8 @@ [gd_resource type="Resource" load_steps=5 format=3 uid="uid://bvrmau8atjx1x"] -[ext_resource type="Script" path="res://addons/block_code/code_generation/option_data.gd" id="1_aom4j"] -[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_bcm71"] -[ext_resource type="Script" path="res://addons/block_code/blocks/communication/groups.gd" id="2_42ixf"] +[ext_resource type="Script" uid="uid://bkapmk0btnk7y" path="res://addons/block_code/code_generation/option_data.gd" id="1_aom4j"] +[ext_resource type="Script" uid="uid://bau6qtv87fcdo" path="res://addons/block_code/code_generation/block_definition.gd" id="1_bcm71"] +[ext_resource type="Script" uid="uid://cumj4bsraukca" path="res://addons/block_code/blocks/communication/groups.gd" id="2_42ixf"] [sub_resource type="Resource" id="Resource_fk0wa"] script = ExtResource("1_aom4j") @@ -23,6 +23,5 @@ defaults = { "group": SubResource("Resource_fk0wa") } signal_name = "" -scope = "" is_advanced = false extension_script = ExtResource("2_42ixf") diff --git a/addons/block_code/blocks/communication/call_method_group.tres b/addons/block_code/blocks/communication/call_method_group.tres index b7e38026..b0dc5d19 100644 --- a/addons/block_code/blocks/communication/call_method_group.tres +++ b/addons/block_code/blocks/communication/call_method_group.tres @@ -1,8 +1,8 @@ [gd_resource type="Resource" load_steps=5 format=3 uid="uid://c15vtdfihdxb8"] -[ext_resource type="Script" path="res://addons/block_code/code_generation/option_data.gd" id="1_3nuts"] -[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_mlm68"] -[ext_resource type="Script" path="res://addons/block_code/blocks/communication/groups.gd" id="1_of577"] +[ext_resource type="Script" uid="uid://bkapmk0btnk7y" path="res://addons/block_code/code_generation/option_data.gd" id="1_3nuts"] +[ext_resource type="Script" uid="uid://bau6qtv87fcdo" path="res://addons/block_code/code_generation/block_definition.gd" id="1_mlm68"] +[ext_resource type="Script" uid="uid://cumj4bsraukca" path="res://addons/block_code/blocks/communication/groups.gd" id="1_of577"] [sub_resource type="Resource" id="Resource_f4ctg"] script = ExtResource("1_3nuts") @@ -23,6 +23,5 @@ defaults = { "group": SubResource("Resource_f4ctg") } signal_name = "" -scope = "" is_advanced = false extension_script = ExtResource("1_of577") diff --git a/addons/block_code/blocks/communication/get_node.gd.uid b/addons/block_code/blocks/communication/get_node.gd.uid new file mode 100644 index 00000000..b08b5b23 --- /dev/null +++ b/addons/block_code/blocks/communication/get_node.gd.uid @@ -0,0 +1 @@ +uid://cscfelhxcapk3 diff --git a/addons/block_code/blocks/communication/get_node.tres b/addons/block_code/blocks/communication/get_node.tres index 79788891..62652213 100644 --- a/addons/block_code/blocks/communication/get_node.tres +++ b/addons/block_code/blocks/communication/get_node.tres @@ -1,8 +1,8 @@ [gd_resource type="Resource" load_steps=5 format=3 uid="uid://canpdkahokjqs"] -[ext_resource type="Script" path="res://addons/block_code/code_generation/option_data.gd" id="1_bk47y"] -[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_d60g7"] -[ext_resource type="Script" path="res://addons/block_code/blocks/communication/get_node.gd" id="1_we5wl"] +[ext_resource type="Script" uid="uid://bkapmk0btnk7y" path="res://addons/block_code/code_generation/option_data.gd" id="1_bk47y"] +[ext_resource type="Script" uid="uid://bau6qtv87fcdo" path="res://addons/block_code/code_generation/block_definition.gd" id="1_d60g7"] +[ext_resource type="Script" uid="uid://cscfelhxcapk3" path="res://addons/block_code/blocks/communication/get_node.gd" id="1_we5wl"] [sub_resource type="Resource" id="Resource_esr4a"] script = ExtResource("1_bk47y") @@ -23,6 +23,5 @@ defaults = { "path": SubResource("Resource_esr4a") } signal_name = "" -scope = "" is_advanced = false extension_script = ExtResource("1_we5wl") diff --git a/addons/block_code/blocks/communication/groups.gd.uid b/addons/block_code/blocks/communication/groups.gd.uid new file mode 100644 index 00000000..e39b79d2 --- /dev/null +++ b/addons/block_code/blocks/communication/groups.gd.uid @@ -0,0 +1 @@ +uid://cumj4bsraukca diff --git a/addons/block_code/blocks/communication/is_in_group.tres b/addons/block_code/blocks/communication/is_in_group.tres index 23fa4191..f4dd5499 100644 --- a/addons/block_code/blocks/communication/is_in_group.tres +++ b/addons/block_code/blocks/communication/is_in_group.tres @@ -1,8 +1,8 @@ [gd_resource type="Resource" load_steps=5 format=3 uid="uid://q4cnstftvsiu"] -[ext_resource type="Script" path="res://addons/block_code/code_generation/option_data.gd" id="1_cla3i"] -[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_tjyq5"] -[ext_resource type="Script" path="res://addons/block_code/blocks/communication/groups.gd" id="2_o165d"] +[ext_resource type="Script" uid="uid://bkapmk0btnk7y" path="res://addons/block_code/code_generation/option_data.gd" id="1_cla3i"] +[ext_resource type="Script" uid="uid://bau6qtv87fcdo" path="res://addons/block_code/code_generation/block_definition.gd" id="1_tjyq5"] +[ext_resource type="Script" uid="uid://cumj4bsraukca" path="res://addons/block_code/blocks/communication/groups.gd" id="2_o165d"] [sub_resource type="Resource" id="Resource_d0v0d"] script = ExtResource("1_cla3i") @@ -23,6 +23,5 @@ defaults = { "group": SubResource("Resource_d0v0d") } signal_name = "" -scope = "" is_advanced = false extension_script = ExtResource("2_o165d") diff --git a/addons/block_code/blocks/communication/is_node_in_group.tres b/addons/block_code/blocks/communication/is_node_in_group.tres index 83b5611b..a10fe700 100644 --- a/addons/block_code/blocks/communication/is_node_in_group.tres +++ b/addons/block_code/blocks/communication/is_node_in_group.tres @@ -1,8 +1,8 @@ [gd_resource type="Resource" load_steps=5 format=3 uid="uid://bbtdxeey74x67"] -[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_5krrs"] -[ext_resource type="Script" path="res://addons/block_code/blocks/communication/groups.gd" id="1_r4prw"] -[ext_resource type="Script" path="res://addons/block_code/code_generation/option_data.gd" id="1_y4j0k"] +[ext_resource type="Script" uid="uid://bau6qtv87fcdo" path="res://addons/block_code/code_generation/block_definition.gd" id="1_5krrs"] +[ext_resource type="Script" uid="uid://cumj4bsraukca" path="res://addons/block_code/blocks/communication/groups.gd" id="1_r4prw"] +[ext_resource type="Script" uid="uid://bkapmk0btnk7y" path="res://addons/block_code/code_generation/option_data.gd" id="1_y4j0k"] [sub_resource type="Resource" id="Resource_o38ym"] script = ExtResource("1_y4j0k") @@ -23,6 +23,5 @@ defaults = { "group": SubResource("Resource_o38ym") } signal_name = "" -scope = "" is_advanced = false extension_script = ExtResource("1_r4prw") diff --git a/addons/block_code/blocks/communication/remove_from_group.tres b/addons/block_code/blocks/communication/remove_from_group.tres index f33b5acb..64dd8d3d 100644 --- a/addons/block_code/blocks/communication/remove_from_group.tres +++ b/addons/block_code/blocks/communication/remove_from_group.tres @@ -1,8 +1,8 @@ [gd_resource type="Resource" load_steps=5 format=3 uid="uid://dgenw5wyqorvq"] -[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_cdwef"] -[ext_resource type="Script" path="res://addons/block_code/blocks/communication/groups.gd" id="1_i50fw"] -[ext_resource type="Script" path="res://addons/block_code/code_generation/option_data.gd" id="1_mnxp7"] +[ext_resource type="Script" uid="uid://bau6qtv87fcdo" path="res://addons/block_code/code_generation/block_definition.gd" id="1_cdwef"] +[ext_resource type="Script" uid="uid://cumj4bsraukca" path="res://addons/block_code/blocks/communication/groups.gd" id="1_i50fw"] +[ext_resource type="Script" uid="uid://bkapmk0btnk7y" path="res://addons/block_code/code_generation/option_data.gd" id="1_mnxp7"] [sub_resource type="Resource" id="Resource_45b71"] script = ExtResource("1_mnxp7") @@ -23,6 +23,5 @@ defaults = { "group": SubResource("Resource_45b71") } signal_name = "" -scope = "" is_advanced = false extension_script = ExtResource("1_i50fw") diff --git a/addons/block_code/blocks/communication/remove_node_from_group.tres b/addons/block_code/blocks/communication/remove_node_from_group.tres index 50f5195b..afc4a9cf 100644 --- a/addons/block_code/blocks/communication/remove_node_from_group.tres +++ b/addons/block_code/blocks/communication/remove_node_from_group.tres @@ -1,8 +1,8 @@ [gd_resource type="Resource" load_steps=5 format=3 uid="uid://b2dwk77hnri8y"] -[ext_resource type="Script" path="res://addons/block_code/code_generation/option_data.gd" id="1_clwhe"] -[ext_resource type="Script" path="res://addons/block_code/blocks/communication/groups.gd" id="1_h3lhb"] -[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_pec24"] +[ext_resource type="Script" uid="uid://bkapmk0btnk7y" path="res://addons/block_code/code_generation/option_data.gd" id="1_clwhe"] +[ext_resource type="Script" uid="uid://cumj4bsraukca" path="res://addons/block_code/blocks/communication/groups.gd" id="1_h3lhb"] +[ext_resource type="Script" uid="uid://bau6qtv87fcdo" path="res://addons/block_code/code_generation/block_definition.gd" id="1_pec24"] [sub_resource type="Resource" id="Resource_03rge"] script = ExtResource("1_clwhe") @@ -23,6 +23,5 @@ defaults = { "group": SubResource("Resource_03rge") } signal_name = "" -scope = "" is_advanced = false extension_script = ExtResource("1_h3lhb") diff --git a/addons/block_code/blocks/graphics/animationplayer_play.gd.uid b/addons/block_code/blocks/graphics/animationplayer_play.gd.uid new file mode 100644 index 00000000..5b979254 --- /dev/null +++ b/addons/block_code/blocks/graphics/animationplayer_play.gd.uid @@ -0,0 +1 @@ +uid://c38ngxebcyrg6 diff --git a/addons/block_code/blocks/graphics/animationplayer_play.tres b/addons/block_code/blocks/graphics/animationplayer_play.tres index c7d77924..1f1cfc9d 100644 --- a/addons/block_code/blocks/graphics/animationplayer_play.tres +++ b/addons/block_code/blocks/graphics/animationplayer_play.tres @@ -1,8 +1,8 @@ [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"] -[ext_resource type="Script" path="res://addons/block_code/blocks/graphics/animationplayer_play.gd" id="2_7ymgi"] +[ext_resource type="Script" uid="uid://bau6qtv87fcdo" path="res://addons/block_code/code_generation/block_definition.gd" id="1_emeuv"] +[ext_resource type="Script" uid="uid://bkapmk0btnk7y" path="res://addons/block_code/code_generation/option_data.gd" id="1_xu43h"] +[ext_resource type="Script" uid="uid://c38ngxebcyrg6" path="res://addons/block_code/blocks/graphics/animationplayer_play.gd" id="2_7ymgi"] [sub_resource type="Resource" id="Resource_qpxn2"] script = ExtResource("1_xu43h") @@ -41,6 +41,5 @@ defaults = { "wait_mode": SubResource("Resource_17pec") } signal_name = "" -scope = "" is_advanced = false extension_script = ExtResource("2_7ymgi") diff --git a/addons/block_code/blocks/input/is_input_actioned.gd.uid b/addons/block_code/blocks/input/is_input_actioned.gd.uid new file mode 100644 index 00000000..406cdc00 --- /dev/null +++ b/addons/block_code/blocks/input/is_input_actioned.gd.uid @@ -0,0 +1 @@ +uid://cg3sepbbe45ey diff --git a/addons/block_code/blocks/input/is_input_actioned.tres b/addons/block_code/blocks/input/is_input_actioned.tres index a8412821..7acfc62e 100644 --- a/addons/block_code/blocks/input/is_input_actioned.tres +++ b/addons/block_code/blocks/input/is_input_actioned.tres @@ -1,8 +1,8 @@ [gd_resource type="Resource" load_steps=5 format=3 uid="uid://86j17le5e58u"] -[ext_resource type="Script" path="res://addons/block_code/code_generation/option_data.gd" id="1_d8i05"] -[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_rprh7"] -[ext_resource type="Script" path="res://addons/block_code/blocks/input/is_input_actioned.gd" id="2_h11b7"] +[ext_resource type="Script" uid="uid://bkapmk0btnk7y" path="res://addons/block_code/code_generation/option_data.gd" id="1_d8i05"] +[ext_resource type="Script" uid="uid://bau6qtv87fcdo" path="res://addons/block_code/code_generation/block_definition.gd" id="1_rprh7"] +[ext_resource type="Script" uid="uid://cg3sepbbe45ey" path="res://addons/block_code/blocks/input/is_input_actioned.gd" id="2_h11b7"] [sub_resource type="Resource" id="Resource_ai5in"] script = ExtResource("1_d8i05") @@ -23,6 +23,5 @@ defaults = { "action": SubResource("Resource_ai5in") } signal_name = "" -scope = "" is_advanced = false extension_script = ExtResource("2_h11b7") diff --git a/addons/block_code/blocks/input/mouse_position.tres b/addons/block_code/blocks/input/mouse_position.tres new file mode 100644 index 00000000..39fb46ee --- /dev/null +++ b/addons/block_code/blocks/input/mouse_position.tres @@ -0,0 +1,17 @@ +[gd_resource type="Resource" load_steps=2 format=3 uid="uid://dwrdne76nxk7t"] + +[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_7vl3n"] + +[resource] +script = ExtResource("1_7vl3n") +name = &"mouse_position" +target_node_class = "CanvasItem" +description = "The coordinates of the mouse position." +category = "Input" +type = 3 +variant_type = 5 +display_template = "mouse position" +code_template = "get_global_mouse_position()" +defaults = {} +signal_name = "" +is_advanced = false diff --git a/addons/block_code/blocks/logic/compare.tres b/addons/block_code/blocks/logic/compare.tres index dca45e8d..5fbeb31c 100644 --- a/addons/block_code/blocks/logic/compare.tres +++ b/addons/block_code/blocks/logic/compare.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" load_steps=4 format=3 uid="uid://pr5wnn3ltkbo"] -[ext_resource type="Script" path="res://addons/block_code/code_generation/option_data.gd" id="1_hcv2h"] -[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_wp40r"] +[ext_resource type="Script" uid="uid://bkapmk0btnk7y" path="res://addons/block_code/code_generation/option_data.gd" id="1_hcv2h"] +[ext_resource type="Script" uid="uid://bau6qtv87fcdo" path="res://addons/block_code/code_generation/block_definition.gd" id="1_wp40r"] [sub_resource type="Resource" id="Resource_ie4sg"] script = ExtResource("1_hcv2h") @@ -24,5 +24,4 @@ defaults = { "op": SubResource("Resource_ie4sg") } signal_name = "" -scope = "" is_advanced = false diff --git a/addons/block_code/blocks/math/vector2_xy.tres b/addons/block_code/blocks/math/vector2_xy.tres index 47fa7358..32846064 100644 --- a/addons/block_code/blocks/math/vector2_xy.tres +++ b/addons/block_code/blocks/math/vector2_xy.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" load_steps=4 format=3 uid="uid://bpdjqy6oidfo4"] -[ext_resource type="Script" path="res://addons/block_code/code_generation/option_data.gd" id="1_p8v57"] -[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="2_207xo"] +[ext_resource type="Script" uid="uid://bkapmk0btnk7y" path="res://addons/block_code/code_generation/option_data.gd" id="1_p8v57"] +[ext_resource type="Script" uid="uid://bau6qtv87fcdo" path="res://addons/block_code/code_generation/block_definition.gd" id="2_207xo"] [sub_resource type="Resource" id="Resource_ie4sg"] script = ExtResource("1_p8v57") @@ -22,5 +22,4 @@ defaults = { "xy": SubResource("Resource_ie4sg") } signal_name = "" -scope = "" is_advanced = false diff --git a/addons/block_code/blocks/math/vector3_multiply.tres b/addons/block_code/blocks/math/vector3_multiply.tres index 7ec43ac8..65b8ff55 100644 --- a/addons/block_code/blocks/math/vector3_multiply.tres +++ b/addons/block_code/blocks/math/vector3_multiply.tres @@ -1,9 +1,9 @@ -[gd_resource type="Resource" load_steps=2 format=3 uid="uid://bff7cwmpisihj"] +[gd_resource type="Resource" load_steps=2 format=3 uid="uid://ctl30ew7wtnlj"] -[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_52jwf"] +[ext_resource type="Script" uid="uid://bau6qtv87fcdo" path="res://addons/block_code/code_generation/block_definition.gd" id="1_bxnpg"] [resource] -script = ExtResource("1_52jwf") +script = ExtResource("1_bxnpg") name = &"vector3_multiply" target_node_class = "" description = "Multiplies a Vector3 with a number. Use this, for example, to get a point some distance away along an angle." @@ -17,4 +17,4 @@ defaults = { "vector": Vector3(1, 1, 1) } signal_name = "" -scope = "" +is_advanced = false diff --git a/addons/block_code/blocks/math/vector3_xyz.tres b/addons/block_code/blocks/math/vector3_xyz.tres index a49c3a41..01374a87 100644 --- a/addons/block_code/blocks/math/vector3_xyz.tres +++ b/addons/block_code/blocks/math/vector3_xyz.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" load_steps=4 format=3 uid="uid://s72tgtbci1ui"] -[ext_resource type="Script" path="res://addons/block_code/code_generation/option_data.gd" id="1_0wc0o"] -[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="2_e6ohf"] +[ext_resource type="Script" uid="uid://bkapmk0btnk7y" path="res://addons/block_code/code_generation/option_data.gd" id="1_0wc0o"] +[ext_resource type="Script" uid="uid://bau6qtv87fcdo" path="res://addons/block_code/code_generation/block_definition.gd" id="2_e6ohf"] [sub_resource type="Resource" id="Resource_ie4sg"] script = ExtResource("1_0wc0o") @@ -22,5 +22,4 @@ defaults = { "xyz": SubResource("Resource_ie4sg") } signal_name = "" -scope = "" is_advanced = false diff --git a/addons/block_code/blocks/sounds/pause_continue_sound.tres b/addons/block_code/blocks/sounds/pause_continue_sound.tres index e66333f2..946c5b94 100644 --- a/addons/block_code/blocks/sounds/pause_continue_sound.tres +++ b/addons/block_code/blocks/sounds/pause_continue_sound.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" load_steps=4 format=3 uid="uid://wpdspamg3f6g"] -[ext_resource type="Script" path="res://addons/block_code/code_generation/option_data.gd" id="1_ilhdq"] -[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_q04gm"] +[ext_resource type="Script" uid="uid://bkapmk0btnk7y" path="res://addons/block_code/code_generation/option_data.gd" id="1_ilhdq"] +[ext_resource type="Script" uid="uid://bau6qtv87fcdo" path="res://addons/block_code/code_generation/block_definition.gd" id="1_q04gm"] [sub_resource type="Resource" id="Resource_lalgp"] script = ExtResource("1_ilhdq") @@ -27,5 +27,4 @@ defaults = { "pause": SubResource("Resource_lalgp") } signal_name = "" -scope = "" is_advanced = false diff --git a/addons/block_code/blocks/variables/vector3.tres b/addons/block_code/blocks/variables/vector3.tres index ac239691..a4633e61 100644 --- a/addons/block_code/blocks/variables/vector3.tres +++ b/addons/block_code/blocks/variables/vector3.tres @@ -1,9 +1,9 @@ -[gd_resource type="Resource" load_steps=2 format=3 uid="uid://ddj24k1fp0s82"] +[gd_resource type="Resource" load_steps=2 format=3 uid="uid://ydahicas0yma"] -[ext_resource type="Script" path="res://addons/block_code/code_generation/block_definition.gd" id="1_ilw3v"] +[ext_resource type="Script" uid="uid://bau6qtv87fcdo" path="res://addons/block_code/code_generation/block_definition.gd" id="1_62jin"] [resource] -script = ExtResource("1_ilw3v") +script = ExtResource("1_62jin") name = &"vector3" target_node_class = "" description = "" @@ -18,4 +18,4 @@ defaults = { "z": 0.0 } signal_name = "" -scope = "" +is_advanced = false diff --git a/addons/block_code/code_generation/ast_list.gd.uid b/addons/block_code/code_generation/ast_list.gd.uid new file mode 100644 index 00000000..cda02b1d --- /dev/null +++ b/addons/block_code/code_generation/ast_list.gd.uid @@ -0,0 +1 @@ +uid://b052nx55audtf diff --git a/addons/block_code/code_generation/block_ast.gd.uid b/addons/block_code/code_generation/block_ast.gd.uid new file mode 100644 index 00000000..776c8b97 --- /dev/null +++ b/addons/block_code/code_generation/block_ast.gd.uid @@ -0,0 +1 @@ +uid://ds7sl2qhnam75 diff --git a/addons/block_code/code_generation/block_definition.gd b/addons/block_code/code_generation/block_definition.gd index a4447044..6ee55468 100644 --- a/addons/block_code/code_generation/block_definition.gd +++ b/addons/block_code/code_generation/block_definition.gd @@ -2,8 +2,17 @@ extends Resource const Types = preload("res://addons/block_code/types/types.gd") +const VariableDefinition = preload("res://addons/block_code/code_generation/variable_definition.gd") const FORMAT_STRING_PATTERN = "\\[(?[^\\]]+)\\]|\\{const (?[^}]+)\\}|\\{(?!const )(?[^}]+)\\}|(?