Skip to content

Disable the "Edit"/"Clear"/"Save" menu item when the EditorResourcePicker is force_allow_unique#117659

Merged
akien-mga merged 1 commit into
godotengine:masterfrom
Rindbee:fix-edit-menu-item
Mar 23, 2026
Merged

Disable the "Edit"/"Clear"/"Save" menu item when the EditorResourcePicker is force_allow_unique#117659
akien-mga merged 1 commit into
godotengine:masterfrom
Rindbee:fix-edit-menu-item

Conversation

@Rindbee
Copy link
Copy Markdown
Contributor

@Rindbee Rindbee commented Mar 20, 2026

Since force_allow_unique is enabled when the corresponding property does not exist, the displayed value is "inherited". Therefore, the value should not be edited/cleared/saved at this time. See also #117659 (comment).

Peek.2026-03-20.16-09.mp4

@Rindbee Rindbee requested a review from a team as a code owner March 20, 2026 02:49
@YeldhamDev YeldhamDev added this to the 4.x milestone Mar 20, 2026
@Rindbee Rindbee force-pushed the fix-edit-menu-item branch from 4446bd5 to d6f0ace Compare March 20, 2026 03:34
@Rindbee Rindbee changed the title Enable the "Edit" menu item only if the EditorResourcePicker is force_allow_unique Disable the "Edit" menu item when the EditorResourcePicker is force_allow_unique Mar 20, 2026
Copy link
Copy Markdown
Member

@YeldhamDev YeldhamDev left a comment

Choose a reason for hiding this comment

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

Works, but now it makes me realize that "Clear" also doesn't do anything in that state as well. :P

@Rindbee Rindbee force-pushed the fix-edit-menu-item branch from d6f0ace to e5bddc8 Compare March 20, 2026 03:42
@Rindbee Rindbee changed the title Disable the "Edit" menu item when the EditorResourcePicker is force_allow_unique Disable the "Edit"/"Clear" menu item when the EditorResourcePicker is force_allow_unique Mar 20, 2026
@Rindbee
Copy link
Copy Markdown
Contributor Author

Rindbee commented Mar 20, 2026

Works, but now it makes me realize that "Clear" also doesn't do anything in that state as well. :P

It's now disabled.

…is `force_allow_unique`

Since `force_allow_unique` is enabled when the corresponding property
does not exist, the displayed value is "inherited". Therefore, it
should not be edited/cleared at this time.
@Rindbee Rindbee force-pushed the fix-edit-menu-item branch from e5bddc8 to 7a1f759 Compare March 20, 2026 08:06
@Rindbee
Copy link
Copy Markdown
Contributor Author

Rindbee commented Mar 20, 2026

Since save/save as replaces the path of the saved instance with the new path, "save"/"save as" is also disabled according to the same logic.

3.mp4

In other words, a copy (new instance) must be created first before the disabled operations can be performed.

@Rindbee Rindbee changed the title Disable the "Edit"/"Clear" menu item when the EditorResourcePicker is force_allow_unique Disable the "Edit"/"Clear"/"Save" menu item when the EditorResourcePicker is force_allow_unique Mar 20, 2026
@akien-mga akien-mga modified the milestones: 4.x, 4.7 Mar 23, 2026
@akien-mga akien-mga merged commit a1c0ffa into godotengine:master Mar 23, 2026
20 checks passed
@akien-mga
Copy link
Copy Markdown
Member

Thanks!

@Rindbee Rindbee deleted the fix-edit-menu-item branch March 24, 2026 00:06
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.

3 participants