-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Rework the Configuration Warning system #90049
base: master
Are you sure you want to change the base?
Conversation
647a9ad
to
db114a6
Compare
51e5529
to
7ce5676
Compare
Note that there was some discussion about whether node configuration warnings should be able to show when running a project in an editor build, but outside the editor (i.e. with a print in the Output panel). I can't find the proposal in question, but I remember discussing it myself. Edit: This was probably in godotengine/godot-proposals#3004 (comment). It also makes me wonder whether all |
cbe1b97
to
0ad0b93
Compare
I tried this change (ifdef the entirety of |
02ba880
to
d803fa9
Compare
edc370f
to
cf0688b
Compare
This PR should be ready now. I've rewritten the description, to remove finished TODOs and clarify what this PR exactly does. A larger UI change has been made by introducing a configuration info summary in the inspector (see screenshots in PR description). I'd like feedback whether this list should show for |
Quoting my own comment on the matter last time just for the sake for others to remember it, haven't looked at the implementation yet. |
719044b
to
84c62af
Compare
Thanks for the multiple reviews! I applied the latest changes and squashed everything into two commits. My recompile locally was instant, so my rebase maneuver did not accidentally swallow any changes either ^^ |
84c62af
to
ac5f1b2
Compare
ac5f1b2
to
31acd7a
Compare
@RedMser Could you look into rebasing this PR so I can review it? |
31acd7a
to
3471800
Compare
@Calinou Updated to latest master! ^^ |
I get a build failure here after rebasing on top of
|
3471800
to
c09d80e
Compare
Seems like this got added a few hours after my rebase, haha. Did another, should work now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally (rebased on top of master
c6c464c), it works as expected. This is a great start 🙂
The API that's exposed seems good to me. Some feedback regarding the UI:
- The "N Configuration Infos" text should be changed to mention the type of messages it contains, so you can get better information without needing to expand it. For example:
❌ 1 configuration error, 1 warning
⚠️ 2 configuration warnings, 1 info
❌ 3 configuration errors, 1 warning, 2 infos
ℹ️ 2 configuration infos
- There should be visual feedback when hovering the dropdown that can be expanded (the "1 Configuration Info" part):
- On the above dropdown, the folding arrow should be moved to the left of the text (and it should point to the right when folded) to match usual Tree behavior. Here's a mockup:
- Line spacing should be increased within the expanded dropdown, as it's quite low currently (compared to the rest of the editor):
-
The property name written in brackets should be capitalized using
EditorPropertyNameProcessor::get_singleton()->process_name()
(so that it follows editor settings). Right now, it always displays the original property name which is typically in snake_case, regardless of editor settings. -
The warning icon next to a property should be moved to the left slightly, so that it's centered:
Here's a mockup of how it should look like:
- When hovering the warning icon, a tooltip with the warning description should appear, like when you hover it in the Scene tree dock. Right now, it shows the property's documentation instead.
c09d80e
to
d35cb3e
Compare
Thanks for your review and feedback! Screenshot after the suggested changes:
Done, see Your mockup included emojis for the icons, but I decided not to add an icon for the dropdown title text. The list below already has many icons, so by not having an icon on the title, it gives it a bit of hierarchy. Let me know if you have a strong opinion on changing it.
Done. I've copied the UI from the "control positioning warning" inspector plugin, so it would make sense to update that one in a new PR as well.
Done.
Done, although it will probably fail for "localized" property style, since there's a lot of additional logic in the inspector which would need to be pulled out (see code snippet). We would also need to update the struct to include class name. godot/editor/editor_inspector.cpp Lines 3177 to 3193 in 78aaa55
I'd consider this a known issue for now which can be optimized later.
Done by adding 50% extra width. I also noticed that I forgot to update the minimum size, so I added that and refactored duplicate code into helper methods.
It is a known limitation of this PR, since none of the icon buttons in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The UI looks great now!
I would keep I would make it so that if configuration info is given, then it takes priority on any configuration warning given. |
d35cb3e
to
1ebc7d3
Compare
@adamscott Current behavior is that both methods exist side-by-side and work, with I have not explicitly tested backwards compatibility for GDExtension or modules, but I would hope it works as intended when not compiling with |
1ebc7d3
to
c1df3be
Compare
- Introduces the new configuration info system. - Supported on Node and Resource. - Different severity levels, can be on properties. - Show summary of config info at the top of the inspector. - Backwards compatible API (configuration warnings API still works, although it is marked as deprecated).
c1df3be
to
0128098
Compare
Uses the CONFIG_ macros and specifies the property where appropriate.
0128098
to
34b0fc7
Compare
Closes godotengine/godot-proposals#9416
Closes godotengine/godot-proposals#550 again
Closes godotengine/godot-proposals#9098
For my first attempt at implementing this (which has since been reverted), see #68420 and #88182
What this PR does
_get_configuration_info
is available which accepts a mixed Array of Dictionaries and Strings ("my warning"
is equivalent to{ "message": "my warning" }
).warnings.push_back(RTR("..."))
will now instead useCONFIG_WARNING(RTR("..."))
macro (can be suffixed with_P
to refer to a specific property)._get_configuration_warnings
will behave the same as before.EditorConfigurationInfo
class, so logic can be shared with Resources, and between different Editor UIs. Without tools enabled,get_configuration_info
is not available, reducing build size by around 100KB.Screenshots
For reviewers
First commit modifies the core and editor only, while the second commit adjusts all Nodes to use the new API.
Notes and Known Issues
These do not have to be resolved to merge this PR, unless deemed necessary by reviewers.