Skip to content

Change preview methods to take Callable #108162

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KoBeWi
Copy link
Member

@KoBeWi KoBeWi commented Jul 1, 2025

In Godot 4 most methods moved from "object, method, userdata" combo to just use a single Callable. The only remaining one (I think) are preview methods: queue_resource_preview and queue_edited_resource_preview.

For now the new methods are unexposed, and only used internally.

@KoBeWi KoBeWi added this to the 4.x milestone Jul 1, 2025
@KoBeWi KoBeWi requested review from a team as code owners July 1, 2025 11:49
@Mickeon
Copy link
Member

Mickeon commented Jul 1, 2025

Could we change the implementation internally but still keep the original method exposed as is?
The current state of things is obviously an oversight, but the current name feels so right that any newly exposed method would be unusable just by its confusable nature. When it's gonna be time to clean the slate and remove all deprecated methods, the newer, yet "badly" named methods may slip through the cracks.

At the end of the day, fortunately, it's pretty easy to mitigate this issue by fetching a Callable's object and method name individually.

@KoBeWi
Copy link
Member Author

KoBeWi commented Jul 1, 2025

You mean like, not exposing the new methods? Yeah, they don't need to be exposed. I mostly noticed it when doing #108147

@Mickeon
Copy link
Member

Mickeon commented Jul 1, 2025

Indeed, maybe slapping a huge "TODO" to have those methods use Callable as soon as it's reasonable to do so.

@KoBeWi KoBeWi force-pushed the preview_simplication branch from 5202eb4 to 48f3c11 Compare July 1, 2025 16:51
@Mickeon Mickeon removed the request for review from a team July 1, 2025 16:57
Copy link
Member

@Mickeon Mickeon left a comment

Choose a reason for hiding this comment

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

Now that the change is internal this is more reasonable.

That aside, the PR is a pretty sweet clean-up of a very shoddy, likely legacy, part of the editor.
It may speed up things a little too, but that was not the goal. Seeing Variant being passed around for no reason was already painful enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants