-
-
Notifications
You must be signed in to change notification settings - Fork 21.7k
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
Editor: Dim UI when a WindowDialog is shown. #7970
Conversation
Darkens the editor on WindowDialog popup. This adds the following new Editor settings: - interface/dim_editor_on_dialog_popup (true) # Enable/Disable editor dimming - interface/dim_amount (0.6) # Percentage of how much the editor will be darkened (0-1) - interface/dim_transition_time # The duration (in seconds) of the color blending effect (0-1), 0 is instant. Please test this thoroughly, I haven't yet seen a case where it fails to work properly but I'm sure I didn't test all windows of the editor :P
I guess it would be nice if this could be used in games, but well, we can fake it ourselves if needed 😉 |
_dimming = false; | ||
_dim_time = 0.0f; | ||
_dim_timer = memnew(Timer); | ||
_dim_timer->set_wait_time(0.01666f); |
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.
If "interface/dim_transition_time"
is more than 0.1666f
, would this cause a premature stop of the timer?
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.
Well yeah, it stops somewhere between transition_time - 0.0166
and transition_time
. So we a have a margin of error of one frame here.
I think that's fine for this use-case, it won't make any noticeable visual difference imo.
Unless there's an easy way to make this more precise? I'm all ears ^^
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.
Well, I guess you can set the wait time every time before starting the timer, and using the transition time for it.
This is sexy <3 Probably unrelated, but when a WindowDialog or Popup appears, why clicking anywhere outside of it makes it disappear? I thought "dialogs" are inherently modal. Or is it just me? |
Fixes a bug introduced in godotengine#7970
Fixes a bug introduced in godotengine#7970
It's a very nice touch how the editor window is dimmed on the background when a modal view is shown, however I couldn't find a value that would look nice on my screen. If Dim Amount is too high the borders of the dialog widow disappear on the background, and if it is too low the dimming effect is not noticeable. I can only use values in the range 20% above and below 0.5, which makes de dimming effect a bit unpleasant to my taste. It might be a problem with my monitor though, some issue with the contrast or brightness, nevertheless I decided to replace the Dimming Amount by a color in the settings, and use a Control as an overlay to render the dimming effect. Also, the dimming effect when the dialog is closed seemed too distracting to me, so I made the time of the dimming effect for closing the dialog equal to zero. That way, the dimming effect is only visible when the dialog is opening. Here is a screen recording with how it looks. The changes are in this commit, please let me know it you are interested to make a PR. @Hinsbart keep up the good work! |
Darkens the editor on WindowDialog popups.
This adds the following new Editor settings:
interface/dim_editor_on_dialog_popup (true)
# Enable/Disable editor dimminginterface/dim_amount (0.6)
# Percentage of how much the editor will be darkened (0-1)interface/dim_transition_time (0.11)
# The duration (in seconds) of the color blending effect (0-1), 0 is instant.Please test this thoroughly, I haven't yet seen a case where it fails to work properly but I'm sure I didn't test all windows of the editor :P
Closes #7900