mirror of
https://github.com/ppy/osu
synced 2024-12-26 00:32:52 +00:00
Enable NRT in explosion-related classes and streamline null handling
This commit is contained in:
parent
98ce69d1d3
commit
68f454b51a
@ -72,9 +72,6 @@ namespace osu.Game.Rulesets.Catch.Skinning.Default
|
|||||||
|
|
||||||
public void Animate(HitExplosionEntry entry)
|
public void Animate(HitExplosionEntry entry)
|
||||||
{
|
{
|
||||||
if (entry == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
X = entry.Position;
|
X = entry.Position;
|
||||||
Scale = new Vector2(entry.HitObject.Scale);
|
Scale = new Vector2(entry.HitObject.Scale);
|
||||||
setColour(entry.ObjectColour);
|
setColour(entry.ObjectColour);
|
||||||
|
@ -62,9 +62,6 @@ namespace osu.Game.Rulesets.Catch.Skinning.Legacy
|
|||||||
|
|
||||||
public void Animate(HitExplosionEntry entry)
|
public void Animate(HitExplosionEntry entry)
|
||||||
{
|
{
|
||||||
if (entry == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
Colour = entry.ObjectColour;
|
Colour = entry.ObjectColour;
|
||||||
|
|
||||||
using (BeginAbsoluteSequence(entry.LifetimeStart))
|
using (BeginAbsoluteSequence(entry.LifetimeStart))
|
||||||
|
@ -1,28 +1,25 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Rulesets.Catch.Skinning.Default;
|
using osu.Game.Rulesets.Catch.Skinning.Default;
|
||||||
using osu.Game.Rulesets.Objects.Pooling;
|
using osu.Game.Rulesets.Objects.Pooling;
|
||||||
using osu.Game.Skinning;
|
using osu.Game.Skinning;
|
||||||
|
|
||||||
|
#nullable enable
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.UI
|
namespace osu.Game.Rulesets.Catch.UI
|
||||||
{
|
{
|
||||||
public class HitExplosion : PoolableDrawableWithLifetime<HitExplosionEntry>
|
public class HitExplosion : PoolableDrawableWithLifetime<HitExplosionEntry>
|
||||||
{
|
{
|
||||||
private SkinnableDrawable skinnableExplosion;
|
private readonly SkinnableDrawable skinnableExplosion;
|
||||||
|
|
||||||
public HitExplosion()
|
public HitExplosion()
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
Anchor = Anchor.BottomCentre;
|
Anchor = Anchor.BottomCentre;
|
||||||
Origin = Anchor.BottomCentre;
|
Origin = Anchor.BottomCentre;
|
||||||
}
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load()
|
|
||||||
{
|
|
||||||
InternalChild = skinnableExplosion = new SkinnableDrawable(new CatchSkinComponent(CatchSkinComponents.HitExplosion), _ => new DefaultHitExplosion())
|
InternalChild = skinnableExplosion = new SkinnableDrawable(new CatchSkinComponent(CatchSkinComponents.HitExplosion), _ => new DefaultHitExplosion())
|
||||||
{
|
{
|
||||||
CentreComponent = false,
|
CentreComponent = false,
|
||||||
@ -44,8 +41,11 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
apply(Entry);
|
apply(Entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void apply(HitExplosionEntry entry)
|
private void apply(HitExplosionEntry? entry)
|
||||||
{
|
{
|
||||||
|
if (entry == null)
|
||||||
|
return;
|
||||||
|
|
||||||
ApplyTransformsAt(double.MinValue, true);
|
ApplyTransformsAt(double.MinValue, true);
|
||||||
ClearTransforms(true);
|
ClearTransforms(true);
|
||||||
|
|
||||||
|
@ -6,6 +6,8 @@ using osu.Game.Rulesets.Catch.Objects;
|
|||||||
using osu.Game.Rulesets.Judgements;
|
using osu.Game.Rulesets.Judgements;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
|
|
||||||
|
#nullable enable
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.UI
|
namespace osu.Game.Rulesets.Catch.UI
|
||||||
{
|
{
|
||||||
public class HitExplosionEntry : LifetimeEntry
|
public class HitExplosionEntry : LifetimeEntry
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
#nullable enable
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.UI
|
namespace osu.Game.Rulesets.Catch.UI
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user