1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 17:27:24 +08:00

Share scale factor with hit target

This commit is contained in:
Dean Herbert 2024-05-27 14:20:28 +09:00
parent 76f13b21da
commit 0d6adf160b
No known key found for this signature in database
2 changed files with 11 additions and 7 deletions

View File

@ -21,8 +21,6 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Legacy
private Sprite sprite = null!; private Sprite sprite = null!;
private const float base_scale = 0.8f;
[BackgroundDependencyLoader(true)] [BackgroundDependencyLoader(true)]
private void load(ISkinSource skin, HealthProcessor? healthProcessor) private void load(ISkinSource skin, HealthProcessor? healthProcessor)
{ {
@ -32,7 +30,7 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Legacy
Origin = Anchor.Centre, Origin = Anchor.Centre,
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Alpha = 0, Alpha = 0,
Scale = new Vector2(base_scale), Scale = new Vector2(TaikoLegacyHitTarget.SCALE),
Colour = new Colour4(255, 228, 0, 255), Colour = new Colour4(255, 228, 0, 255),
}; };
@ -60,8 +58,8 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Legacy
if (!result.IsHit || !isKiaiActive) if (!result.IsHit || !isKiaiActive)
return; return;
sprite.ScaleTo(base_scale + 0.15f).Then() sprite.ScaleTo(TaikoLegacyHitTarget.SCALE + 0.15f).Then()
.ScaleTo(base_scale, 80, Easing.OutQuad); .ScaleTo(TaikoLegacyHitTarget.SCALE, 80, Easing.OutQuad);
} }
} }
} }

View File

@ -12,6 +12,12 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Legacy
{ {
public partial class TaikoLegacyHitTarget : CompositeDrawable public partial class TaikoLegacyHitTarget : CompositeDrawable
{ {
/// <summary>
/// In stable this is 0.7f (see https://github.com/peppy/osu-stable-reference/blob/7519cafd1823f1879c0d9c991ba0e5c7fd3bfa02/osu!/GameModes/Play/Rulesets/Taiko/RulesetTaiko.cs#L592)
/// but for whatever reason this doesn't match visually.
/// </summary>
public const float SCALE = 0.8f;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(ISkinSource skin) private void load(ISkinSource skin)
{ {
@ -22,7 +28,7 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Legacy
new Sprite new Sprite
{ {
Texture = skin.GetTexture("approachcircle"), Texture = skin.GetTexture("approachcircle"),
Scale = new Vector2(0.83f), Scale = new Vector2(SCALE + 0.03f),
Alpha = 0.47f, // eyeballed to match stable Alpha = 0.47f, // eyeballed to match stable
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
@ -30,7 +36,7 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Legacy
new Sprite new Sprite
{ {
Texture = skin.GetTexture("taikobigcircle"), Texture = skin.GetTexture("taikobigcircle"),
Scale = new Vector2(0.8f), Scale = new Vector2(SCALE),
Alpha = 0.22f, // eyeballed to match stable Alpha = 0.22f, // eyeballed to match stable
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,