mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 17:23:22 +08:00
Merge branch 'master' into argon-kiai
This commit is contained in:
commit
73f53328cf
@ -5,9 +5,11 @@
|
|||||||
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Beatmaps.ControlPoints;
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.Osu.Objects;
|
using osu.Game.Rulesets.Osu.Objects;
|
||||||
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
||||||
@ -22,6 +24,9 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
{
|
{
|
||||||
private int depthIndex;
|
private int depthIndex;
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private OsuConfigManager config { get; set; }
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestHits()
|
public void TestHits()
|
||||||
{
|
{
|
||||||
@ -56,6 +61,13 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
AddStep("Hit stream late", () => SetContents(_ => testStream(5, true, 150)));
|
AddStep("Hit stream late", () => SetContents(_ => testStream(5, true, 150)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestHitLighting()
|
||||||
|
{
|
||||||
|
AddToggleStep("toggle hit lighting", v => config.SetValue(OsuSetting.HitLighting, v));
|
||||||
|
AddStep("Hit Big Single", () => SetContents(_ => testSingle(2, true)));
|
||||||
|
}
|
||||||
|
|
||||||
private Drawable testSingle(float circleSize, bool auto = false, double timeOffset = 0, Vector2? positionOffset = null)
|
private Drawable testSingle(float circleSize, bool auto = false, double timeOffset = 0, Vector2? positionOffset = null)
|
||||||
{
|
{
|
||||||
var playfield = new TestOsuPlayfield();
|
var playfield = new TestOsuPlayfield();
|
||||||
|
@ -10,6 +10,7 @@ using osu.Framework.Graphics.Colour;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Effects;
|
using osu.Framework.Graphics.Effects;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
@ -45,6 +46,8 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon
|
|||||||
private readonly FlashPiece flash;
|
private readonly FlashPiece flash;
|
||||||
private readonly KiaiFlash kiaiFlash;
|
private readonly KiaiFlash kiaiFlash;
|
||||||
|
|
||||||
|
private Bindable<bool> configHitLighting = null!;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private DrawableHitObject drawableObject { get; set; } = null!;
|
private DrawableHitObject drawableObject { get; set; } = null!;
|
||||||
|
|
||||||
@ -65,21 +68,18 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon
|
|||||||
outerGradient = new Circle // renders the outer bright gradient
|
outerGradient = new Circle // renders the outer bright gradient
|
||||||
{
|
{
|
||||||
Size = new Vector2(OUTER_GRADIENT_SIZE),
|
Size = new Vector2(OUTER_GRADIENT_SIZE),
|
||||||
Alpha = 1,
|
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
},
|
},
|
||||||
innerGradient = new Circle // renders the inner bright gradient
|
innerGradient = new Circle // renders the inner bright gradient
|
||||||
{
|
{
|
||||||
Size = new Vector2(INNER_GRADIENT_SIZE),
|
Size = new Vector2(INNER_GRADIENT_SIZE),
|
||||||
Alpha = 1,
|
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
},
|
},
|
||||||
innerFill = new Circle // renders the inner dark fill
|
innerFill = new Circle // renders the inner dark fill
|
||||||
{
|
{
|
||||||
Size = new Vector2(INNER_FILL_SIZE),
|
Size = new Vector2(INNER_FILL_SIZE),
|
||||||
Alpha = 1,
|
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
},
|
},
|
||||||
@ -106,12 +106,14 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load(OsuConfigManager config)
|
||||||
{
|
{
|
||||||
var drawableOsuObject = (DrawableOsuHitObject)drawableObject;
|
var drawableOsuObject = (DrawableOsuHitObject)drawableObject;
|
||||||
|
|
||||||
accentColour.BindTo(drawableObject.AccentColour);
|
accentColour.BindTo(drawableObject.AccentColour);
|
||||||
indexInCurrentCombo.BindTo(drawableOsuObject.IndexInCurrentComboBindable);
|
indexInCurrentCombo.BindTo(drawableOsuObject.IndexInCurrentComboBindable);
|
||||||
|
|
||||||
|
configHitLighting = config.GetBindable<bool>(OsuSetting.HitLighting);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
@ -134,14 +136,18 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon
|
|||||||
|
|
||||||
// Accent colour may be changed many times during a paused gameplay state.
|
// Accent colour may be changed many times during a paused gameplay state.
|
||||||
// Schedule the change to avoid transforms piling up.
|
// Schedule the change to avoid transforms piling up.
|
||||||
Scheduler.AddOnce(updateStateTransforms);
|
Scheduler.AddOnce(() =>
|
||||||
|
{
|
||||||
|
ApplyTransformsAt(double.MinValue, true);
|
||||||
|
ClearTransformsAfter(double.MinValue, true);
|
||||||
|
|
||||||
|
updateStateTransforms(drawableObject, drawableObject.State.Value);
|
||||||
|
});
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
drawableObject.ApplyCustomUpdateState += updateStateTransforms;
|
drawableObject.ApplyCustomUpdateState += updateStateTransforms;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateStateTransforms() => updateStateTransforms(drawableObject, drawableObject.State.Value);
|
|
||||||
|
|
||||||
private void updateStateTransforms(DrawableHitObject drawableHitObject, ArmedState state)
|
private void updateStateTransforms(DrawableHitObject drawableHitObject, ArmedState state)
|
||||||
{
|
{
|
||||||
using (BeginAbsoluteSequence(drawableObject.HitStateUpdateTime))
|
using (BeginAbsoluteSequence(drawableObject.HitStateUpdateTime))
|
||||||
@ -151,12 +157,15 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon
|
|||||||
case ArmedState.Hit:
|
case ArmedState.Hit:
|
||||||
// Fade out time is at a maximum of 800. Must match `DrawableHitCircle`'s arbitrary lifetime spec.
|
// Fade out time is at a maximum of 800. Must match `DrawableHitCircle`'s arbitrary lifetime spec.
|
||||||
const double fade_out_time = 800;
|
const double fade_out_time = 800;
|
||||||
|
|
||||||
const double flash_in_duration = 150;
|
const double flash_in_duration = 150;
|
||||||
const double resize_duration = 400;
|
const double resize_duration = 400;
|
||||||
|
|
||||||
const float shrink_size = 0.8f;
|
const float shrink_size = 0.8f;
|
||||||
|
|
||||||
|
// When the user has hit lighting disabled, we won't be showing the bright white flash.
|
||||||
|
// To make things look good, the surrounding animations are also slightly adjusted.
|
||||||
|
bool showFlash = configHitLighting.Value;
|
||||||
|
|
||||||
// Animating with the number present is distracting.
|
// Animating with the number present is distracting.
|
||||||
// The number disappearing is hidden by the bright flash.
|
// The number disappearing is hidden by the bright flash.
|
||||||
number.FadeOut(flash_in_duration / 2);
|
number.FadeOut(flash_in_duration / 2);
|
||||||
@ -187,15 +196,27 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon
|
|||||||
using (BeginDelayedSequence(flash_in_duration / 12))
|
using (BeginDelayedSequence(flash_in_duration / 12))
|
||||||
{
|
{
|
||||||
outerGradient.ResizeTo(OUTER_GRADIENT_SIZE * shrink_size, resize_duration, Easing.OutElasticHalf);
|
outerGradient.ResizeTo(OUTER_GRADIENT_SIZE * shrink_size, resize_duration, Easing.OutElasticHalf);
|
||||||
outerGradient
|
|
||||||
.FadeColour(Color4.White, 80)
|
if (showFlash)
|
||||||
.Then()
|
{
|
||||||
.FadeOut(flash_in_duration);
|
outerGradient
|
||||||
|
.FadeColour(Color4.White, 80)
|
||||||
|
.Then()
|
||||||
|
.FadeOut(flash_in_duration);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
outerGradient
|
||||||
|
.FadeColour(Color4.White, flash_in_duration * 8)
|
||||||
|
.FadeOut(flash_in_duration * 2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
flash.FadeTo(1, flash_in_duration, Easing.OutQuint);
|
if (showFlash)
|
||||||
|
flash.FadeTo(1, flash_in_duration, Easing.OutQuint);
|
||||||
|
|
||||||
|
this.FadeOut(showFlash ? fade_out_time : fade_out_time / 2, Easing.OutQuad);
|
||||||
|
|
||||||
this.FadeOut(fade_out_time, Easing.OutQuad);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user