-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27977 from DavidBeh/magnetised-judgements
Make judgements follow hitcircles and enable them in magnetised, repel and depth
- Loading branch information
Showing
6 changed files
with
33 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
#nullable disable | ||
|
||
using osu.Framework.Allocation; | ||
using osu.Framework.Graphics; | ||
using osu.Game.Configuration; | ||
|
@@ -14,10 +12,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables | |
{ | ||
public partial class DrawableOsuJudgement : DrawableJudgement | ||
{ | ||
internal SkinnableLighting Lighting { get; private set; } | ||
internal SkinnableLighting Lighting { get; private set; } = null!; | ||
|
||
[Resolved] | ||
private OsuConfigManager config { get; set; } | ||
private OsuConfigManager config { get; set; } = null!; | ||
|
||
private bool positionTransferred; | ||
|
||
[BackgroundDependencyLoader] | ||
private void load() | ||
|
@@ -39,10 +39,19 @@ protected override void PrepareForUse() | |
Lighting.ResetAnimation(); | ||
Lighting.SetColourFrom(JudgedObject, Result); | ||
|
||
if (JudgedObject?.HitObject is OsuHitObject osuObject) | ||
positionTransferred = false; | ||
} | ||
|
||
protected override void Update() | ||
{ | ||
base.Update(); | ||
|
||
if (!positionTransferred && JudgedObject is DrawableOsuHitObject osuObject && JudgedObject.IsInUse) | ||
{ | ||
Position = osuObject.StackedEndPosition; | ||
Scale = new Vector2(osuObject.Scale); | ||
Position = osuObject.ToSpaceOfOtherDrawable(osuObject.OriginPosition, Parent!); | ||
Scale = new Vector2(osuObject.HitObject.Scale); | ||
|
||
positionTransferred = true; | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
#nullable disable | ||
|
||
using System; | ||
using System.Diagnostics; | ||
using JetBrains.Annotations; | ||
using osu.Framework.Allocation; | ||
using osu.Framework.Graphics; | ||
using osu.Framework.Graphics.Containers; | ||
|
@@ -24,13 +21,13 @@ public partial class DrawableJudgement : PoolableDrawable | |
{ | ||
private const float judgement_size = 128; | ||
|
||
public JudgementResult Result { get; private set; } | ||
public JudgementResult? Result { get; private set; } | ||
|
||
public DrawableHitObject JudgedObject { get; private set; } | ||
public DrawableHitObject? JudgedObject { get; private set; } | ||
|
||
public override bool RemoveCompletedTransforms => false; | ||
|
||
protected SkinnableDrawable JudgementBody { get; private set; } | ||
protected SkinnableDrawable? JudgementBody { get; private set; } | ||
|
||
private readonly Container aboveHitObjectsContent; | ||
|
||
|
@@ -97,12 +94,19 @@ protected virtual void ApplyMissAnimations() | |
/// </summary> | ||
/// <param name="result">The applicable judgement.</param> | ||
/// <param name="judgedObject">The drawable object.</param> | ||
public void Apply([NotNull] JudgementResult result, [CanBeNull] DrawableHitObject judgedObject) | ||
public void Apply(JudgementResult result, DrawableHitObject? judgedObject) | ||
{ | ||
Result = result; | ||
JudgedObject = judgedObject; | ||
} | ||
|
||
protected override void FreeAfterUse() | ||
{ | ||
base.FreeAfterUse(); | ||
|
||
JudgedObject = null; | ||
} | ||
|
||
protected override void PrepareForUse() | ||
{ | ||
base.PrepareForUse(); | ||
|
@@ -121,6 +125,8 @@ private void runAnimation() | |
ApplyTransformsAt(double.MinValue, true); | ||
ClearTransforms(true); | ||
|
||
Debug.Assert(Result != null && JudgementBody != null); | ||
|
||
LifetimeStart = Result.TimeAbsolute; | ||
|
||
using (BeginAbsoluteSequence(Result.TimeAbsolute)) | ||
|