Skip to content
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

Fix paste value not updated in dictionaries/arrays (reverted) #76711

Conversation

ajreckof
Copy link
Member

@ajreckof ajreckof commented May 3, 2023

Fixes #75124

when a value of a Dictionarry/array was modified it would never call update_property as emit_changed was called with p_changing == true whatever the case.

Edit : forced the call directly to update_property when p_changing == false. This will update less and will make it work for new_item key and value which I didn't think of previously.
With this new approach #76795 is not fixed anymore

@Calinou Calinou added this to the 4.1 milestone May 3, 2023
@fire fire changed the title fix paste value not updated in dictionaries/arrays Fix paste value not updated in dictionaries/arrays May 4, 2023
@akien-mga
Copy link
Member

Does this risk causing too frequent updates when editing arrays and dictionaries?

@ajreckof
Copy link
Member Author

ajreckof commented May 12, 2023

I don't think it will cause too frequent updates but it will effectively call more updates then needed as it will call a full inspector rebuild of the edited property. What I mean is that instead of updating only the dictionnary/array editor it will update the full property of the edited object while the dictionary might only be a small part of it. I'll make an update so that it only calls update_property.

Edit : Re-checked and effectively it would have called way more frequent updates because most EditorProperty handles internally the update but than still calls emit_changed with false which triggers a second update.

@ajreckof ajreckof force-pushed the fix-paste-value-not-updating-element-in-dictionaries/array branch from 24dab9d to 308f38e Compare May 12, 2023 14:06
@ajreckof ajreckof force-pushed the fix-paste-value-not-updating-element-in-dictionaries/array branch from 308f38e to 6f596ee Compare May 12, 2023 14:13
Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

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

Tested locally (rebased against master a83eb16), it works.

@akien-mga akien-mga merged commit e8e00b9 into godotengine:master Jun 18, 2023
@akien-mga
Copy link
Member

Thanks!

@akien-mga akien-mga changed the title Fix paste value not updated in dictionaries/arrays Fix paste value not updated in dictionaries/arrays (reverted) Jun 23, 2023
@akien-mga akien-mga changed the title Fix paste value not updated in dictionaries/arrays (reverted) Fix paste value not updated in dictionaries/arrays Jun 23, 2023
@Sauermann
Copy link
Contributor

Sauermann commented Jun 23, 2023

This PR introduced the issue, that it is no longer possible to select a different entry-field by mouse-click after editing.
This behavior becomes visible, after #78578 gets fixed by #78591.
I would expect, that the second mouse-click in the video sets the focus to the y-entry-field.

BugClickNoFocus.mp4

@akien-mga akien-mga changed the title Fix paste value not updated in dictionaries/arrays Fix paste value not updated in dictionaries/arrays (reverted) Jun 24, 2023
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.

"Paste Value" does not refresh the displayed values of array/dict elements in inspector
4 participants