mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 20:22:55 +08:00
Merge pull request #10941 from LumpBloom7/improve-MenuVisualizer
Improve LogoVisualisation looks when MenuGlow colors are used
This commit is contained in:
commit
5e014fc4fe
@ -113,8 +113,7 @@ namespace osu.Game.Screens.Menu
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Alpha = 0.5f,
|
||||
AccentColour = Color4.DarkBlue,
|
||||
Colour = Color4.DarkBlue,
|
||||
Size = new Vector2(0.96f)
|
||||
},
|
||||
new Circle
|
||||
|
@ -11,7 +11,6 @@ using osu.Framework.Graphics.Primitives;
|
||||
using osu.Framework.Graphics.Shaders;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using JetBrains.Annotations;
|
||||
@ -20,13 +19,14 @@ using osu.Framework.Audio;
|
||||
using osu.Framework.Audio.Track;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Utils;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
|
||||
namespace osu.Game.Screens.Menu
|
||||
{
|
||||
/// <summary>
|
||||
/// A visualiser that reacts to music coming from beatmaps.
|
||||
/// </summary>
|
||||
public class LogoVisualisation : Drawable, IHasAccentColour
|
||||
public class LogoVisualisation : Drawable
|
||||
{
|
||||
private readonly IBindable<WorkingBeatmap> beatmap = new Bindable<WorkingBeatmap>();
|
||||
|
||||
@ -67,8 +67,6 @@ namespace osu.Game.Screens.Menu
|
||||
|
||||
private int indexOffset;
|
||||
|
||||
public Color4 AccentColour { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The relative movement of bars based on input amplification. Defaults to 1.
|
||||
/// </summary>
|
||||
@ -176,7 +174,8 @@ namespace osu.Game.Screens.Menu
|
||||
// Assuming the logo is a circle, we don't need a second dimension.
|
||||
private float size;
|
||||
|
||||
private Color4 colour;
|
||||
private static readonly Color4 transparent_white = Color4.White.Opacity(0.2f);
|
||||
|
||||
private float[] audioData;
|
||||
|
||||
private readonly QuadBatch<TexturedVertex2D> vertexBatch = new QuadBatch<TexturedVertex2D>(100, 10);
|
||||
@ -193,7 +192,6 @@ namespace osu.Game.Screens.Menu
|
||||
shader = Source.shader;
|
||||
texture = Source.texture;
|
||||
size = Source.DrawSize.X;
|
||||
colour = Source.AccentColour;
|
||||
audioData = Source.frequencyAmplitudes;
|
||||
}
|
||||
|
||||
@ -206,7 +204,7 @@ namespace osu.Game.Screens.Menu
|
||||
Vector2 inflation = DrawInfo.MatrixInverse.ExtractScale().Xy;
|
||||
|
||||
ColourInfo colourInfo = DrawColourInfo.Colour;
|
||||
colourInfo.ApplyChild(colour);
|
||||
colourInfo.ApplyChild(transparent_white);
|
||||
|
||||
if (audioData != null)
|
||||
{
|
||||
|
@ -7,7 +7,6 @@ using osu.Game.Online.API;
|
||||
using osu.Game.Users;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
|
||||
namespace osu.Game.Screens.Menu
|
||||
{
|
||||
@ -28,12 +27,10 @@ namespace osu.Game.Screens.Menu
|
||||
|
||||
private void updateColour()
|
||||
{
|
||||
Color4 defaultColour = Color4.White.Opacity(0.2f);
|
||||
|
||||
if (user.Value?.IsSupporter ?? false)
|
||||
AccentColour = skin.Value.GetConfig<GlobalSkinColours, Color4>(GlobalSkinColours.MenuGlow)?.Value ?? defaultColour;
|
||||
Colour = skin.Value.GetConfig<GlobalSkinColours, Color4>(GlobalSkinColours.MenuGlow)?.Value ?? Color4.White;
|
||||
else
|
||||
AccentColour = defaultColour;
|
||||
Colour = Color4.White;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -81,6 +81,8 @@ namespace osu.Game.Screens.Menu
|
||||
set => rippleContainer.FadeTo(value ? 1 : 0, transition_length, Easing.OutQuint);
|
||||
}
|
||||
|
||||
private const float visualizer_default_alpha = 0.5f;
|
||||
|
||||
private readonly Box flashLayer;
|
||||
|
||||
private readonly Container impactContainer;
|
||||
@ -144,7 +146,7 @@ namespace osu.Game.Screens.Menu
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Origin = Anchor.Centre,
|
||||
Anchor = Anchor.Centre,
|
||||
Alpha = 0.5f,
|
||||
Alpha = visualizer_default_alpha,
|
||||
Size = new Vector2(0.96f)
|
||||
},
|
||||
new Container
|
||||
@ -282,8 +284,7 @@ namespace osu.Game.Screens.Menu
|
||||
this.Delay(early_activation).Schedule(() => sampleBeat.Play());
|
||||
|
||||
logoBeatContainer
|
||||
.ScaleTo(1 - 0.02f * amplitudeAdjust, early_activation, Easing.Out)
|
||||
.Then()
|
||||
.ScaleTo(1 - 0.02f * amplitudeAdjust, early_activation, Easing.Out).Then()
|
||||
.ScaleTo(1, beatLength * 2, Easing.OutQuint);
|
||||
|
||||
ripple.ClearTransforms();
|
||||
@ -296,15 +297,13 @@ namespace osu.Game.Screens.Menu
|
||||
{
|
||||
flashLayer.ClearTransforms();
|
||||
flashLayer
|
||||
.FadeTo(0.2f * amplitudeAdjust, early_activation, Easing.Out)
|
||||
.Then()
|
||||
.FadeTo(0.2f * amplitudeAdjust, early_activation, Easing.Out).Then()
|
||||
.FadeOut(beatLength);
|
||||
|
||||
visualizer.ClearTransforms();
|
||||
visualizer
|
||||
.FadeTo(0.9f * amplitudeAdjust, early_activation, Easing.Out)
|
||||
.Then()
|
||||
.FadeTo(0.5f, beatLength);
|
||||
.FadeTo(visualizer_default_alpha * 1.8f * amplitudeAdjust, early_activation, Easing.Out).Then()
|
||||
.FadeTo(visualizer_default_alpha, beatLength);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user