mirror of
https://github.com/osukey/osukey.git
synced 2025-05-24 15:07:20 +09:00
rename back to UserDimContainer
This commit is contained in:
parent
f1b2073bf6
commit
27a92e017c
@ -43,7 +43,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
typeof(ScreenWithBeatmapBackground),
|
typeof(ScreenWithBeatmapBackground),
|
||||||
typeof(PlayerLoader),
|
typeof(PlayerLoader),
|
||||||
typeof(Player),
|
typeof(Player),
|
||||||
typeof(VisualSettingsContainer),
|
typeof(UserDimContainer),
|
||||||
typeof(OsuScreen)
|
typeof(OsuScreen)
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -165,7 +165,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Check if the <see cref="VisualSettingsContainer"/> is properly accepting user-defined visual changes at all.
|
/// Check if the <see cref="UserDimContainer"/> is properly accepting user-defined visual changes at all.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Test]
|
[Test]
|
||||||
public void DisableUserDimTest()
|
public void DisableUserDimTest()
|
||||||
@ -327,9 +327,9 @@ namespace osu.Game.Tests.Visual
|
|||||||
{
|
{
|
||||||
protected override BackgroundScreen CreateBackground() => new FadeAccessibleBackground(Beatmap.Value);
|
protected override BackgroundScreen CreateBackground() => new FadeAccessibleBackground(Beatmap.Value);
|
||||||
|
|
||||||
protected override VisualSettingsContainer CreateStoryboardContainer()
|
protected override UserDimContainer CreateStoryboardContainer()
|
||||||
{
|
{
|
||||||
return new TestVisualSettingsContainer(true)
|
return new TestUserDimContainer(true)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Alpha = 1,
|
Alpha = 1,
|
||||||
@ -339,7 +339,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
|
|
||||||
public PausableGameplayContainer CurrentPausableGameplayContainer => PausableGameplayContainer;
|
public PausableGameplayContainer CurrentPausableGameplayContainer => PausableGameplayContainer;
|
||||||
|
|
||||||
public VisualSettingsContainer CurrentStoryboardContainer => StoryboardContainer;
|
public UserDimContainer CurrentStoryboardContainer => StoryboardContainer;
|
||||||
|
|
||||||
// Whether or not the player should be allowed to load.
|
// Whether or not the player should be allowed to load.
|
||||||
public bool Ready;
|
public bool Ready;
|
||||||
@ -348,9 +348,9 @@ namespace osu.Game.Tests.Visual
|
|||||||
public readonly Bindable<bool> ReplacesBackground = new Bindable<bool>();
|
public readonly Bindable<bool> ReplacesBackground = new Bindable<bool>();
|
||||||
public readonly Bindable<bool> IsPaused = new Bindable<bool>();
|
public readonly Bindable<bool> IsPaused = new Bindable<bool>();
|
||||||
|
|
||||||
public bool IsStoryboardVisible() => ((TestVisualSettingsContainer)CurrentStoryboardContainer).CurrentAlpha == 1;
|
public bool IsStoryboardVisible() => ((TestUserDimContainer)CurrentStoryboardContainer).CurrentAlpha == 1;
|
||||||
|
|
||||||
public bool IsStoryboardInvisible() => ((TestVisualSettingsContainer)CurrentStoryboardContainer).CurrentAlpha <= 1;
|
public bool IsStoryboardInvisible() => ((TestUserDimContainer)CurrentStoryboardContainer).CurrentAlpha <= 1;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuConfigManager config)
|
private void load(OsuConfigManager config)
|
||||||
@ -396,7 +396,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
|
|
||||||
private class FadeAccessibleBackground : BackgroundScreenBeatmap
|
private class FadeAccessibleBackground : BackgroundScreenBeatmap
|
||||||
{
|
{
|
||||||
protected override VisualSettingsContainer CreateFadeContainer() => fadeContainer = new TestVisualSettingsContainer { RelativeSizeAxes = Axes.Both };
|
protected override UserDimContainer CreateFadeContainer() => fadeContainer = new TestUserDimContainer { RelativeSizeAxes = Axes.Both };
|
||||||
|
|
||||||
public Color4 CurrentColour => fadeContainer.CurrentColour;
|
public Color4 CurrentColour => fadeContainer.CurrentColour;
|
||||||
|
|
||||||
@ -404,7 +404,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
|
|
||||||
public Vector2 CurrentBlur => Background.BlurSigma;
|
public Vector2 CurrentBlur => Background.BlurSigma;
|
||||||
|
|
||||||
private TestVisualSettingsContainer fadeContainer;
|
private TestUserDimContainer fadeContainer;
|
||||||
|
|
||||||
public FadeAccessibleBackground(WorkingBeatmap beatmap)
|
public FadeAccessibleBackground(WorkingBeatmap beatmap)
|
||||||
: base(beatmap)
|
: base(beatmap)
|
||||||
@ -412,12 +412,12 @@ namespace osu.Game.Tests.Visual
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class TestVisualSettingsContainer : VisualSettingsContainer
|
private class TestUserDimContainer : UserDimContainer
|
||||||
{
|
{
|
||||||
public Color4 CurrentColour => LocalContainer.Colour;
|
public Color4 CurrentColour => DimContainer.Colour;
|
||||||
public float CurrentAlpha => LocalContainer.Alpha;
|
public float CurrentAlpha => DimContainer.Alpha;
|
||||||
|
|
||||||
public TestVisualSettingsContainer(bool isStoryboard = false)
|
public TestUserDimContainer(bool isStoryboard = false)
|
||||||
: base(isStoryboard)
|
: base(isStoryboard)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ namespace osu.Game.Graphics.Containers
|
|||||||
/// A container that applies user-configured visual settings to its contents.
|
/// A container that applies user-configured visual settings to its contents.
|
||||||
/// This container specifies behavior that applies to both Storyboards and Backgrounds.
|
/// This container specifies behavior that applies to both Storyboards and Backgrounds.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class VisualSettingsContainer : Container
|
public class UserDimContainer : Container
|
||||||
{
|
{
|
||||||
private const float background_fade_duration = 800;
|
private const float background_fade_duration = 800;
|
||||||
|
|
||||||
@ -36,9 +36,9 @@ namespace osu.Game.Graphics.Containers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly Bindable<bool> StoryboardReplacesBackground = new Bindable<bool>();
|
public readonly Bindable<bool> StoryboardReplacesBackground = new Bindable<bool>();
|
||||||
|
|
||||||
protected Container LocalContainer { get; }
|
protected Container DimContainer { get; }
|
||||||
|
|
||||||
protected override Container<Drawable> Content => LocalContainer;
|
protected override Container<Drawable> Content => DimContainer;
|
||||||
|
|
||||||
private readonly bool isStoryboard;
|
private readonly bool isStoryboard;
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ namespace osu.Game.Graphics.Containers
|
|||||||
: new Vector2(AddedBlur.Value);
|
: new Vector2(AddedBlur.Value);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a new <see cref="VisualSettingsContainer"/>.
|
/// Creates a new <see cref="UserDimContainer"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="isStoryboard"> Whether or not this instance contains a storyboard.
|
/// <param name="isStoryboard"> Whether or not this instance contains a storyboard.
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
@ -57,10 +57,10 @@ namespace osu.Game.Graphics.Containers
|
|||||||
/// and can cause backgrounds to become hidden via <see cref="StoryboardReplacesBackground"/>. Storyboards are also currently unable to be blurred.
|
/// and can cause backgrounds to become hidden via <see cref="StoryboardReplacesBackground"/>. Storyboards are also currently unable to be blurred.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </param>
|
/// </param>
|
||||||
public VisualSettingsContainer(bool isStoryboard = false)
|
public UserDimContainer(bool isStoryboard = false)
|
||||||
{
|
{
|
||||||
this.isStoryboard = isStoryboard;
|
this.isStoryboard = isStoryboard;
|
||||||
AddInternal(LocalContainer = new Container { RelativeSizeAxes = Axes.Both });
|
AddInternal(DimContainer = new Container { RelativeSizeAxes = Axes.Both });
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
@ -87,14 +87,14 @@ namespace osu.Game.Graphics.Containers
|
|||||||
{
|
{
|
||||||
if (isStoryboard)
|
if (isStoryboard)
|
||||||
{
|
{
|
||||||
LocalContainer.FadeTo(!showStoryboard.Value || dimLevel.Value == 1 ? 0 : 1, background_fade_duration, Easing.OutQuint);
|
DimContainer.FadeTo(!showStoryboard.Value || dimLevel.Value == 1 ? 0 : 1, background_fade_duration, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// The background needs to be hidden in the case of it being replaced by the storyboard
|
// The background needs to be hidden in the case of it being replaced by the storyboard
|
||||||
LocalContainer.FadeTo(showStoryboard.Value && StoryboardReplacesBackground.Value ? 0 : 1, background_fade_duration, Easing.OutQuint);
|
DimContainer.FadeTo(showStoryboard.Value && StoryboardReplacesBackground.Value ? 0 : 1, background_fade_duration, Easing.OutQuint);
|
||||||
|
|
||||||
foreach (Drawable c in LocalContainer)
|
foreach (Drawable c in DimContainer)
|
||||||
{
|
{
|
||||||
// Only blur if this container contains a background
|
// Only blur if this container contains a background
|
||||||
// We can't blur the container like we did with the dim because buffered containers add considerable draw overhead.
|
// We can't blur the container like we did with the dim because buffered containers add considerable draw overhead.
|
||||||
@ -103,7 +103,7 @@ namespace osu.Game.Graphics.Containers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LocalContainer.FadeColour(EnableVisualSettings.Value ? OsuColour.Gray(1 - (float)dimLevel.Value) : Color4.White, background_fade_duration, Easing.OutQuint);
|
DimContainer.FadeColour(EnableVisualSettings.Value ? OsuColour.Gray(1 - (float)dimLevel.Value) : Color4.White, background_fade_duration, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -24,9 +24,9 @@ namespace osu.Game.Screens.Backgrounds
|
|||||||
|
|
||||||
public readonly Bindable<float> AddedBlur = new Bindable<float>();
|
public readonly Bindable<float> AddedBlur = new Bindable<float>();
|
||||||
|
|
||||||
private readonly VisualSettingsContainer fadeContainer;
|
private readonly UserDimContainer fadeContainer;
|
||||||
|
|
||||||
protected virtual VisualSettingsContainer CreateFadeContainer() => new VisualSettingsContainer { RelativeSizeAxes = Axes.Both };
|
protected virtual UserDimContainer CreateFadeContainer() => new UserDimContainer { RelativeSizeAxes = Axes.Both };
|
||||||
|
|
||||||
public virtual WorkingBeatmap Beatmap
|
public virtual WorkingBeatmap Beatmap
|
||||||
{
|
{
|
||||||
|
@ -71,9 +71,9 @@ namespace osu.Game.Screens.Play
|
|||||||
private FailOverlay failOverlay;
|
private FailOverlay failOverlay;
|
||||||
|
|
||||||
private DrawableStoryboard storyboard;
|
private DrawableStoryboard storyboard;
|
||||||
protected VisualSettingsContainer StoryboardContainer { get; private set; }
|
protected UserDimContainer StoryboardContainer { get; private set; }
|
||||||
|
|
||||||
protected virtual VisualSettingsContainer CreateStoryboardContainer() => new VisualSettingsContainer(true)
|
protected virtual UserDimContainer CreateStoryboardContainer() => new UserDimContainer(true)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Alpha = 1,
|
Alpha = 1,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user