From 923f9fb6cdb1b2480420c43448ff048596023ffe Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Fri, 7 Jun 2019 01:43:26 +0300 Subject: [PATCH] Naming adjustments --- .../Visual/Online/TestSceneGamemodeControl.cs | 40 ------------------- .../Online/TestSceneProfileRulesetSelector.cs | 40 +++++++++++++++++++ ...deControl.cs => ProfileRulesetSelector.cs} | 14 +++---- .../{GamemodeTabItem.cs => RulesetTabItem.cs} | 4 +- osu.Game/Overlays/UserProfileOverlay.cs | 10 ++--- 5 files changed, 54 insertions(+), 54 deletions(-) delete mode 100644 osu.Game.Tests/Visual/Online/TestSceneGamemodeControl.cs create mode 100644 osu.Game.Tests/Visual/Online/TestSceneProfileRulesetSelector.cs rename osu.Game/Overlays/Profile/Header/Components/{GamemodeControl.cs => ProfileRulesetSelector.cs} (82%) rename osu.Game/Overlays/Profile/Header/Components/{GamemodeTabItem.cs => RulesetTabItem.cs} (97%) diff --git a/osu.Game.Tests/Visual/Online/TestSceneGamemodeControl.cs b/osu.Game.Tests/Visual/Online/TestSceneGamemodeControl.cs deleted file mode 100644 index a2a75566d5..0000000000 --- a/osu.Game.Tests/Visual/Online/TestSceneGamemodeControl.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. -// See the LICENCE file in the repository root for full licence text. - -using osu.Framework.Graphics; -using osu.Framework.MathUtils; -using osu.Game.Overlays.Profile.Header.Components; -using osuTK.Graphics; -using System; -using System.Collections.Generic; - -namespace osu.Game.Tests.Visual.Online -{ - public class TestSceneGamemodeControl : OsuTestScene - { - public override IReadOnlyList RequiredTypes => new[] - { - typeof(GamemodeControl), - typeof(GamemodeTabItem), - }; - - public TestSceneGamemodeControl() - { - GamemodeControl control; - - Child = control = new GamemodeControl - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - }; - - AddStep("set osu! as default", () => control.SetDefaultGamemode("osu")); - AddStep("set mania as default", () => control.SetDefaultGamemode("mania")); - AddStep("set taiko as default", () => control.SetDefaultGamemode("taiko")); - AddStep("set catch as default", () => control.SetDefaultGamemode("fruits")); - AddStep("select default gamemode", control.SelectDefaultGamemode); - - AddStep("set random colour", () => control.AccentColour = new Color4(RNG.NextSingle(), RNG.NextSingle(), RNG.NextSingle(), 1)); - } - } -} diff --git a/osu.Game.Tests/Visual/Online/TestSceneProfileRulesetSelector.cs b/osu.Game.Tests/Visual/Online/TestSceneProfileRulesetSelector.cs new file mode 100644 index 0000000000..687cbbebad --- /dev/null +++ b/osu.Game.Tests/Visual/Online/TestSceneProfileRulesetSelector.cs @@ -0,0 +1,40 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Graphics; +using osu.Framework.MathUtils; +using osu.Game.Overlays.Profile.Header.Components; +using osuTK.Graphics; +using System; +using System.Collections.Generic; + +namespace osu.Game.Tests.Visual.Online +{ + public class TestSceneProfileRulesetSelector : OsuTestScene + { + public override IReadOnlyList RequiredTypes => new[] + { + typeof(ProfileRulesetSelector), + typeof(RulesetTabItem), + }; + + public TestSceneProfileRulesetSelector() + { + ProfileRulesetSelector selector; + + Child = selector = new ProfileRulesetSelector + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + }; + + AddStep("set osu! as default", () => selector.SetDefaultGamemode("osu")); + AddStep("set mania as default", () => selector.SetDefaultGamemode("mania")); + AddStep("set taiko as default", () => selector.SetDefaultGamemode("taiko")); + AddStep("set catch as default", () => selector.SetDefaultGamemode("fruits")); + AddStep("select default gamemode", selector.SelectDefaultGamemode); + + AddStep("set random colour", () => selector.AccentColour = new Color4(RNG.NextSingle(), RNG.NextSingle(), RNG.NextSingle(), 1)); + } + } +} diff --git a/osu.Game/Overlays/Profile/Header/Components/GamemodeControl.cs b/osu.Game/Overlays/Profile/Header/Components/ProfileRulesetSelector.cs similarity index 82% rename from osu.Game/Overlays/Profile/Header/Components/GamemodeControl.cs rename to osu.Game/Overlays/Profile/Header/Components/ProfileRulesetSelector.cs index 56f84741f3..b189878b0d 100644 --- a/osu.Game/Overlays/Profile/Header/Components/GamemodeControl.cs +++ b/osu.Game/Overlays/Profile/Header/Components/ProfileRulesetSelector.cs @@ -12,11 +12,11 @@ using osuTK.Graphics; namespace osu.Game.Overlays.Profile.Header.Components { - public class GamemodeControl : TabControl + public class ProfileRulesetSelector : TabControl { protected override Dropdown CreateDropdown() => null; - protected override TabItem CreateTabItem(RulesetInfo value) => new GamemodeTabItem(value) + protected override TabItem CreateTabItem(RulesetInfo value) => new RulesetTabItem(value) { AccentColour = AccentColour }; @@ -35,12 +35,12 @@ namespace osu.Game.Overlays.Profile.Header.Components foreach (TabItem tabItem in TabContainer) { - ((GamemodeTabItem)tabItem).AccentColour = value; + ((RulesetTabItem)tabItem).AccentColour = value; } } } - public GamemodeControl() + public ProfileRulesetSelector() { TabContainer.Masking = false; TabContainer.Spacing = new Vector2(10, 0); @@ -62,7 +62,7 @@ namespace osu.Game.Overlays.Profile.Header.Components { foreach (TabItem tabItem in TabContainer) { - ((GamemodeTabItem)tabItem).IsDefault = ((GamemodeTabItem)tabItem).Value.ShortName == gamemode; + ((RulesetTabItem)tabItem).IsDefault = ((RulesetTabItem)tabItem).Value.ShortName == gamemode; } } @@ -70,9 +70,9 @@ namespace osu.Game.Overlays.Profile.Header.Components { foreach (TabItem tabItem in TabContainer) { - if (((GamemodeTabItem)tabItem).IsDefault) + if (((RulesetTabItem)tabItem).IsDefault) { - Current.Value = ((GamemodeTabItem)tabItem).Value; + Current.Value = ((RulesetTabItem)tabItem).Value; return; } } diff --git a/osu.Game/Overlays/Profile/Header/Components/GamemodeTabItem.cs b/osu.Game/Overlays/Profile/Header/Components/RulesetTabItem.cs similarity index 97% rename from osu.Game/Overlays/Profile/Header/Components/GamemodeTabItem.cs rename to osu.Game/Overlays/Profile/Header/Components/RulesetTabItem.cs index 688109ad2f..0a6f2f5123 100644 --- a/osu.Game/Overlays/Profile/Header/Components/GamemodeTabItem.cs +++ b/osu.Game/Overlays/Profile/Header/Components/RulesetTabItem.cs @@ -15,7 +15,7 @@ using osuTK.Graphics; namespace osu.Game.Overlays.Profile.Header.Components { - public class GamemodeTabItem : TabItem + public class RulesetTabItem : TabItem { private readonly OsuSpriteText text; private readonly SpriteIcon icon; @@ -52,7 +52,7 @@ namespace osu.Game.Overlays.Profile.Header.Components } } - public GamemodeTabItem(RulesetInfo value) + public RulesetTabItem(RulesetInfo value) : base(value) { AutoSizeAxes = Axes.Both; diff --git a/osu.Game/Overlays/UserProfileOverlay.cs b/osu.Game/Overlays/UserProfileOverlay.cs index 1d8775ad04..ec81193896 100644 --- a/osu.Game/Overlays/UserProfileOverlay.cs +++ b/osu.Game/Overlays/UserProfileOverlay.cs @@ -26,7 +26,7 @@ namespace osu.Game.Overlays protected ProfileHeader Header; private SectionsContainer sectionsContainer; private ProfileTabControl tabs; - private GamemodeControl gamemodeControl; + private ProfileRulesetSelector rulesetSelector; public const float CONTENT_X_MARGIN = 70; @@ -122,7 +122,7 @@ namespace osu.Game.Overlays sectionsContainer.ScrollToTop(); - Header.Add(gamemodeControl = new GamemodeControl + Header.Add(rulesetSelector = new ProfileRulesetSelector { Alpha = 0, Anchor = Anchor.TopRight, @@ -152,10 +152,10 @@ namespace osu.Game.Overlays } } - gamemodeControl.SetDefaultGamemode(user.PlayMode ?? "osu"); - gamemodeControl.SelectDefaultGamemode(); + rulesetSelector.SetDefaultGamemode(user.PlayMode ?? "osu"); + rulesetSelector.SelectDefaultGamemode(); - gamemodeControl.FadeInFromZero(100, Easing.OutQuint); + rulesetSelector.FadeInFromZero(100, Easing.OutQuint); } private class ProfileTabControl : PageTabControl