Merge branch 'master' into consolidate-loader-testcase

This commit is contained in:
Dean Herbert
2019-05-21 15:12:44 +09:00
committed by GitHub
24 changed files with 39 additions and 60 deletions

View File

@ -11,10 +11,10 @@ using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Beatmaps.ControlPoints; using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Rulesets.Mania.Objects; using osu.Game.Rulesets.Mania.Objects;
using osu.Game.Rulesets.Mania.Objects.Drawables; using osu.Game.Rulesets.Mania.Objects.Drawables;
using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Objects.Drawables;
@ -138,7 +138,7 @@ namespace osu.Game.Rulesets.Mania.Tests
content = new Container { RelativeSizeAxes = Axes.Both } content = new Container { RelativeSizeAxes = Axes.Both }
} }
}, },
new SpriteText new OsuSpriteText
{ {
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre, Origin = Anchor.TopCentre,

View File

@ -9,7 +9,6 @@ using NUnit.Framework;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Input.Events; using osu.Framework.Input.Events;
using osu.Framework.Input.States; using osu.Framework.Input.States;
using osu.Framework.Platform; using osu.Framework.Platform;
@ -19,6 +18,7 @@ using osu.Game.Configuration;
using osu.Game.Database; using osu.Game.Database;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites;
using osu.Game.Rulesets; using osu.Game.Rulesets;
using osu.Game.Rulesets.Osu.Mods; using osu.Game.Rulesets.Osu.Mods;
using osu.Game.Scoring; using osu.Game.Scoring;
@ -240,7 +240,7 @@ namespace osu.Game.Tests.Visual.Background
{ {
player.StoryboardEnabled.Value = false; player.StoryboardEnabled.Value = false;
player.ReplacesBackground.Value = false; player.ReplacesBackground.Value = false;
player.CurrentStoryboardContainer.Add(new SpriteText player.CurrentStoryboardContainer.Add(new OsuSpriteText
{ {
Size = new Vector2(250, 50), Size = new Vector2(250, 50),
Alpha = 1, Alpha = 1,

View File

@ -5,6 +5,7 @@ using NUnit.Framework;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.MathUtils; using osu.Framework.MathUtils;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Screens.Play.HUD; using osu.Game.Screens.Play.HUD;
using osuTK; using osuTK;
@ -53,7 +54,7 @@ namespace osu.Game.Tests.Visual.Gameplay
}; };
Add(stars); Add(stars);
SpriteText starsLabel = new SpriteText SpriteText starsLabel = new OsuSpriteText
{ {
Origin = Anchor.BottomLeft, Origin = Anchor.BottomLeft,
Anchor = Anchor.BottomLeft, Anchor = Anchor.BottomLeft,

View File

@ -7,9 +7,9 @@ using osu.Framework.Audio.Sample;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures; using osu.Framework.Graphics.Textures;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Skinning; using osu.Game.Skinning;
using osuTK.Graphics; using osuTK.Graphics;
@ -76,7 +76,7 @@ namespace osu.Game.Tests.Visual.Gameplay
Colour = Color4.Black, Colour = Color4.Black,
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
}, },
new SpriteText new OsuSpriteText
{ {
Font = OsuFont.Default.With(size: 40), Font = OsuFont.Default.With(size: 40),
Anchor = Anchor.Centre, Anchor = Anchor.Centre,

View File

@ -10,6 +10,7 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.MathUtils; using osu.Framework.MathUtils;
using osu.Game.Graphics.Sprites;
using osu.Game.Online.Chat; using osu.Game.Online.Chat;
using osu.Game.Overlays.Chat.Tabs; using osu.Game.Overlays.Chat.Tabs;
using osu.Game.Users; using osu.Game.Users;
@ -61,7 +62,7 @@ namespace osu.Game.Tests.Visual.Online
Anchor = Anchor.TopLeft, Anchor = Anchor.TopLeft,
Children = new Drawable[] Children = new Drawable[]
{ {
currentText = new SpriteText currentText = new OsuSpriteText
{ {
Text = "Currently selected channel:" Text = "Currently selected channel:"
} }

View File

@ -4,9 +4,9 @@
using NUnit.Framework; using NUnit.Framework;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Screens; using osu.Framework.Screens;
using osu.Framework.Testing; using osu.Framework.Testing;
using osu.Game.Graphics.Sprites;
using osu.Game.Screens; using osu.Game.Screens;
using osu.Game.Screens.Play; using osu.Game.Screens.Play;
using osuTK.Graphics; using osuTK.Graphics;
@ -54,7 +54,7 @@ namespace osu.Game.Tests.Visual
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
{ {
AddInternal(new SpriteText AddInternal(new OsuSpriteText
{ {
Text = screenText, Text = screenText,
Colour = Color4.White, Colour = Color4.White,

View File

@ -9,6 +9,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.MathUtils; using osu.Framework.MathUtils;
using osu.Game.Graphics.Sprites;
using osu.Game.Overlays; using osu.Game.Overlays;
using osu.Game.Overlays.Notifications; using osu.Game.Overlays.Notifications;
@ -40,7 +41,7 @@ namespace osu.Game.Tests.Visual.UserInterface
Origin = Anchor.TopRight Origin = Anchor.TopRight
}); });
SpriteText displayedCount = new SpriteText(); SpriteText displayedCount = new OsuSpriteText();
Content.Add(displayedCount); Content.Add(displayedCount);

View File

@ -4,11 +4,12 @@
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Cursor;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
namespace osu.Game.Graphics.Containers namespace osu.Game.Graphics.Containers
{ {
public class OsuClickableContainer : ClickableContainer public class OsuClickableContainer : ClickableContainer, IHasTooltip
{ {
private readonly HoverSampleSet sampleSet; private readonly HoverSampleSet sampleSet;
@ -23,6 +24,8 @@ namespace osu.Game.Graphics.Containers
this.sampleSet = sampleSet; this.sampleSet = sampleSet;
} }
public virtual string TooltipText { get; set; }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
{ {

View File

@ -136,15 +136,5 @@ namespace osu.Game.Graphics
public readonly Color4 ChatBlue = FromHex(@"17292e"); public readonly Color4 ChatBlue = FromHex(@"17292e");
public readonly Color4 ContextMenuGray = FromHex(@"223034"); public readonly Color4 ContextMenuGray = FromHex(@"223034");
public readonly Color4 CommunityUserGreenLight = FromHex(@"deff87");
public readonly Color4 CommunityUserGreen = FromHex(@"05ffa2");
public readonly Color4 CommunityUserGreenDark = FromHex(@"a6cc00");
public readonly Color4 CommunityUserGrayGreenLighter = FromHex(@"9ebab1");
public readonly Color4 CommunityUserGrayGreenLight = FromHex(@"77998e");
public readonly Color4 CommunityUserGrayGreen = FromHex(@"4e7466");
public readonly Color4 CommunityUserGrayGreenDark = FromHex(@"33413c");
public readonly Color4 CommunityUserGrayGreenDarker = FromHex(@"2c3532");
public readonly Color4 CommunityUserGrayGreenDarkest = FromHex(@"1e2422");
} }
} }

View File

@ -1,7 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// 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.Cursor;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using osu.Framework.Allocation; using osu.Framework.Allocation;
@ -16,7 +15,7 @@ namespace osu.Game.Online.Chat
/// <summary> /// <summary>
/// An invisible drawable that brings multiple <see cref="Drawable"/> pieces together to form a consumable clickable link. /// An invisible drawable that brings multiple <see cref="Drawable"/> pieces together to form a consumable clickable link.
/// </summary> /// </summary>
public class DrawableLinkCompiler : OsuHoverContainer, IHasTooltip public class DrawableLinkCompiler : OsuHoverContainer
{ {
/// <summary> /// <summary>
/// Each word part of a chat link (split for word-wrap support). /// Each word part of a chat link (split for word-wrap support).
@ -40,8 +39,6 @@ namespace osu.Game.Online.Chat
protected override IEnumerable<Drawable> EffectTargets => Parts; protected override IEnumerable<Drawable> EffectTargets => Parts;
public string TooltipText { get; set; }
private class LinkHoverSounds : HoverClickSounds private class LinkHoverSounds : HoverClickSounds
{ {
private readonly List<Drawable> parts; private readonly List<Drawable> parts;

View File

@ -9,8 +9,6 @@ using osu.Game.Graphics.Sprites;
using osu.Game.Users; using osu.Game.Users;
using osuTK; using osuTK;
using osuTK.Graphics; using osuTK.Graphics;
using osu.Game.Graphics.Containers;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Effects; using osu.Framework.Graphics.Effects;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics; using osu.Game.Graphics;
@ -129,10 +127,5 @@ namespace osu.Game.Overlays.BeatmapSet
}; };
} }
} }
private class ClickableArea : OsuClickableContainer, IHasTooltip
{
public string TooltipText => @"View Profile";
}
} }
} }

View File

@ -83,7 +83,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
Origin = Anchor.CentreLeft, Origin = Anchor.CentreLeft,
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
}, },
date = new SpriteText date = new OsuSpriteText
{ {
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft, Origin = Anchor.CentreLeft,

View File

@ -35,14 +35,14 @@ namespace osu.Game.Overlays.Profile.Header
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OsuColour colours)
{ {
iconColour = colours.CommunityUserGrayGreenLighter; iconColour = colours.GreySeafoamLighter;
InternalChildren = new Drawable[] InternalChildren = new Drawable[]
{ {
new Box new Box
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = colours.CommunityUserGrayGreenDarker, Colour = colours.GreySeafoamDark,
}, },
new FillFlowContainer new FillFlowContainer
{ {

View File

@ -38,7 +38,7 @@ namespace osu.Game.Overlays.Profile.Header
new Box new Box
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = colours.CommunityUserGrayGreenDark Colour = colours.GreySeafoam
}, },
new FillFlowContainer new FillFlowContainer
{ {

View File

@ -27,8 +27,8 @@ namespace osu.Game.Overlays.Profile.Header.Components
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OsuColour colours)
{ {
IdleColour = colours.CommunityUserGrayGreen; IdleColour = colours.GreySeafoamLight;
HoverColour = colours.CommunityUserGrayGreen.Darken(0.2f); HoverColour = colours.GreySeafoamLight.Darken(0.2f);
Child = icon = new SpriteIcon Child = icon = new SpriteIcon
{ {

View File

@ -4,7 +4,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
@ -12,10 +11,8 @@ using osuTK.Graphics;
namespace osu.Game.Overlays.Profile.Header.Components namespace osu.Game.Overlays.Profile.Header.Components
{ {
public abstract class ProfileHeaderButton : OsuHoverContainer, IHasTooltip public abstract class ProfileHeaderButton : OsuHoverContainer
{ {
public abstract string TooltipText { get; }
private readonly Box background; private readonly Box background;
private readonly Container content; private readonly Container content;

View File

@ -154,7 +154,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OsuColour colours)
{ {
ballBg.Colour = colours.CommunityUserGrayGreenDarkest; ballBg.Colour = colours.GreySeafoamDarker;
movingBall.BorderColour = colours.Yellow; movingBall.BorderColour = colours.Yellow;
movingBar.Colour = colours.Yellow; movingBar.Colour = colours.Yellow;
} }
@ -249,7 +249,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OsuColour colours)
{ {
background.Colour = colours.CommunityUserGrayGreenDarker; background.Colour = colours.GreySeafoamDark;
} }
public void Refresh() public void Refresh()

View File

@ -80,7 +80,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
private void load(OsuColour colours) private void load(OsuColour colours)
{ {
background.Colour = colours.Pink; background.Colour = colours.Pink;
iconContainer.Colour = colours.CommunityUserGrayGreenDark; iconContainer.Colour = colours.GreySeafoam;
} }
} }
} }

View File

@ -65,7 +65,7 @@ namespace osu.Game.Overlays.Profile.Header
new Box new Box
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = colours.CommunityUserGrayGreenDarkest, Colour = colours.GreySeafoamDarker,
}, },
fillFlow = new FillFlowContainer fillFlow = new FillFlowContainer
{ {

View File

@ -34,7 +34,7 @@ namespace osu.Game.Overlays.Profile.Header
new Box new Box
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = colours.CommunityUserGrayGreenDarkest, Colour = colours.GreySeafoamDarker,
}, },
new Container //artificial shadow new Container //artificial shadow
{ {

View File

@ -41,7 +41,7 @@ namespace osu.Game.Overlays.Profile.Header
new Box new Box
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = colours.CommunityUserGrayGreenDarker, Colour = colours.GreySeafoamDark,
}, },
new FillFlowContainer new FillFlowContainer
{ {
@ -107,7 +107,7 @@ namespace osu.Game.Overlays.Profile.Header
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Height = 1.5f, Height = 1.5f,
Margin = new MarginPadding { Top = 10 }, Margin = new MarginPadding { Top = 10 },
Colour = colours.CommunityUserGrayGreenLighter, Colour = colours.GreySeafoamLighter,
}, },
new Container new Container
{ {
@ -125,7 +125,7 @@ namespace osu.Game.Overlays.Profile.Header
Margin = new MarginPadding { Left = 40 }, Margin = new MarginPadding { Left = 40 },
Origin = Anchor.CentreLeft, Origin = Anchor.CentreLeft,
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
Colour = colours.CommunityUserGrayGreenLighter, Colour = colours.GreySeafoamLighter,
} }
} }
}, },

View File

@ -124,7 +124,7 @@ namespace osu.Game.Overlays.Profile
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OsuColour colours)
{ {
infoTabControl.AccentColour = colours.CommunityUserGreen; infoTabControl.AccentColour = colours.Seafoam;
} }
public Bindable<User> User = new Bindable<User>(); public Bindable<User> User = new Bindable<User>();
@ -145,7 +145,7 @@ namespace osu.Game.Overlays.Profile
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OsuColour colours)
{ {
AccentColour = colours.CommunityUserGreen; AccentColour = colours.Seafoam;
} }
} }
} }

View File

@ -4,7 +4,6 @@
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Localisation; using osu.Framework.Localisation;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Graphics; using osu.Game.Graphics;
@ -16,7 +15,7 @@ namespace osu.Game.Overlays.Profile.Sections
/// <summary> /// <summary>
/// Display artist/title/mapper information, commonly used as the left portion of a profile or score display row (see <see cref="DrawableProfileRow"/>). /// Display artist/title/mapper information, commonly used as the left portion of a profile or score display row (see <see cref="DrawableProfileRow"/>).
/// </summary> /// </summary>
public class BeatmapMetadataContainer : OsuHoverContainer, IHasTooltip public class BeatmapMetadataContainer : OsuHoverContainer
{ {
private readonly BeatmapInfo beatmap; private readonly BeatmapInfo beatmap;
@ -27,8 +26,6 @@ namespace osu.Game.Overlays.Profile.Sections
TooltipText = $"{beatmap.Metadata.Artist} - {beatmap.Metadata.Title}"; TooltipText = $"{beatmap.Metadata.Artist} - {beatmap.Metadata.Title}";
} }
public string TooltipText { get; }
[BackgroundDependencyLoader(true)] [BackgroundDependencyLoader(true)]
private void load(BeatmapSetOverlay beatmapSetOverlay) private void load(BeatmapSetOverlay beatmapSetOverlay)
{ {

View File

@ -6,7 +6,6 @@ using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures; using osu.Framework.Graphics.Textures;
using osu.Framework.Input.Events; using osu.Framework.Input.Events;
@ -72,9 +71,9 @@ namespace osu.Game.Users
game?.ShowUser(user.Id); game?.ShowUser(user.Id);
} }
private class ClickableArea : OsuClickableContainer, IHasTooltip private class ClickableArea : OsuClickableContainer
{ {
public string TooltipText => Enabled.Value ? @"View Profile" : null; public override string TooltipText => Enabled.Value ? @"View Profile" : null;
protected override bool OnClick(ClickEvent e) protected override bool OnClick(ClickEvent e)
{ {