1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 04:07:25 +08:00

Use conditional operator isntead of if

This commit is contained in:
David Zhao 2019-02-18 15:23:03 +09:00
parent df148f8787
commit f241d67e5f
3 changed files with 2 additions and 6 deletions

View File

@ -81,10 +81,7 @@ namespace osu.Game.Screens.Backgrounds
private void updateBackgroundDim()
{
if (UpdateDim)
FadeContainer?.FadeColour(OsuColour.Gray(1 - (float)DimLevel), 800, Easing.OutQuint);
else
FadeContainer?.FadeColour(Color4.White, 800, Easing.OutQuint);
FadeContainer?.FadeColour(UpdateDim ? OsuColour.Gray(1 - (float)DimLevel) : Color4.White, 800, Easing.OutQuint);
}
public BackgroundScreenBeatmap(WorkingBeatmap beatmap = null)

View File

@ -61,6 +61,7 @@ namespace osu.Game.Screens.Play
public CursorContainer Cursor => RulesetContainer.Cursor;
public bool ProvidingUserCursor => RulesetContainer?.Cursor != null && !RulesetContainer.HasReplayLoaded.Value;
protected float BackgroundOpacity => 1 - (float)DimLevel;
private IAdjustableClock sourceClock;

View File

@ -19,8 +19,6 @@ namespace osu.Game.Screens.Play
protected const float BACKGROUND_FADE_DURATION = 800;
protected float BackgroundOpacity => 1 - (float)DimLevel;
#region User Settings
protected Bindable<double> DimLevel;