Rename classes to better emphasise that `Smoke` is a single trail segment

This commit is contained in:
Dean Herbert 2022-10-05 18:27:51 +09:00
parent 04abb2ce8f
commit 1e5ff2679b
6 changed files with 11 additions and 8 deletions

View File

@ -21,7 +21,7 @@ public enum OsuSkinComponents
SliderBall,
SliderBody,
SpinnerBody,
Smoke,
SmokeTrail,
ApproachCircle,
}
}

View File

@ -6,7 +6,7 @@
namespace osu.Game.Rulesets.Osu.Skinning.Default
{
public class DefaultSmoke : Smoke
public class DefaultSmokeSegment : SmokeSegment
{
[BackgroundDependencyLoader]
private void load(TextureStore textures)

View File

@ -6,7 +6,7 @@
namespace osu.Game.Rulesets.Osu.Skinning.Legacy
{
public class LegacySmoke : Smoke
public class LegacySmokeSegment : SmokeSegment
{
[BackgroundDependencyLoader]
private void load(ISkinSource skin)

View File

@ -106,9 +106,9 @@ public override Drawable GetDrawableComponent(ISkinComponent component)
return null;
case OsuSkinComponents.Smoke:
case OsuSkinComponents.SmokeTrail:
if (GetTexture("cursor-smoke") != null)
return new LegacySmoke();
return new LegacySmokeSegment();
return null;

View File

@ -20,7 +20,7 @@
namespace osu.Game.Rulesets.Osu.Skinning
{
public abstract class Smoke : Drawable, ITexturedShaderDrawable
public abstract class SmokeSegment : Drawable, ITexturedShaderDrawable
{
public IShader? TextureShader { get; private set; }
public IShader? RoundedTextureShader { get; private set; }
@ -214,7 +214,7 @@ public int Compare(SmokePoint x, SmokePoint target)
protected class SmokeDrawNode : TexturedShaderDrawNode
{
protected new Smoke Source => (Smoke)base.Source;
protected new SmokeSegment Source => (SmokeSegment)base.Source;
protected double SmokeStartTime { get; private set; }
protected double SmokeEndTime { get; private set; }

View File

@ -14,6 +14,9 @@
namespace osu.Game.Rulesets.Osu.UI
{
/// <summary>
/// Manages smoke trails generated from user input.
/// </summary>
[Cached]
public class SmokeContainer : Container, IRequireHighFrequencyMousePosition, IKeyBindingHandler<OsuAction>
{
@ -31,7 +34,7 @@ public bool OnPressed(KeyBindingPressEvent<OsuAction> e)
if (e.Action == OsuAction.Smoke)
{
isSmoking = true;
AddInternal(new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.Smoke), _ => new DefaultSmoke()));
AddInternal(new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.SmokeTrail), _ => new DefaultSmokeSegment()));
return true;
}