X Tutup
Skip to content

Optimize the callback argument of popup_create_dialog()#106071

Merged
Repiteo merged 1 commit intogodotengine:masterfrom
Lazy-Rabbit-2001:pcd_improvement
Nov 14, 2025
Merged

Optimize the callback argument of popup_create_dialog()#106071
Repiteo merged 1 commit intogodotengine:masterfrom
Lazy-Rabbit-2001:pcd_improvement

Conversation

@Lazy-Rabbit-2001
Copy link
Contributor

@Lazy-Rabbit-2001 Lazy-Rabbit-2001 commented May 4, 2025

Improvement of #100135

I noticed that the callback (callable argument in the method) only returns the name of the type. However, when it comes to scripts, you cannot have any idea to instantiate it from the name.
Now the callback will return a string: If the type is script, it will return the path to the script file instead of its name. Native types keep still.

Chat log: https://chat.godotengine.org/channel/editor?msg=EiJdzCYoZaYihNRTR

@Lazy-Rabbit-2001
Copy link
Contributor Author

note that the method is marked as experimental, so even though it's breaking compatibility, I think it's still ok to do so

@KoBeWi
Copy link
Member

KoBeWi commented Jun 22, 2025

Wouldn't it be enough to return a String? Class name if it's native class and script path if it's custom type. You can get class name from a script path if someone needs it.

@Lazy-Rabbit-2001
Copy link
Contributor Author

Lazy-Rabbit-2001 commented Jun 22, 2025

Wouldn't it be enough to return a String? Class name if it's native class and script path if it's custom type. You can get class name from a script path if someone needs it.

Forgot to add the code you mentioned because I've already done it but idk why it didn't get uploaded...

Edit: Resolved

@Lazy-Rabbit-2001 Lazy-Rabbit-2001 requested review from a team as code owners July 30, 2025 15:08
@Repiteo Repiteo modified the milestones: 4.x, 4.6 Nov 14, 2025
@Repiteo Repiteo merged commit 22fcb57 into godotengine:master Nov 14, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Nov 14, 2025

Thanks!

@Lazy-Rabbit-2001 Lazy-Rabbit-2001 deleted the pcd_improvement branch November 15, 2025 03:00
@akien-mga akien-mga changed the title Optimize the callback argument of popup_create_dialog() Optimize the callback argument of popup_create_dialog() (reverted) Dec 3, 2025
@akien-mga akien-mga changed the title Optimize the callback argument of popup_create_dialog() (reverted) Optimize the callback argument of popup_create_dialog() Dec 3, 2025
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.

4 participants

X Tutup