From 1e5ff2679b3ba6b00b6e858561f5707e85cdd56d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 5 Oct 2022 18:27:51 +0900 Subject: [PATCH] Rename classes to better emphasise that `Smoke` is a single trail segment --- osu.Game.Rulesets.Osu/OsuSkinComponents.cs | 2 +- .../Default/{DefaultSmoke.cs => DefaultSmokeSegment.cs} | 2 +- .../Legacy/{LegacySmoke.cs => LegacySmokeSegment.cs} | 2 +- .../Skinning/Legacy/OsuLegacySkinTransformer.cs | 4 ++-- osu.Game.Rulesets.Osu/Skinning/{Smoke.cs => SmokeSegment.cs} | 4 ++-- osu.Game.Rulesets.Osu/UI/SmokeContainer.cs | 5 ++++- 6 files changed, 11 insertions(+), 8 deletions(-) rename osu.Game.Rulesets.Osu/Skinning/Default/{DefaultSmoke.cs => DefaultSmokeSegment.cs} (92%) rename osu.Game.Rulesets.Osu/Skinning/Legacy/{LegacySmoke.cs => LegacySmokeSegment.cs} (90%) rename osu.Game.Rulesets.Osu/Skinning/{Smoke.cs => SmokeSegment.cs} (99%) diff --git a/osu.Game.Rulesets.Osu/OsuSkinComponents.cs b/osu.Game.Rulesets.Osu/OsuSkinComponents.cs index 11daa26072..3ee30ff7dc 100644 --- a/osu.Game.Rulesets.Osu/OsuSkinComponents.cs +++ b/osu.Game.Rulesets.Osu/OsuSkinComponents.cs @@ -21,7 +21,7 @@ public enum OsuSkinComponents SliderBall, SliderBody, SpinnerBody, - Smoke, + SmokeTrail, ApproachCircle, } } diff --git a/osu.Game.Rulesets.Osu/Skinning/Default/DefaultSmoke.cs b/osu.Game.Rulesets.Osu/Skinning/Default/DefaultSmokeSegment.cs similarity index 92% rename from osu.Game.Rulesets.Osu/Skinning/Default/DefaultSmoke.cs rename to osu.Game.Rulesets.Osu/Skinning/Default/DefaultSmokeSegment.cs index 1b7a39aa30..27a2dc3960 100644 --- a/osu.Game.Rulesets.Osu/Skinning/Default/DefaultSmoke.cs +++ b/osu.Game.Rulesets.Osu/Skinning/Default/DefaultSmokeSegment.cs @@ -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) diff --git a/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacySmoke.cs b/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacySmokeSegment.cs similarity index 90% rename from osu.Game.Rulesets.Osu/Skinning/Legacy/LegacySmoke.cs rename to osu.Game.Rulesets.Osu/Skinning/Legacy/LegacySmokeSegment.cs index 89e90cd4c8..c9c7e86e86 100644 --- a/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacySmoke.cs +++ b/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacySmokeSegment.cs @@ -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) diff --git a/osu.Game.Rulesets.Osu/Skinning/Legacy/OsuLegacySkinTransformer.cs b/osu.Game.Rulesets.Osu/Skinning/Legacy/OsuLegacySkinTransformer.cs index d44d2b031a..4d12b85770 100644 --- a/osu.Game.Rulesets.Osu/Skinning/Legacy/OsuLegacySkinTransformer.cs +++ b/osu.Game.Rulesets.Osu/Skinning/Legacy/OsuLegacySkinTransformer.cs @@ -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; diff --git a/osu.Game.Rulesets.Osu/Skinning/Smoke.cs b/osu.Game.Rulesets.Osu/Skinning/SmokeSegment.cs similarity index 99% rename from osu.Game.Rulesets.Osu/Skinning/Smoke.cs rename to osu.Game.Rulesets.Osu/Skinning/SmokeSegment.cs index 5d2aa2b1f6..948ec972a3 100644 --- a/osu.Game.Rulesets.Osu/Skinning/Smoke.cs +++ b/osu.Game.Rulesets.Osu/Skinning/SmokeSegment.cs @@ -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; } diff --git a/osu.Game.Rulesets.Osu/UI/SmokeContainer.cs b/osu.Game.Rulesets.Osu/UI/SmokeContainer.cs index 4984dc1ad1..d26d45c3d7 100644 --- a/osu.Game.Rulesets.Osu/UI/SmokeContainer.cs +++ b/osu.Game.Rulesets.Osu/UI/SmokeContainer.cs @@ -14,6 +14,9 @@ namespace osu.Game.Rulesets.Osu.UI { + /// + /// Manages smoke trails generated from user input. + /// [Cached] public class SmokeContainer : Container, IRequireHighFrequencyMousePosition, IKeyBindingHandler { @@ -31,7 +34,7 @@ public bool OnPressed(KeyBindingPressEvent 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; }