-
-
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 branch 'master' into update-framework
- Loading branch information
Showing
11 changed files
with
427 additions
and
107 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,5 +18,6 @@ public enum OsuSkinComponents | |
SliderBall, | ||
SliderBody, | ||
SpinnerBody, | ||
ApproachCircle, | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
49 changes: 49 additions & 0 deletions
49
osu.Game.Rulesets.Osu/Skinning/Default/DefaultApproachCircle.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,49 @@ | ||
// 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.Bindables; | ||
using osu.Framework.Graphics; | ||
using osu.Game.Rulesets.Objects.Drawables; | ||
using osu.Game.Skinning; | ||
using osuTK; | ||
using osuTK.Graphics; | ||
|
||
namespace osu.Game.Rulesets.Osu.Skinning.Default | ||
{ | ||
public class DefaultApproachCircle : SkinnableSprite | ||
{ | ||
private readonly IBindable<Color4> accentColour = new Bindable<Color4>(); | ||
|
||
[Resolved] | ||
private DrawableHitObject drawableObject { get; set; } | ||
|
||
public DefaultApproachCircle() | ||
: base("Gameplay/osu/approachcircle") | ||
{ | ||
} | ||
|
||
[BackgroundDependencyLoader] | ||
private void load() | ||
{ | ||
accentColour.BindTo(drawableObject.AccentColour); | ||
} | ||
|
||
protected override void LoadComplete() | ||
{ | ||
base.LoadComplete(); | ||
accentColour.BindValueChanged(colour => Colour = colour.NewValue, true); | ||
} | ||
|
||
protected override Drawable CreateDefault(ISkinComponent component) | ||
{ | ||
var drawable = base.CreateDefault(component); | ||
|
||
// Although this is a non-legacy component, osu-resources currently stores approach circle as a legacy-like texture. | ||
// See LegacyApproachCircle for documentation as to why this is required. | ||
drawable.Scale = new Vector2(128 / 118f); | ||
|
||
return drawable; | ||
} | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyApproachCircle.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,49 @@ | ||
// 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.Bindables; | ||
using osu.Framework.Graphics; | ||
using osu.Game.Rulesets.Objects.Drawables; | ||
using osu.Game.Skinning; | ||
using osuTK; | ||
using osuTK.Graphics; | ||
|
||
namespace osu.Game.Rulesets.Osu.Skinning.Legacy | ||
{ | ||
public class LegacyApproachCircle : SkinnableSprite | ||
{ | ||
private readonly IBindable<Color4> accentColour = new Bindable<Color4>(); | ||
|
||
[Resolved] | ||
private DrawableHitObject drawableObject { get; set; } | ||
|
||
public LegacyApproachCircle() | ||
: base("Gameplay/osu/approachcircle") | ||
{ | ||
} | ||
|
||
[BackgroundDependencyLoader] | ||
private void load() | ||
{ | ||
accentColour.BindTo(drawableObject.AccentColour); | ||
} | ||
|
||
protected override void LoadComplete() | ||
{ | ||
base.LoadComplete(); | ||
accentColour.BindValueChanged(colour => Colour = LegacyColourCompatibility.DisallowZeroAlpha(colour.NewValue), true); | ||
} | ||
|
||
protected override Drawable CreateDefault(ISkinComponent component) | ||
{ | ||
var drawable = base.CreateDefault(component); | ||
|
||
// account for the sprite being used for the default approach circle being taken from stable, | ||
// when hitcircles have 5px padding on each size. this should be removed if we update the sprite. | ||
drawable.Scale = new Vector2(128 / 118f); | ||
|
||
return drawable; | ||
} | ||
} | ||
} |
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
Oops, something went wrong.