Skip to content

Fix create dialog recents#115314

Merged
Repiteo merged 1 commit into
godotengine:masterfrom
Saulo-de-Souza:fix-create-dialog-recents
Jan 29, 2026
Merged

Fix create dialog recents#115314
Repiteo merged 1 commit into
godotengine:masterfrom
Saulo-de-Souza:fix-create-dialog-recents

Conversation

@Saulo-de-Souza
Copy link
Copy Markdown
Contributor

The CreateDialog::get_selected_type() method can return an empty string for custom types.

When EditorNode::get_editor_data().get_custom_type_by_name() returns nullptr, it relies on _script_path, which is only defined for global script classes. As a result, _confirmed() terminates prematurely (selected_item.is_empty()), therefore the recent history is never shown for custom types.

Returning the visible name of the selected item (selected->get_text(0)) corrects the problem and matches how Recent/Favorite items are already handled (based on name, not path).

See the before and after photos below:


1

2


@Saulo-de-Souza Saulo-de-Souza requested review from a team as code owners January 23, 2026 21:29
@Chaosus Chaosus added this to the 4.x milestone Jan 24, 2026
@KoBeWi
Copy link
Copy Markdown
Member

KoBeWi commented Jan 24, 2026

Returning script path is deliberate. It's needed for popup_create_dialog() method. In scripting, it's not possible to instantiate a script having only its class name string. See #106071

If it's a problem for history, add a new method that returns the actual type name.

@Saulo-de-Souza Saulo-de-Souza force-pushed the fix-create-dialog-recents branch from 8658aae to 36adac7 Compare January 24, 2026 18:03
@Saulo-de-Souza
Copy link
Copy Markdown
Contributor Author

Returning script path is deliberate. It's needed for popup_create_dialog() method. In scripting, it's not possible to instantiate a script having only its class name string. See #106071

If it's a problem for history, add a new method that returns the actual type name.

That's correct. I made a change. Could you please verify if it's correct now? Thank you for your attention!

Comment thread editor/gui/create_dialog.cpp Outdated
@Saulo-de-Souza Saulo-de-Souza force-pushed the fix-create-dialog-recents branch from 36adac7 to e8cad1c Compare January 24, 2026 19:04
@Repiteo
Copy link
Copy Markdown
Contributor

Repiteo commented Jan 27, 2026

Could you squash your commits? See our pull request guidelines for more information

@Saulo-de-Souza Saulo-de-Souza force-pushed the fix-create-dialog-recents branch from e8cad1c to 4a2d146 Compare January 28, 2026 12:45
@Saulo-de-Souza
Copy link
Copy Markdown
Contributor Author

Could you squash your commits? See our pull request guidelines for more information

This branch contains a single commit on top of master. The PR can be squashed on merge.

@akien-mga
Copy link
Copy Markdown
Member

No your branch actually contains 3 commits:
image

You should do an interactive rebase to drop the first 2 I assume.

@Saulo-de-Souza Saulo-de-Souza force-pushed the fix-create-dialog-recents branch from 4a2d146 to eb43b38 Compare January 28, 2026 13:07
@Saulo-de-Souza
Copy link
Copy Markdown
Contributor Author

No your branch actually contains 3 commits: image

You should do an interactive rebase to drop the first 2 I assume.

Done!

@Repiteo
Copy link
Copy Markdown
Contributor

Repiteo commented Jan 28, 2026

Your commit seems to not be linked to your GitHub account. See this article for more information

@Saulo-de-Souza Saulo-de-Souza force-pushed the fix-create-dialog-recents branch from eb43b38 to 35a9ec1 Compare January 28, 2026 19:06
@Saulo-de-Souza
Copy link
Copy Markdown
Contributor Author

Your commit seems to not be linked to your GitHub account. See this article for more information

Thanks for the heads up! I’ve rewritten the commits so they’re now authored with the same GitHub account that opened the PR.

@Repiteo Repiteo modified the milestones: 4.x, 4.7 Jan 28, 2026
@Repiteo Repiteo merged commit 8fd7c1e into godotengine:master Jan 29, 2026
20 checks passed
@Repiteo
Copy link
Copy Markdown
Contributor

Repiteo commented Jan 29, 2026

Thanks! Congratulations on your first merged contribution! 🎉

@Repiteo
Copy link
Copy Markdown
Contributor

Repiteo commented Feb 5, 2026

Cherry-picked for 4.6.1.

rivie13 pushed a commit to rivie13/Phoenix-Agentic-Engine that referenced this pull request Feb 16, 2026
…dialog-recents

Fix create dialog recents
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.

5 participants