diff --git a/osu.Game.Tests/Visual/UserInterface/TestSceneRangeSlider.cs b/osu.Game.Tests/Visual/UserInterface/TestSceneRangeSlider.cs index b780764e7f..0100b2a1a0 100644 --- a/osu.Game.Tests/Visual/UserInterface/TestSceneRangeSlider.cs +++ b/osu.Game.Tests/Visual/UserInterface/TestSceneRangeSlider.cs @@ -45,7 +45,7 @@ namespace osu.Game.Tests.Visual.UserInterface LowerBound = customStart, UpperBound = customEnd, TooltipSuffix = "suffix", - NubWidth = Nub.HEIGHT * 2, + NubWidth = NormalNub.HEIGHT * 2, DefaultStringLowerBound = "Start", DefaultStringUpperBound = "End", MinRange = 10 diff --git a/osu.Game/Graphics/UserInterface/Nub.cs b/osu.Game/Graphics/UserInterface/NormalNub.cs similarity index 97% rename from osu.Game/Graphics/UserInterface/Nub.cs rename to osu.Game/Graphics/UserInterface/NormalNub.cs index 7921dcf593..549b3ffa04 100644 --- a/osu.Game/Graphics/UserInterface/Nub.cs +++ b/osu.Game/Graphics/UserInterface/NormalNub.cs @@ -19,7 +19,7 @@ using osu.Game.Overlays; namespace osu.Game.Graphics.UserInterface { - public partial class Nub : Container, IHasCurrentValue, IHasAccentColour + public partial class NormalNub : Container, IHasCurrentValue, IHasAccentColour { public const float HEIGHT = 15; @@ -30,7 +30,7 @@ namespace osu.Game.Graphics.UserInterface private readonly Box fill; private readonly Container main; - public Nub() + public NormalNub() { Size = new Vector2(EXPANDED_SIZE, HEIGHT); diff --git a/osu.Game/Graphics/UserInterface/NormalSliderBar.cs b/osu.Game/Graphics/UserInterface/NormalSliderBar.cs index 92febaa6e6..bc27c9af4c 100644 --- a/osu.Game/Graphics/UserInterface/NormalSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/NormalSliderBar.cs @@ -17,7 +17,7 @@ namespace osu.Game.Graphics.UserInterface public partial class NormalSliderBar : OsuSliderBar where T : struct, IEquatable, IComparable, IConvertible { - protected readonly Nub Nub; + protected readonly NormalNub NormalNub; protected readonly Box LeftBox; protected readonly Box RightBox; private readonly Container nubContainer; @@ -50,8 +50,8 @@ namespace osu.Game.Graphics.UserInterface public NormalSliderBar() { - Height = Nub.HEIGHT; - RangePadding = Nub.EXPANDED_SIZE / 2; + Height = NormalNub.HEIGHT; + RangePadding = NormalNub.EXPANDED_SIZE / 2; Children = new Drawable[] { new Container @@ -93,7 +93,7 @@ namespace osu.Game.Graphics.UserInterface nubContainer = new Container { RelativeSizeAxes = Axes.Both, - Child = Nub = new Nub + Child = NormalNub = new NormalNub { Origin = Anchor.TopCentre, RelativePositionAxes = Axes.X, @@ -142,7 +142,7 @@ namespace osu.Game.Graphics.UserInterface } protected override bool ShouldHandleAsRelativeDrag(MouseDownEvent e) - => Nub.ReceivePositionalInputAt(e.ScreenSpaceMouseDownPosition); + => NormalNub.ReceivePositionalInputAt(e.ScreenSpaceMouseDownPosition); protected override void OnDragEnd(DragEndEvent e) { @@ -152,19 +152,19 @@ namespace osu.Game.Graphics.UserInterface private void updateGlow() { - Nub.Glowing = !Current.Disabled && (IsHovered || IsDragged); + NormalNub.Glowing = !Current.Disabled && (IsHovered || IsDragged); } protected override void UpdateAfterChildren() { base.UpdateAfterChildren(); - 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); + 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); } protected override void UpdateValue(float value) { - Nub.MoveToX(value, 250, Easing.OutQuint); + NormalNub.MoveToX(value, 250, Easing.OutQuint); } } } diff --git a/osu.Game/Graphics/UserInterface/OsuCheckbox.cs b/osu.Game/Graphics/UserInterface/OsuCheckbox.cs index 160105af1a..982706f87b 100644 --- a/osu.Game/Graphics/UserInterface/OsuCheckbox.cs +++ b/osu.Game/Graphics/UserInterface/OsuCheckbox.cs @@ -41,7 +41,7 @@ namespace osu.Game.Graphics.UserInterface } } - protected readonly Nub Nub; + protected readonly NormalNub NormalNub; protected readonly OsuTextFlowContainer LabelTextFlowContainer; private Sample sampleChecked; @@ -61,28 +61,28 @@ namespace osu.Game.Graphics.UserInterface AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, }, - Nub = new Nub(), + NormalNub = new NormalNub(), new HoverSounds() }; if (nubOnRight) { - Nub.Anchor = Anchor.CentreRight; - Nub.Origin = Anchor.CentreRight; - Nub.Margin = new MarginPadding { Right = nub_padding }; - LabelTextFlowContainer.Padding = new MarginPadding { Right = Nub.EXPANDED_SIZE + nub_padding * 2 }; + NormalNub.Anchor = Anchor.CentreRight; + NormalNub.Origin = Anchor.CentreRight; + NormalNub.Margin = new MarginPadding { Right = nub_padding }; + LabelTextFlowContainer.Padding = new MarginPadding { Right = NormalNub.EXPANDED_SIZE + nub_padding * 2 }; } else { - Nub.Anchor = Anchor.CentreLeft; - Nub.Origin = Anchor.CentreLeft; - Nub.Margin = new MarginPadding { Left = nub_padding }; - LabelTextFlowContainer.Padding = new MarginPadding { Left = Nub.EXPANDED_SIZE + nub_padding * 2 }; + NormalNub.Anchor = Anchor.CentreLeft; + NormalNub.Origin = Anchor.CentreLeft; + NormalNub.Margin = new MarginPadding { Left = nub_padding }; + LabelTextFlowContainer.Padding = new MarginPadding { Left = NormalNub.EXPANDED_SIZE + nub_padding * 2 }; } - Nub.Current.BindTo(Current); + NormalNub.Current.BindTo(Current); - Current.DisabledChanged += disabled => LabelTextFlowContainer.Alpha = Nub.Alpha = disabled ? 0.3f : 1; + Current.DisabledChanged += disabled => LabelTextFlowContainer.Alpha = NormalNub.Alpha = disabled ? 0.3f : 1; } /// @@ -101,13 +101,13 @@ namespace osu.Game.Graphics.UserInterface protected override bool OnHover(HoverEvent e) { - Nub.Glowing = true; + NormalNub.Glowing = true; return base.OnHover(e); } protected override void OnHoverLost(HoverLostEvent e) { - Nub.Glowing = false; + NormalNub.Glowing = false; base.OnHoverLost(e); } diff --git a/osu.Game/Graphics/UserInterface/RangeSlider.cs b/osu.Game/Graphics/UserInterface/RangeSlider.cs index 2f3dc07a91..963c859198 100644 --- a/osu.Game/Graphics/UserInterface/RangeSlider.cs +++ b/osu.Game/Graphics/UserInterface/RangeSlider.cs @@ -141,7 +141,7 @@ namespace osu.Game.Graphics.UserInterface public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => base.ReceivePositionalInputAt(screenSpacePos) - && screenSpacePos.X <= Nub.ScreenSpaceDrawQuad.TopRight.X; + && screenSpacePos.X <= NormalNub.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 >= Nub.ScreenSpaceDrawQuad.TopLeft.X; + && screenSpacePos.X >= NormalNub.ScreenSpaceDrawQuad.TopLeft.X; } protected partial class BoundSlider : NormalSliderBar @@ -163,7 +163,7 @@ namespace osu.Game.Graphics.UserInterface public string? DefaultString; public LocalisableString? DefaultTooltip; public string? TooltipSuffix; - public float NubWidth { get; set; } = Nub.HEIGHT; + public float NubWidth { get; set; } = NormalNub.HEIGHT; public override LocalisableString TooltipText => (Current.IsDefault ? DefaultTooltip : Current.Value.ToString($@"0.## {TooltipSuffix}")) ?? Current.Value.ToString($@"0.## {TooltipSuffix}"); @@ -177,12 +177,12 @@ namespace osu.Game.Graphics.UserInterface protected override void LoadComplete() { base.LoadComplete(); - Nub.Width = NubWidth; - RangePadding = Nub.Width / 2; + NormalNub.Width = NubWidth; + RangePadding = NormalNub.Width / 2; OsuSpriteText currentDisplay; - Nub.Add(currentDisplay = new OsuSpriteText + NormalNub.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; - Nub.AccentColour = colourProvider.Background2; - Nub.GlowingAccentColour = colourProvider.Background1; - Nub.GlowColour = colourProvider.Background2; + NormalNub.AccentColour = colourProvider.Background2; + NormalNub.GlowingAccentColour = colourProvider.Background1; + NormalNub.GlowColour = colourProvider.Background2; } } } diff --git a/osu.Game/Graphics/UserInterfaceV2/OsuDirectorySelectorHiddenToggle.cs b/osu.Game/Graphics/UserInterfaceV2/OsuDirectorySelectorHiddenToggle.cs index 7665ed507f..79f72495c8 100644 --- a/osu.Game/Graphics/UserInterfaceV2/OsuDirectorySelectorHiddenToggle.cs +++ b/osu.Game/Graphics/UserInterfaceV2/OsuDirectorySelectorHiddenToggle.cs @@ -30,9 +30,9 @@ namespace osu.Game.Graphics.UserInterfaceV2 if (overlayColourProvider != null) return; - Nub.AccentColour = colours.GreySeaFoamLighter; - Nub.GlowingAccentColour = Color4.White; - Nub.GlowColour = Color4.White; + NormalNub.AccentColour = colours.GreySeaFoamLighter; + NormalNub.GlowingAccentColour = Color4.White; + NormalNub.GlowColour = Color4.White; } } } diff --git a/osu.Game/Overlays/Mods/ModColumn.cs b/osu.Game/Overlays/Mods/ModColumn.cs index 5d9f616e5f..97a766259a 100644 --- a/osu.Game/Overlays/Mods/ModColumn.cs +++ b/osu.Game/Overlays/Mods/ModColumn.cs @@ -267,9 +267,9 @@ namespace osu.Game.Overlays.Mods private void updateState() { - Nub.AccentColour = AccentColour; - Nub.GlowingAccentColour = AccentHoverColour; - Nub.GlowColour = AccentHoverColour.Opacity(0.2f); + NormalNub.AccentColour = AccentColour; + NormalNub.GlowingAccentColour = AccentHoverColour; + NormalNub.GlowColour = AccentHoverColour.Opacity(0.2f); } protected override void OnUserChange(bool value) diff --git a/osu.Game/Screens/Play/PlayerSettings/PlayerCheckbox.cs b/osu.Game/Screens/Play/PlayerSettings/PlayerCheckbox.cs index 49c9cbf385..960904282d 100644 --- a/osu.Game/Screens/Play/PlayerSettings/PlayerCheckbox.cs +++ b/osu.Game/Screens/Play/PlayerSettings/PlayerCheckbox.cs @@ -18,9 +18,9 @@ namespace osu.Game.Screens.Play.PlayerSettings [BackgroundDependencyLoader] private void load(OsuColour colours) { - Nub.AccentColour = colours.Yellow; - Nub.GlowingAccentColour = colours.YellowLighter; - Nub.GlowColour = colours.YellowDark; + NormalNub.AccentColour = colours.Yellow; + NormalNub.GlowingAccentColour = colours.YellowLighter; + NormalNub.GlowColour = colours.YellowDark; } } } diff --git a/osu.Game/Screens/Play/PlayerSettings/PlayerSliderBar.cs b/osu.Game/Screens/Play/PlayerSettings/PlayerSliderBar.cs index 985a414bc0..b54207886e 100644 --- a/osu.Game/Screens/Play/PlayerSettings/PlayerSliderBar.cs +++ b/osu.Game/Screens/Play/PlayerSettings/PlayerSliderBar.cs @@ -30,9 +30,9 @@ namespace osu.Game.Screens.Play.PlayerSettings private void load(OsuColour colours) { AccentColour = colours.Yellow; - Nub.AccentColour = colours.Yellow; - Nub.GlowingAccentColour = colours.YellowLighter; - Nub.GlowColour = colours.YellowDark; + NormalNub.AccentColour = colours.Yellow; + NormalNub.GlowingAccentColour = colours.YellowLighter; + NormalNub.GlowColour = colours.YellowDark; } } }