-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 #24990 from peppy/argon-better-reverse
Add edge highlight to "argon" slider repeat arrow (and improve all skins' reverse arrow animations)
- Loading branch information
Showing
7 changed files
with
197 additions
and
78 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
69 changes: 69 additions & 0 deletions
69
osu.Game.Rulesets.Osu/Skinning/Default/DefaultReverseArrow.cs
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 |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using osu.Framework.Allocation; | ||
using osu.Framework.Extensions.ObjectExtensions; | ||
using osu.Framework.Graphics; | ||
using osu.Framework.Graphics.Containers; | ||
using osu.Framework.Graphics.Sprites; | ||
using osu.Game.Rulesets.Objects.Drawables; | ||
using osu.Game.Rulesets.Osu.Objects; | ||
using osuTK; | ||
|
||
namespace osu.Game.Rulesets.Osu.Skinning.Default | ||
{ | ||
public partial class DefaultReverseArrow : CompositeDrawable | ||
{ | ||
[Resolved] | ||
private DrawableHitObject drawableObject { get; set; } = null!; | ||
|
||
public DefaultReverseArrow() | ||
{ | ||
Anchor = Anchor.Centre; | ||
Origin = Anchor.Centre; | ||
|
||
Size = OsuHitObject.OBJECT_DIMENSIONS; | ||
|
||
InternalChild = new SpriteIcon | ||
{ | ||
RelativeSizeAxes = Axes.Both, | ||
Blending = BlendingParameters.Additive, | ||
Icon = FontAwesome.Solid.ChevronRight, | ||
Size = new Vector2(0.35f), | ||
Anchor = Anchor.Centre, | ||
Origin = Anchor.Centre, | ||
}; | ||
} | ||
|
||
[BackgroundDependencyLoader] | ||
private void load() | ||
{ | ||
drawableObject.ApplyCustomUpdateState += updateStateTransforms; | ||
} | ||
|
||
private void updateStateTransforms(DrawableHitObject hitObject, ArmedState state) | ||
{ | ||
const double move_out_duration = 35; | ||
const double move_in_duration = 250; | ||
const double total = 300; | ||
|
||
switch (state) | ||
{ | ||
case ArmedState.Idle: | ||
InternalChild.ScaleTo(1.3f, move_out_duration, Easing.Out) | ||
.Then() | ||
.ScaleTo(1f, move_in_duration, Easing.Out) | ||
.Loop(total - (move_in_duration + move_out_duration)); | ||
break; | ||
} | ||
} | ||
|
||
protected override void Dispose(bool isDisposing) | ||
{ | ||
base.Dispose(isDisposing); | ||
|
||
if (drawableObject.IsNotNull()) | ||
drawableObject.ApplyCustomUpdateState -= updateStateTransforms; | ||
} | ||
} | ||
} |
51 changes: 0 additions & 51 deletions
51
osu.Game.Rulesets.Osu/Skinning/Default/ReverseArrowPiece.cs
This file was deleted.
Oops, something went wrong.
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