Skip to content

Commit

Permalink
Merge pull request #20604 from peppy/mania-argon-second-pass
Browse files Browse the repository at this point in the history
Second pass on osu!mania "argon" visuals
  • Loading branch information
smoogipoo authored Oct 7, 2022
2 parents 0733514 + 5887134 commit 01db216
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 74 deletions.
51 changes: 0 additions & 51 deletions osu.Game.Rulesets.Mania.Tests/Skinning/TestSceneKeyArea.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private void load(IScrollingInfo scrollingInfo)
accentColour = column.AccentColour.GetBoundCopy();
accentColour.BindValueChanged(colour =>
{
background.Colour = colour.NewValue.Darken(5);
background.Colour = colour.NewValue.Darken(3).Opacity(0.8f);
brightColour = colour.NewValue.Opacity(0.6f);
dimColour = colour.NewValue.Opacity(0);
}, true);
Expand Down
2 changes: 0 additions & 2 deletions osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHitExplosion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon
{
public class ArgonHitExplosion : CompositeDrawable, IHitExplosion
{
private const float default_large_faint_size = 0.8f;

public override bool RemoveWhenNotAlive => true;

[Resolved]
Expand Down
19 changes: 13 additions & 6 deletions osu.Game.Rulesets.Mania/Skinning/Argon/ArgonHoldBodyPiece.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Rulesets.Mania.Objects.Drawables;
using osu.Game.Rulesets.Mania.Skinning.Default;
using osu.Game.Rulesets.Objects.Drawables;
using osuTK.Graphics;

Expand All @@ -16,7 +17,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon
/// <summary>
/// Represents length-wise portion of a hold note.
/// </summary>
public class ArgonHoldBodyPiece : CompositeDrawable
public class ArgonHoldBodyPiece : CompositeDrawable, IHoldNoteBody
{
protected readonly Bindable<Color4> AccentColour = new Bindable<Color4>();
protected readonly IBindable<bool> IsHitting = new Bindable<bool>();
Expand All @@ -26,12 +27,12 @@ public class ArgonHoldBodyPiece : CompositeDrawable

public ArgonHoldBodyPiece()
{
Blending = BlendingParameters.Additive;
RelativeSizeAxes = Axes.Both;

// Without this, the width of the body will be slightly larger than the head/tail.
Masking = true;
CornerRadius = ArgonNotePiece.CORNER_RADIUS;
Blending = BlendingParameters.Additive;
}

[BackgroundDependencyLoader(true)]
Expand All @@ -52,14 +53,14 @@ private void load(DrawableHitObject? drawableObject)
{
var holdNote = (DrawableHoldNote)drawableObject;

AccentColour.BindTo(drawableObject.AccentColour);
AccentColour.BindTo(holdNote.AccentColour);
IsHitting.BindTo(holdNote.IsHitting);
}

AccentColour.BindValueChanged(colour =>
{
background.Colour = colour.NewValue.Opacity(0.2f);
foreground.Colour = colour.NewValue.Opacity(0.1f);
background.Colour = colour.NewValue.Darken(1.2f);
foreground.Colour = colour.NewValue.Opacity(0.2f);
}, true);

IsHitting.BindValueChanged(hitting =>
Expand All @@ -76,7 +77,7 @@ private void load(DrawableHitObject? drawableObject)
using (foreground.BeginDelayedSequence(synchronisedOffset))
{
foreground.FadeTo(1, animation_length).Then()
.FadeTo(0, animation_length)
.FadeTo(0.5f, animation_length)
.Loop();
}
}
Expand All @@ -86,5 +87,11 @@ private void load(DrawableHitObject? drawableObject)
}
});
}

public void Recycle()
{
foreground.ClearTransforms();
foreground.Alpha = 0;
}
}
}
45 changes: 32 additions & 13 deletions osu.Game.Rulesets.Mania/Skinning/Argon/ArgonKeyArea.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using osu.Framework.Graphics.Shapes;
using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events;
using osu.Framework.Utils;
using osu.Game.Graphics;
using osu.Game.Rulesets.Mania.UI;
using osu.Game.Rulesets.UI.Scrolling;
Expand Down Expand Up @@ -50,7 +51,10 @@ private void load(IScrollingInfo scrollingInfo)
InternalChild = directionContainer = new Container
{
RelativeSizeAxes = Axes.X,
Height = Stage.HIT_TARGET_POSITION,
// Ensure the area is tall enough to put the target line in the correct location.
// This is to also allow the main background component to overlap the target line
// and avoid an inner corner radius being shown below the target line.
Height = Stage.HIT_TARGET_POSITION + ArgonNotePiece.CORNER_RADIUS * 2,
Children = new[]
{
new Container
Expand All @@ -62,18 +66,18 @@ private void load(IScrollingInfo scrollingInfo)
{
Name = "Key gradient",
Alpha = 0,
Blending = BlendingParameters.Additive,
RelativeSizeAxes = Axes.Both,
},
},
hitTargetLine = new Circle
{
RelativeSizeAxes = Axes.X,
Anchor = Anchor.TopCentre,
Origin = Anchor.BottomCentre,
Origin = Anchor.TopCentre,
Colour = OsuColour.Gray(196 / 255f),
Height = ArgonNotePiece.CORNER_RADIUS * 2,
Masking = true,
EdgeEffect = new EdgeEffectParameters { Type = EdgeEffectType.Glow },
},
new Container
{
Expand All @@ -97,6 +101,7 @@ private void load(IScrollingInfo scrollingInfo)
Size = new Vector2(icon_circle_size),
Anchor = Anchor.BottomCentre,
Origin = Anchor.Centre,
EdgeEffect = new EdgeEffectParameters { Type = EdgeEffectType.Glow },
},
new Circle
{
Expand All @@ -105,6 +110,7 @@ private void load(IScrollingInfo scrollingInfo)
Size = new Vector2(icon_circle_size),
Anchor = Anchor.BottomCentre,
Origin = Anchor.Centre,
EdgeEffect = new EdgeEffectParameters { Type = EdgeEffectType.Glow },
},
new Circle
{
Expand All @@ -113,6 +119,7 @@ private void load(IScrollingInfo scrollingInfo)
Size = new Vector2(icon_circle_size),
Anchor = Anchor.BottomCentre,
Origin = Anchor.Centre,
EdgeEffect = new EdgeEffectParameters { Type = EdgeEffectType.Glow },
},
}
},
Expand All @@ -125,6 +132,7 @@ private void load(IScrollingInfo scrollingInfo)
Masking = true,
BorderThickness = 4,
BorderColour = Color4.White,
EdgeEffect = new EdgeEffectParameters { Type = EdgeEffectType.Glow },
Children = new Drawable[]
{
new Box
Expand All @@ -146,10 +154,13 @@ private void load(IScrollingInfo scrollingInfo)
accentColour = column.AccentColour.GetBoundCopy();
accentColour.BindValueChanged(colour =>
{
background.Colour = colour.NewValue.Darken(1f);
background.Colour = colour.NewValue.Darken(0.2f);
bottomIcon.Colour = colour.NewValue;
},
true);

// Yes, proxy everything.
column.TopLevelContainer.Add(CreateProxy());
}

private void onDirectionChanged(ValueChangedEvent<ScrollingDirection> direction)
Expand All @@ -174,18 +185,20 @@ public bool OnPressed(KeyBindingPressEvent<ManiaAction> e)
{
if (e.Action != column.Action.Value) return false;

const double lighting_fade_in_duration = 50;
Color4 lightingColour = accentColour.Value.Lighten(0.9f);
const double lighting_fade_in_duration = 70;
Color4 lightingColour = getLightingColour();

background
.FadeTo(1, 40).Then()
.FadeTo(0.8f, 150, Easing.OutQuint);
.FlashColour(accentColour.Value.Lighten(0.8f), 200, Easing.OutQuint)
.FadeTo(1, lighting_fade_in_duration, Easing.OutQuint)
.Then()
.FadeTo(0.8f, 500);

hitTargetLine.FadeColour(Color4.White, lighting_fade_in_duration, Easing.OutQuint);
hitTargetLine.TransformTo(nameof(EdgeEffect), new EdgeEffectParameters
{
Type = EdgeEffectType.Glow,
Colour = lightingColour.Opacity(0.7f),
Colour = lightingColour.Opacity(0.4f),
Radius = 20,
}, lighting_fade_in_duration, Easing.OutQuint);

Expand All @@ -204,7 +217,7 @@ public bool OnPressed(KeyBindingPressEvent<ManiaAction> e)
circle.TransformTo(nameof(EdgeEffect), new EdgeEffectParameters
{
Type = EdgeEffectType.Glow,
Colour = lightingColour.Opacity(0.3f),
Colour = lightingColour.Opacity(0.2f),
Radius = 60,
}, lighting_fade_in_duration, Easing.OutQuint);
}
Expand All @@ -216,10 +229,14 @@ public void OnReleased(KeyBindingReleaseEvent<ManiaAction> e)
{
if (e.Action != column.Action.Value) return;

const double lighting_fade_out_duration = 300;
Color4 lightingColour = accentColour.Value.Lighten(0.9f).Opacity(0);
const double lighting_fade_out_duration = 800;

background.FadeTo(0, lighting_fade_out_duration, Easing.OutQuint);
Color4 lightingColour = getLightingColour().Opacity(0);

// background fades out faster than lighting elements to give better definition to the player.
background.FadeTo(0.3f, 50, Easing.OutQuint)
.Then()
.FadeOut(lighting_fade_out_duration, Easing.OutQuint);

topIcon.ScaleTo(1f, 200, Easing.OutQuint);
topIcon.TransformTo(nameof(EdgeEffect), new EdgeEffectParameters
Expand Down Expand Up @@ -249,5 +266,7 @@ public void OnReleased(KeyBindingReleaseEvent<ManiaAction> e)
}, lighting_fade_out_duration, Easing.OutQuint);
}
}

private Color4 getLightingColour() => Interpolation.ValueAt(0.2f, accentColour.Value, Color4.White, 0, 1);
}
}
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Mania/Skinning/Argon/ArgonNotePiece.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ internal class ArgonNotePiece : CompositeDrawable
{
public const float NOTE_HEIGHT = 42;

public const float CORNER_RADIUS = 3;
public const float CORNER_RADIUS = 3.4f;

private readonly IBindable<ScrollingDirection> direction = new Bindable<ScrollingDirection>();
private readonly IBindable<Color4> accentColour = new Bindable<Color4>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ public ManiaArgonSkinTransformer(ISkin skin, IBeatmap beatmap)

switch (maniaLookup.Lookup)
{
case LegacyManiaSkinConfigurationLookups.ColumnSpacing:
return SkinUtils.As<TValue>(new Bindable<float>(2));

case LegacyManiaSkinConfigurationLookups.StagePaddingBottom:
case LegacyManiaSkinConfigurationLookups.StagePaddingTop:
return SkinUtils.As<TValue>(new Bindable<float>(30));
Expand Down

0 comments on commit 01db216

Please sign in to comment.