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

Editor: Dim UI when a WindowDialog is shown. #7970

Merged
merged 1 commit into from
Mar 13, 2017

Conversation

27thLiz
Copy link
Contributor

@27thLiz 27thLiz commented Mar 6, 2017

Darkens the editor on WindowDialog popups.

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 (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

darken2

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
@27thLiz 27thLiz added this to the 3.0 milestone Mar 6, 2017
@bojidar-bg
Copy link
Contributor

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);
Copy link
Contributor

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?

Copy link
Contributor Author

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 ^^

Copy link
Contributor

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.

@RebelliousX
Copy link
Contributor

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?

@akien-mga akien-mga merged commit c46004c into godotengine:master Mar 13, 2017
27thLiz added a commit to 27thLiz/godot that referenced this pull request Mar 13, 2017
groscalin pushed a commit to groscalin/godot that referenced this pull request Jul 15, 2017
@rraallvv
Copy link
Contributor

rraallvv commented Mar 11, 2018

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!

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