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