1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-21 19:23:20 +08:00

Remove ability to set arbitrary accent colours

This commit is contained in:
smoogipoo 2019-06-27 15:02:26 +09:00
parent 7f5587d894
commit b397652af4
3 changed files with 10 additions and 28 deletions

View File

@ -2,9 +2,7 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.MathUtils;
using osu.Game.Overlays.Profile.Header.Components; using osu.Game.Overlays.Profile.Header.Components;
using osuTK.Graphics;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using osu.Game.Rulesets.Catch; using osu.Game.Rulesets.Catch;
@ -37,8 +35,6 @@ namespace osu.Game.Tests.Visual.Online
AddStep("set taiko as default", () => selector.SetDefaultRuleset(new TaikoRuleset().RulesetInfo)); AddStep("set taiko as default", () => selector.SetDefaultRuleset(new TaikoRuleset().RulesetInfo));
AddStep("set catch as default", () => selector.SetDefaultRuleset(new CatchRuleset().RulesetInfo)); AddStep("set catch as default", () => selector.SetDefaultRuleset(new CatchRuleset().RulesetInfo));
AddStep("select default ruleset", selector.SelectDefaultRuleset); AddStep("select default ruleset", selector.SelectDefaultRuleset);
AddStep("set random colour", () => selector.AccentColour = new Color4(RNG.NextSingle(), RNG.NextSingle(), RNG.NextSingle(), 1));
} }
} }
} }

View File

@ -16,23 +16,6 @@ namespace osu.Game.Overlays.Profile.Header.Components
{ {
private Color4 accentColour = Color4.White; private Color4 accentColour = Color4.White;
public Color4 AccentColour
{
get => accentColour;
set
{
if (accentColour == value)
return;
accentColour = value;
foreach (TabItem<RulesetInfo> tabItem in TabContainer)
{
((ProfileRulesetTabItem)tabItem).AccentColour = value;
}
}
}
public ProfileRulesetSelector() public ProfileRulesetSelector()
{ {
TabContainer.Masking = false; TabContainer.Masking = false;
@ -43,13 +26,11 @@ namespace osu.Game.Overlays.Profile.Header.Components
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OsuColour colours)
{ {
AccentColour = colours.Seafoam; accentColour = colours.Seafoam;
}
protected override TabItem<RulesetInfo> CreateTabItem(RulesetInfo value) => new ProfileRulesetTabItem(value) foreach (TabItem<RulesetInfo> tabItem in TabContainer)
{ ((ProfileRulesetTabItem)tabItem).AccentColour = accentColour;
AccentColour = AccentColour }
};
public void SetDefaultRuleset(RulesetInfo ruleset) public void SetDefaultRuleset(RulesetInfo ruleset)
{ {
@ -71,6 +52,11 @@ namespace osu.Game.Overlays.Profile.Header.Components
} }
} }
protected override TabItem<RulesetInfo> CreateTabItem(RulesetInfo value) => new ProfileRulesetTabItem(value)
{
AccentColour = accentColour
};
protected override TabFillFlowContainer CreateTabFlow() => new TabFillFlowContainer protected override TabFillFlowContainer CreateTabFlow() => new TabFillFlowContainer
{ {
Direction = FillDirection.Horizontal, Direction = FillDirection.Horizontal,

View File

@ -15,7 +15,7 @@ using osuTK.Graphics;
namespace osu.Game.Overlays.Profile.Header.Components namespace osu.Game.Overlays.Profile.Header.Components
{ {
public class ProfileRulesetTabItem : TabItem<RulesetInfo> public class ProfileRulesetTabItem : TabItem<RulesetInfo>, IHasAccentColour
{ {
private readonly OsuSpriteText text; private readonly OsuSpriteText text;
private readonly SpriteIcon icon; private readonly SpriteIcon icon;