Skip to content

T35591 Read block definition from resource files #192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Aug 14, 2024

Conversation

manuq
Copy link
Contributor

@manuq manuq commented Aug 12, 2024

Taking as reference commits from #147

Notable changes:

  • The loading occurs in the new block catalog, not in the UI.
  • Changed the file matching to use case-insensitive "globbing".
  • Sync'ing things like tooltips (description field) that have been updated in main.

https://phabricator.endlessm.com/T35591

@manuq
Copy link
Contributor Author

manuq commented Aug 12, 2024

There are more blocks that can be ported. I'm finding missing ones like "Await scene ready". I'm making sure we don't miss anything in the port. The if/else can't be ported as-is unless we split them into 2 blocks.

@@ -5,14 +5,14 @@ extends Resource
const Types = preload("res://addons/block_code/types/types.gd")

@export var name: StringName
@export var description: String
@export_multiline var description: String
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, nice! This was bugging me :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Me too!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A tiny nit: can we sort this commit right before a5c9b4b, or even squash the two? I was left asking "but why?!" and it took a while to find the answer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, otherwise is not understandable why the utility was added.

manuq and others added 7 commits August 14, 2024 07:21
This way the editor shows a text box for editing these fields allowing
multiple lines. Previously the newlines appeared encoded as `\\n`.
So they can be instantiated for now from block definitions. Note that
this won't work for control blocks with multiple bodies like if/else.
Given a directory path, the function will return all files whose file
name matches the given pattern.

Co-authored-by: Will Baumgartner <wnb@endlessos.org>
To the current ones. Done using the editor Inspector dock.
And remove the 2 definitions from code.

Please note the name of the On Ready block has changed. This will be
addressed in the next commit.
This is how it's now named in the resource files.
To the new block definitions. Update the resource files to match the
current values when needed.
@manuq manuq force-pushed the T35591-read-blocks-from-files branch from d4e69f2 to 3971f47 Compare August 14, 2024 10:23
@manuq manuq merged commit 78fb1c7 into main Aug 14, 2024
2 checks passed
@manuq manuq deleted the T35591-read-blocks-from-files branch August 14, 2024 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants