mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 23:52:57 +08:00
Merge pull request #22136 from peppy/fix-kiai-flash-intensity
Fix kiai flash opacity on legacy skins being too intense
This commit is contained in:
commit
baf20a6b50
@ -1,6 +1,7 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Extensions.ObjectExtensions;
|
||||
@ -29,8 +30,8 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
|
||||
|
||||
private readonly bool hasNumber;
|
||||
|
||||
protected Drawable CircleSprite = null!;
|
||||
protected Drawable OverlaySprite = null!;
|
||||
protected LegacyKiaiFlashingDrawable CircleSprite = null!;
|
||||
protected LegacyKiaiFlashingDrawable OverlaySprite = null!;
|
||||
|
||||
protected Container OverlayLayer { get; private set; } = null!;
|
||||
|
||||
@ -65,7 +66,6 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
|
||||
// at this point, any further texture fetches should be correctly using the priority source if the base texture was retrieved using it.
|
||||
// the conditional above handles the case where a sliderendcircle.png is retrieved from the skin, but sliderendcircleoverlay.png doesn't exist.
|
||||
// expected behaviour in this scenario is not showing the overlay, rather than using hitcircleoverlay.png.
|
||||
|
||||
InternalChildren = new[]
|
||||
{
|
||||
CircleSprite = new LegacyKiaiFlashingDrawable(() => new Sprite { Texture = skin.GetTexture(circleName) })
|
||||
@ -114,7 +114,21 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
accentColour.BindValueChanged(colour => CircleSprite.Colour = LegacyColourCompatibility.DisallowZeroAlpha(colour.NewValue), true);
|
||||
accentColour.BindValueChanged(colour =>
|
||||
{
|
||||
Color4 objectColour = colour.NewValue;
|
||||
int add = Math.Max(25, 300 - (int)(objectColour.R * 255) - (int)(objectColour.G * 255) - (int)(objectColour.B * 255));
|
||||
|
||||
var kiaiTintColour = new Color4(
|
||||
(byte)Math.Min((byte)(objectColour.R * 255) + add, 255),
|
||||
(byte)Math.Min((byte)(objectColour.G * 255) + add, 255),
|
||||
(byte)Math.Min((byte)(objectColour.B * 255) + add, 255),
|
||||
255);
|
||||
|
||||
CircleSprite.Colour = LegacyColourCompatibility.DisallowZeroAlpha(colour.NewValue);
|
||||
OverlaySprite.KiaiGlowColour = CircleSprite.KiaiGlowColour = LegacyColourCompatibility.DisallowZeroAlpha(kiaiTintColour);
|
||||
}, true);
|
||||
|
||||
if (hasNumber)
|
||||
indexInCurrentCombo.BindValueChanged(index => hitCircleText.Text = (index.NewValue + 1).ToString(), true);
|
||||
|
||||
|
@ -6,14 +6,21 @@ using osu.Framework.Audio.Track;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Beatmaps.ControlPoints;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Skinning
|
||||
{
|
||||
public partial class LegacyKiaiFlashingDrawable : BeatSyncedContainer
|
||||
{
|
||||
public Color4 KiaiGlowColour
|
||||
{
|
||||
get => flashingDrawable.Colour;
|
||||
set => flashingDrawable.Colour = value;
|
||||
}
|
||||
|
||||
private readonly Drawable flashingDrawable;
|
||||
|
||||
private const float flash_opacity = 0.55f;
|
||||
private const float flash_opacity = 0.3f;
|
||||
|
||||
public LegacyKiaiFlashingDrawable(Func<Drawable?> creationFunc)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user