Skip to content

Commit 6c8b84f

Browse files
authored
Merge pull request #32312 from peppy/disable-spectator-font-customisation
Disable user customisation of spectator list font / colour
2 parents 5debb1e + 3cb32c3 commit 6c8b84f

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

osu.Game.Tests/Visual/Gameplay/TestSceneSpectatorList.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ public void TestBasics()
7575
AddRepeatStep("remove random user", () => ((ISpectatorClient)spectatorClient).UserEndedWatching(
7676
spectatorClient.WatchingUsers[RNG.Next(spectatorClient.WatchingUsers.Count)].OnlineID), 5);
7777

78-
AddStep("change font to venera", () => list.Font.Value = Typeface.Venera);
79-
AddStep("change font to torus", () => list.Font.Value = Typeface.Torus);
78+
AddStep("change font to venera", () => list.HeaderFont.Value = Typeface.Venera);
79+
AddStep("change font to torus", () => list.HeaderFont.Value = Typeface.Torus);
8080
AddStep("change header colour", () => list.HeaderColour.Value = new Colour4(RNG.NextSingle(), RNG.NextSingle(), RNG.NextSingle(), 1));
8181

8282
AddStep("enter break", () => playingState.Value = LocalUserPlayingState.Break);

osu.Game/Screens/Play/HUD/SpectatorList.cs

+4-9
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,10 @@
1313
using osu.Framework.Graphics.Colour;
1414
using osu.Framework.Graphics.Containers;
1515
using osu.Framework.Graphics.Pooling;
16-
using osu.Game.Configuration;
1716
using osu.Game.Graphics;
1817
using osu.Game.Graphics.Sprites;
19-
using osu.Game.Online.Chat;
2018
using osu.Game.Localisation.HUD;
21-
using osu.Game.Localisation.SkinComponents;
19+
using osu.Game.Online.Chat;
2220
using osu.Game.Online.Multiplayer;
2321
using osu.Game.Online.Spectator;
2422
using osu.Game.Skinning;
@@ -31,10 +29,7 @@ public partial class SpectatorList : CompositeDrawable, ISerialisableDrawable
3129
{
3230
private const int max_spectators_displayed = 10;
3331

34-
[SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.Font), nameof(SkinnableComponentStrings.FontDescription))]
35-
public Bindable<Typeface> Font { get; } = new Bindable<Typeface>(Typeface.Torus);
36-
37-
[SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.TextColour), nameof(SkinnableComponentStrings.TextColourDescription))]
32+
public Bindable<Typeface> HeaderFont { get; } = new Bindable<Typeface>(Typeface.Torus);
3833
public BindableColour4 HeaderColour { get; } = new BindableColour4(Colour4.White);
3934

4035
private BindableList<SpectatorUser> watchingUsers { get; } = new BindableList<SpectatorUser>();
@@ -97,7 +92,7 @@ protected override void LoadComplete()
9792
watchingUsers.BindCollectionChanged(onSpectatorsChanged, true);
9893
userPlayingState.BindValueChanged(_ => updateVisibility());
9994

100-
Font.BindValueChanged(_ => updateAppearance());
95+
HeaderFont.BindValueChanged(_ => updateAppearance());
10196
HeaderColour.BindValueChanged(_ => updateAppearance(), true);
10297
FinishTransforms(true);
10398

@@ -198,7 +193,7 @@ private void updateVisibility()
198193

199194
private void updateAppearance()
200195
{
201-
header.Font = OsuFont.GetFont(Font.Value, 12, FontWeight.Bold);
196+
header.Font = OsuFont.GetFont(HeaderFont.Value, 12, FontWeight.Bold);
202197
header.Colour = HeaderColour.Value;
203198

204199
Width = header.DrawWidth;

osu.Game/Skinning/TrianglesSkin.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public TrianglesSkin(SkinInfo skin, IStorageResourceProvider resources)
158158

159159
if (spectatorList != null)
160160
{
161-
spectatorList.Font.Value = Typeface.Venera;
161+
spectatorList.HeaderFont.Value = Typeface.Venera;
162162
spectatorList.HeaderColour.Value = new OsuColour().BlueLighter;
163163
spectatorList.Anchor = Anchor.BottomLeft;
164164
spectatorList.Origin = Anchor.BottomLeft;

0 commit comments

Comments
 (0)