From f2e56bbb651ca0b0e3f472fb8d6bbe759002f5e2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 6 Oct 2023 16:51:24 +0900 Subject: [PATCH] Fix publicly-settable bindables --- .../Edit/DrawableManiaEditorRuleset.cs | 2 +- .../Edit/DrawableTaikoEditorRuleset.cs | 2 +- osu.Game.Tests/Mods/SettingSourceAttributeTest.cs | 12 ++++++------ osu.Game.Tournament/Models/TournamentTeam.cs | 2 +- osu.Game/Graphics/Containers/UserDimContainer.cs | 2 +- .../HUD/JudgementCounter/JudgementCounterDisplay.cs | 8 ++++---- osu.Game/Screens/Play/HUD/PlayerAvatar.cs | 2 +- osu.Game/Skinning/Components/BeatmapAttributeText.cs | 2 +- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Edit/DrawableManiaEditorRuleset.cs b/osu.Game.Rulesets.Mania/Edit/DrawableManiaEditorRuleset.cs index 7b019a2bdf..8d34373f82 100644 --- a/osu.Game.Rulesets.Mania/Edit/DrawableManiaEditorRuleset.cs +++ b/osu.Game.Rulesets.Mania/Edit/DrawableManiaEditorRuleset.cs @@ -16,7 +16,7 @@ namespace osu.Game.Rulesets.Mania.Edit { public partial class DrawableManiaEditorRuleset : DrawableManiaRuleset, ISupportConstantAlgorithmToggle { - public BindableBool ShowSpeedChanges { get; set; } = new BindableBool(); + public BindableBool ShowSpeedChanges { get; } = new BindableBool(); public new IScrollingInfo ScrollingInfo => base.ScrollingInfo; diff --git a/osu.Game.Rulesets.Taiko/Edit/DrawableTaikoEditorRuleset.cs b/osu.Game.Rulesets.Taiko/Edit/DrawableTaikoEditorRuleset.cs index 963ddec0b3..3c7a97c864 100644 --- a/osu.Game.Rulesets.Taiko/Edit/DrawableTaikoEditorRuleset.cs +++ b/osu.Game.Rulesets.Taiko/Edit/DrawableTaikoEditorRuleset.cs @@ -13,7 +13,7 @@ namespace osu.Game.Rulesets.Taiko.Edit { public partial class DrawableTaikoEditorRuleset : DrawableTaikoRuleset, ISupportConstantAlgorithmToggle { - public BindableBool ShowSpeedChanges { get; set; } = new BindableBool(); + public BindableBool ShowSpeedChanges { get; } = new BindableBool(); public DrawableTaikoEditorRuleset(Ruleset ruleset, IBeatmap beatmap, IReadOnlyList mods) : base(ruleset, beatmap, mods) diff --git a/osu.Game.Tests/Mods/SettingSourceAttributeTest.cs b/osu.Game.Tests/Mods/SettingSourceAttributeTest.cs index 5da303d3a7..83d5b66bd7 100644 --- a/osu.Game.Tests/Mods/SettingSourceAttributeTest.cs +++ b/osu.Game.Tests/Mods/SettingSourceAttributeTest.cs @@ -42,22 +42,22 @@ namespace osu.Game.Tests.Mods private class ClassWithSettings { [SettingSource("Unordered setting", "Should be last")] - public BindableFloat UnorderedSetting { get; set; } = new BindableFloat(); + public BindableFloat UnorderedSetting { get; } = new BindableFloat(); [SettingSource("Second setting", "Another description", 2)] - public BindableBool SecondSetting { get; set; } = new BindableBool(); + public BindableBool SecondSetting { get; } = new BindableBool(); [SettingSource("First setting", "A description", 1)] - public BindableDouble FirstSetting { get; set; } = new BindableDouble(); + public BindableDouble FirstSetting { get; } = new BindableDouble(); [SettingSource("Third setting", "Yet another description", 3)] - public BindableInt ThirdSetting { get; set; } = new BindableInt(); + public BindableInt ThirdSetting { get; } = new BindableInt(); } private class ClassWithCustomSettingControl { [SettingSource("Custom setting", "Should be a custom control", SettingControlType = typeof(CustomSettingsControl))] - public BindableInt UnorderedSetting { get; set; } = new BindableInt(); + public BindableInt UnorderedSetting { get; } = new BindableInt(); } private partial class CustomSettingsControl : SettingsItem @@ -66,7 +66,7 @@ namespace osu.Game.Tests.Mods private partial class CustomControl : Drawable, IHasCurrentValue { - public Bindable Current { get; set; } = new Bindable(); + public Bindable Current { get; } = new Bindable(); } } } diff --git a/osu.Game.Tournament/Models/TournamentTeam.cs b/osu.Game.Tournament/Models/TournamentTeam.cs index ae0ac77936..95858240a8 100644 --- a/osu.Game.Tournament/Models/TournamentTeam.cs +++ b/osu.Game.Tournament/Models/TournamentTeam.cs @@ -56,7 +56,7 @@ namespace osu.Game.Tournament.Models }; [JsonProperty] - public BindableList Players { get; set; } = new BindableList(); + public BindableList Players { get; } = new BindableList(); public TournamentTeam() { diff --git a/osu.Game/Graphics/Containers/UserDimContainer.cs b/osu.Game/Graphics/Containers/UserDimContainer.cs index 625702ef6e..af5e7692b3 100644 --- a/osu.Game/Graphics/Containers/UserDimContainer.cs +++ b/osu.Game/Graphics/Containers/UserDimContainer.cs @@ -47,7 +47,7 @@ namespace osu.Game.Graphics.Containers /// /// The amount of dim to be used when is true. /// - public Bindable DimWhenUserSettingsIgnored { get; set; } = new Bindable(); + public Bindable DimWhenUserSettingsIgnored { get; } = new Bindable(); protected Bindable LightenDuringBreaks { get; private set; } = null!; diff --git a/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs b/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs index 1dbee19ee3..128897ddde 100644 --- a/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs +++ b/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs @@ -22,16 +22,16 @@ namespace osu.Game.Screens.Play.HUD.JudgementCounter public bool UsesFixedAnchor { get; set; } [SettingSource(typeof(JudgementCounterDisplayStrings), nameof(JudgementCounterDisplayStrings.JudgementDisplayMode))] - public Bindable Mode { get; set; } = new Bindable(); + public Bindable Mode { get; } = new Bindable(); [SettingSource(typeof(JudgementCounterDisplayStrings), nameof(JudgementCounterDisplayStrings.FlowDirection))] - public Bindable FlowDirection { get; set; } = new Bindable(); + public Bindable FlowDirection { get; } = new Bindable(); [SettingSource(typeof(JudgementCounterDisplayStrings), nameof(JudgementCounterDisplayStrings.ShowJudgementNames))] - public BindableBool ShowJudgementNames { get; set; } = new BindableBool(true); + public BindableBool ShowJudgementNames { get; } = new BindableBool(true); [SettingSource(typeof(JudgementCounterDisplayStrings), nameof(JudgementCounterDisplayStrings.ShowMaxJudgement))] - public BindableBool ShowMaxJudgement { get; set; } = new BindableBool(true); + public BindableBool ShowMaxJudgement { get; } = new BindableBool(true); [Resolved] private JudgementCountController judgementCountController { get; set; } = null!; diff --git a/osu.Game/Screens/Play/HUD/PlayerAvatar.cs b/osu.Game/Screens/Play/HUD/PlayerAvatar.cs index 1d0331593a..1341a10d60 100644 --- a/osu.Game/Screens/Play/HUD/PlayerAvatar.cs +++ b/osu.Game/Screens/Play/HUD/PlayerAvatar.cs @@ -18,7 +18,7 @@ namespace osu.Game.Screens.Play.HUD { [SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.CornerRadius), nameof(SkinnableComponentStrings.CornerRadiusDescription), SettingControlType = typeof(SettingsPercentageSlider))] - public new BindableFloat CornerRadius { get; set; } = new BindableFloat(0.25f) + public new BindableFloat CornerRadius { get; } = new BindableFloat(0.25f) { MinValue = 0, MaxValue = 0.5f, diff --git a/osu.Game/Skinning/Components/BeatmapAttributeText.cs b/osu.Game/Skinning/Components/BeatmapAttributeText.cs index 6523039a3f..52c439a624 100644 --- a/osu.Game/Skinning/Components/BeatmapAttributeText.cs +++ b/osu.Game/Skinning/Components/BeatmapAttributeText.cs @@ -30,7 +30,7 @@ namespace osu.Game.Skinning.Components public Bindable Attribute { get; } = new Bindable(BeatmapAttribute.StarRating); [SettingSource(typeof(BeatmapAttributeTextStrings), nameof(BeatmapAttributeTextStrings.Template), nameof(BeatmapAttributeTextStrings.TemplateDescription))] - public Bindable Template { get; set; } = new Bindable("{Label}: {Value}"); + public Bindable Template { get; } = new Bindable("{Label}: {Value}"); [Resolved] private IBindable beatmap { get; set; } = null!;