mirror of
https://github.com/osukey/osukey.git
synced 2025-08-06 16:13:57 +09:00
Don't unbind when not necessary
This commit is contained in:
@ -311,10 +311,9 @@ namespace osu.Game.Screens.Play
|
|||||||
if (!loadedSuccessfully)
|
if (!loadedSuccessfully)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
dimLevel.ValueChanged += backgroundLevel_ValueChanged;
|
dimLevel.ValueChanged += value => updateBackgroundElements();
|
||||||
blurLevel.ValueChanged += backgroundLevel_ValueChanged;
|
blurLevel.ValueChanged += value => updateBackgroundElements();
|
||||||
|
showStoryboard.ValueChanged += value => updateBackgroundElements();
|
||||||
showStoryboard.ValueChanged += showStoryboard_ValueChanged;
|
|
||||||
updateBackgroundElements();
|
updateBackgroundElements();
|
||||||
|
|
||||||
Content.Alpha = 0;
|
Content.Alpha = 0;
|
||||||
@ -370,12 +369,6 @@ namespace osu.Game.Screens.Play
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void backgroundLevel_ValueChanged(double newValue)
|
|
||||||
=> updateBackgroundElements();
|
|
||||||
|
|
||||||
private void showStoryboard_ValueChanged(bool newValue)
|
|
||||||
=> updateBackgroundElements();
|
|
||||||
|
|
||||||
private void updateBackgroundElements()
|
private void updateBackgroundElements()
|
||||||
{
|
{
|
||||||
var opacity = 1 - (float)dimLevel;
|
var opacity = 1 - (float)dimLevel;
|
||||||
@ -396,10 +389,6 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
private void fadeOut()
|
private void fadeOut()
|
||||||
{
|
{
|
||||||
dimLevel.ValueChanged -= backgroundLevel_ValueChanged;
|
|
||||||
blurLevel.ValueChanged -= backgroundLevel_ValueChanged;
|
|
||||||
showStoryboard.ValueChanged -= showStoryboard_ValueChanged;
|
|
||||||
|
|
||||||
const float fade_out_duration = 250;
|
const float fade_out_duration = 250;
|
||||||
|
|
||||||
RulesetContainer?.FadeOut(fade_out_duration);
|
RulesetContainer?.FadeOut(fade_out_duration);
|
||||||
|
Reference in New Issue
Block a user