mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 08:23:00 +08:00
Rename nub object in NormalSliderBar.cs class
This commit is contained in:
parent
8840694674
commit
a630f1113f
@ -17,7 +17,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
public partial class NormalSliderBar<T> : OsuSliderBar<T>
|
||||
where T : struct, IEquatable<T>, IComparable<T>, IConvertible
|
||||
{
|
||||
protected readonly NormalNub NormalNub;
|
||||
protected readonly NormalNub Nub;
|
||||
protected readonly Box LeftBox;
|
||||
protected readonly Box RightBox;
|
||||
private readonly Container nubContainer;
|
||||
@ -93,7 +93,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
nubContainer = new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Child = NormalNub = new NormalNub
|
||||
Child = Nub = new NormalNub
|
||||
{
|
||||
Origin = Anchor.TopCentre,
|
||||
RelativePositionAxes = Axes.X,
|
||||
@ -142,7 +142,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
}
|
||||
|
||||
protected override bool ShouldHandleAsRelativeDrag(MouseDownEvent e)
|
||||
=> NormalNub.ReceivePositionalInputAt(e.ScreenSpaceMouseDownPosition);
|
||||
=> Nub.ReceivePositionalInputAt(e.ScreenSpaceMouseDownPosition);
|
||||
|
||||
protected override void OnDragEnd(DragEndEvent e)
|
||||
{
|
||||
@ -152,19 +152,19 @@ namespace osu.Game.Graphics.UserInterface
|
||||
|
||||
private void updateGlow()
|
||||
{
|
||||
NormalNub.Glowing = !Current.Disabled && (IsHovered || IsDragged);
|
||||
Nub.Glowing = !Current.Disabled && (IsHovered || IsDragged);
|
||||
}
|
||||
|
||||
protected override void UpdateAfterChildren()
|
||||
{
|
||||
base.UpdateAfterChildren();
|
||||
LeftBox.Scale = new Vector2(Math.Clamp(RangePadding + NormalNub.DrawPosition.X - NormalNub.DrawWidth / 2, 0, Math.Max(0, DrawWidth)), 1);
|
||||
RightBox.Scale = new Vector2(Math.Clamp(DrawWidth - NormalNub.DrawPosition.X - RangePadding - NormalNub.DrawWidth / 2, 0, Math.Max(0, DrawWidth)), 1);
|
||||
LeftBox.Scale = new Vector2(Math.Clamp(RangePadding + Nub.DrawPosition.X - Nub.DrawWidth / 2, 0, Math.Max(0, DrawWidth)), 1);
|
||||
RightBox.Scale = new Vector2(Math.Clamp(DrawWidth - Nub.DrawPosition.X - RangePadding - Nub.DrawWidth / 2, 0, Math.Max(0, DrawWidth)), 1);
|
||||
}
|
||||
|
||||
protected override void UpdateValue(float value)
|
||||
{
|
||||
NormalNub.MoveToX(value, 250, Easing.OutQuint);
|
||||
Nub.MoveToX(value, 250, Easing.OutQuint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
|
||||
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) =>
|
||||
base.ReceivePositionalInputAt(screenSpacePos)
|
||||
&& screenSpacePos.X <= NormalNub.ScreenSpaceDrawQuad.TopRight.X;
|
||||
&& screenSpacePos.X <= Nub.ScreenSpaceDrawQuad.TopRight.X;
|
||||
}
|
||||
|
||||
private partial class UpperBoundSlider : BoundSlider
|
||||
@ -155,7 +155,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
|
||||
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) =>
|
||||
base.ReceivePositionalInputAt(screenSpacePos)
|
||||
&& screenSpacePos.X >= NormalNub.ScreenSpaceDrawQuad.TopLeft.X;
|
||||
&& screenSpacePos.X >= Nub.ScreenSpaceDrawQuad.TopLeft.X;
|
||||
}
|
||||
|
||||
protected partial class BoundSlider : NormalSliderBar<double>
|
||||
@ -177,12 +177,12 @@ namespace osu.Game.Graphics.UserInterface
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
NormalNub.Width = NubWidth;
|
||||
RangePadding = NormalNub.Width / 2;
|
||||
Nub.Width = NubWidth;
|
||||
RangePadding = Nub.Width / 2;
|
||||
|
||||
OsuSpriteText currentDisplay;
|
||||
|
||||
NormalNub.Add(currentDisplay = new OsuSpriteText
|
||||
Nub.Add(currentDisplay = new OsuSpriteText
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
@ -203,9 +203,9 @@ namespace osu.Game.Graphics.UserInterface
|
||||
if (colourProvider == null) return;
|
||||
|
||||
AccentColour = colourProvider.Background2;
|
||||
NormalNub.AccentColour = colourProvider.Background2;
|
||||
NormalNub.GlowingAccentColour = colourProvider.Background1;
|
||||
NormalNub.GlowColour = colourProvider.Background2;
|
||||
Nub.AccentColour = colourProvider.Background2;
|
||||
Nub.GlowingAccentColour = colourProvider.Background1;
|
||||
Nub.GlowColour = colourProvider.Background2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -30,9 +30,9 @@ namespace osu.Game.Screens.Play.PlayerSettings
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
AccentColour = colours.Yellow;
|
||||
NormalNub.AccentColour = colours.Yellow;
|
||||
NormalNub.GlowingAccentColour = colours.YellowLighter;
|
||||
NormalNub.GlowColour = colours.YellowDark;
|
||||
Nub.AccentColour = colours.Yellow;
|
||||
Nub.GlowingAccentColour = colours.YellowLighter;
|
||||
Nub.GlowColour = colours.YellowDark;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user