From 535282ba7d90303058c429c564c9d473afaf8e99 Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Tue, 14 Nov 2023 14:13:20 -0800 Subject: [PATCH 1/3] Use existing localisation for corner radius in `BoxElement` --- osu.Game/Skinning/Components/BoxElement.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/osu.Game/Skinning/Components/BoxElement.cs b/osu.Game/Skinning/Components/BoxElement.cs index 235f97ceef..f4f913d80a 100644 --- a/osu.Game/Skinning/Components/BoxElement.cs +++ b/osu.Game/Skinning/Components/BoxElement.cs @@ -7,6 +7,8 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Game.Configuration; +using osu.Game.Localisation.SkinComponents; +using osu.Game.Overlays.Settings; using osuTK; using osuTK.Graphics; @@ -16,7 +18,8 @@ namespace osu.Game.Skinning.Components { public bool UsesFixedAnchor { get; set; } - [SettingSource("Corner rounding", "How round the corners of the box should be.")] + [SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.CornerRadius), nameof(SkinnableComponentStrings.CornerRadiusDescription), + SettingControlType = typeof(SettingsPercentageSlider))] public BindableFloat CornerRounding { get; } = new BindableFloat(1) { Precision = 0.01f, From 74fb1b5f81475121af75072367759a241aa4db38 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 15 Nov 2023 10:40:59 +0900 Subject: [PATCH 2/3] Rename property to match expctations --- osu.Game/Skinning/Components/BoxElement.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Skinning/Components/BoxElement.cs b/osu.Game/Skinning/Components/BoxElement.cs index f4f913d80a..8b556418d2 100644 --- a/osu.Game/Skinning/Components/BoxElement.cs +++ b/osu.Game/Skinning/Components/BoxElement.cs @@ -20,7 +20,7 @@ namespace osu.Game.Skinning.Components [SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.CornerRadius), nameof(SkinnableComponentStrings.CornerRadiusDescription), SettingControlType = typeof(SettingsPercentageSlider))] - public BindableFloat CornerRounding { get; } = new BindableFloat(1) + public new BindableFloat CornerRadius { get; } = new BindableFloat(1) { Precision = 0.01f, MinValue = 0, @@ -47,7 +47,7 @@ namespace osu.Game.Skinning.Components { base.Update(); - CornerRadius = CornerRounding.Value * Math.Min(DrawWidth, DrawHeight) * 0.5f; + base.CornerRadius = CornerRadius.Value * Math.Min(DrawWidth, DrawHeight) * 0.5f; } } } From 2264e1e2493b69d0455f57639e60e3e2e10f7e96 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 15 Nov 2023 10:45:01 +0900 Subject: [PATCH 3/3] Change default value and range of `BoxElement`'s corner radius to match other usages --- osu.Game/Skinning/ArgonSkin.cs | 5 ++++- osu.Game/Skinning/Components/BoxElement.cs | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/osu.Game/Skinning/ArgonSkin.cs b/osu.Game/Skinning/ArgonSkin.cs index 226de4088c..4588c62b0f 100644 --- a/osu.Game/Skinning/ArgonSkin.cs +++ b/osu.Game/Skinning/ArgonSkin.cs @@ -216,7 +216,10 @@ namespace osu.Game.Skinning }, new ArgonScoreCounter(), new ArgonHealthDisplay(), - new BoxElement(), + new BoxElement + { + CornerRadius = { Value = 0.5f } + }, new ArgonAccuracyCounter(), new ArgonComboCounter { diff --git a/osu.Game/Skinning/Components/BoxElement.cs b/osu.Game/Skinning/Components/BoxElement.cs index 8b556418d2..34d389728c 100644 --- a/osu.Game/Skinning/Components/BoxElement.cs +++ b/osu.Game/Skinning/Components/BoxElement.cs @@ -20,11 +20,11 @@ namespace osu.Game.Skinning.Components [SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.CornerRadius), nameof(SkinnableComponentStrings.CornerRadiusDescription), SettingControlType = typeof(SettingsPercentageSlider))] - public new BindableFloat CornerRadius { get; } = new BindableFloat(1) + public new BindableFloat CornerRadius { get; } = new BindableFloat(0.25f) { - Precision = 0.01f, MinValue = 0, - MaxValue = 1, + MaxValue = 0.5f, + Precision = 0.01f }; public BoxElement() @@ -47,7 +47,7 @@ namespace osu.Game.Skinning.Components { base.Update(); - base.CornerRadius = CornerRadius.Value * Math.Min(DrawWidth, DrawHeight) * 0.5f; + base.CornerRadius = CornerRadius.Value * Math.Min(DrawWidth, DrawHeight); } } }