1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 15:07:44 +08:00

Merge pull request #10044 from peppy/update-icons

Update toolbar icons and source titles from overlays directly
This commit is contained in:
Dan Balasescu 2020-09-03 20:55:20 +09:00 committed by GitHub
commit 8330a3aff4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
50 changed files with 177 additions and 382 deletions

View File

@ -12,7 +12,7 @@ namespace osu.Game.Tests.Visual.Online
[TestFixture]
public class TestSceneFullscreenOverlay : OsuTestScene
{
private FullscreenOverlay overlay;
private FullscreenOverlay<OverlayHeader> overlay;
protected override void LoadComplete()
{
@ -38,10 +38,10 @@ namespace osu.Game.Tests.Visual.Online
AddAssert("fire count 3", () => fireCount == 3);
}
private class TestFullscreenOverlay : FullscreenOverlay
private class TestFullscreenOverlay : FullscreenOverlay<OverlayHeader>
{
public TestFullscreenOverlay()
: base(OverlayColourScheme.Pink)
: base(OverlayColourScheme.Pink, null)
{
Children = new Drawable[]
{

View File

@ -26,8 +26,11 @@ namespace osu.Game.Graphics.Containers
{
if (value == expandableHeader) return;
expandableHeader?.Expire();
if (expandableHeader != null)
RemoveInternal(expandableHeader);
expandableHeader = value;
if (value == null) return;
AddInternal(expandableHeader);

View File

@ -698,9 +698,9 @@ namespace osu.Game
float offset = 0;
if (Settings.State.Value == Visibility.Visible)
offset += ToolbarButton.WIDTH / 2;
offset += Toolbar.HEIGHT / 2;
if (notifications.State.Value == Visibility.Visible)
offset -= ToolbarButton.WIDTH / 2;
offset -= Toolbar.HEIGHT / 2;
screenContainer.MoveToX(offset, SettingsPanel.TRANSITION_LENGTH, Easing.OutQuint);
}

View File

@ -12,7 +12,8 @@ namespace osu.Game.Overlays.BeatmapListing
public BeatmapListingTitle()
{
Title = "beatmap listing";
IconTexture = "Icons/changelog";
Description = "Browse for new beatmaps";
IconTexture = "Icons/Hexacons/beatmap";
}
}
}

View File

@ -24,7 +24,7 @@ using osuTK;
namespace osu.Game.Overlays
{
public class BeatmapListingOverlay : FullscreenOverlay
public class BeatmapListingOverlay : FullscreenOverlay<BeatmapListingHeader>
{
[Resolved]
private PreviewTrackManager previewTrackManager { get; set; }
@ -38,7 +38,7 @@ namespace osu.Game.Overlays
private OverlayScrollContainer resultScrollContainer;
public BeatmapListingOverlay()
: base(OverlayColourScheme.Blue)
: base(OverlayColourScheme.Blue, new BeatmapListingHeader())
{
}
@ -65,7 +65,7 @@ namespace osu.Game.Overlays
Direction = FillDirection.Vertical,
Children = new Drawable[]
{
new BeatmapListingHeader(),
Header,
filterControl = new BeatmapListingFilterControl
{
SearchStarted = onSearchStarted,

View File

@ -25,7 +25,7 @@ namespace osu.Game.Overlays.BeatmapSet
public BeatmapHeaderTitle()
{
Title = "beatmap info";
IconTexture = "Icons/changelog";
IconTexture = "Icons/Hexacons/beatmap";
}
}
}

View File

@ -19,12 +19,14 @@ using osuTK;
namespace osu.Game.Overlays
{
public class BeatmapSetOverlay : FullscreenOverlay
public class BeatmapSetOverlay : FullscreenOverlay<OverlayHeader> // we don't provide a standard header for now.
{
public const float X_PADDING = 40;
public const float Y_PADDING = 25;
public const float RIGHT_WIDTH = 275;
protected readonly Header Header;
//todo: should be an OverlayHeader? or maybe not?
protected new readonly Header Header;
[Resolved]
private RulesetStore rulesets { get; set; }
@ -37,7 +39,7 @@ namespace osu.Game.Overlays
private readonly Box background;
public BeatmapSetOverlay()
: base(OverlayColourScheme.Blue)
: base(OverlayColourScheme.Blue, null)
{
OverlayScrollContainer scroll;
Info info;

View File

@ -115,7 +115,8 @@ namespace osu.Game.Overlays.Changelog
public ChangelogHeaderTitle()
{
Title = "changelog";
IconTexture = "Icons/changelog";
Description = "Track recent dev updates in the osu! ecosystem";
IconTexture = "Icons/Hexacons/devtools";
}
}
}

View File

@ -21,12 +21,10 @@ using osu.Game.Overlays.Changelog;
namespace osu.Game.Overlays
{
public class ChangelogOverlay : FullscreenOverlay
public class ChangelogOverlay : FullscreenOverlay<ChangelogHeader>
{
public readonly Bindable<APIChangelogBuild> Current = new Bindable<APIChangelogBuild>();
protected ChangelogHeader Header;
private Container<ChangelogContent> content;
private SampleChannel sampleBack;
@ -36,7 +34,7 @@ namespace osu.Game.Overlays
protected List<APIUpdateStream> Streams;
public ChangelogOverlay()
: base(OverlayColourScheme.Purple)
: base(OverlayColourScheme.Purple, new ChangelogHeader())
{
}
@ -61,10 +59,11 @@ namespace osu.Game.Overlays
Direction = FillDirection.Vertical,
Children = new Drawable[]
{
Header = new ChangelogHeader
Header.With(h =>
{
ListingSelected = ShowListing,
},
h.ListingSelected = ShowListing;
h.Build.BindTarget = Current;
}),
content = new Container<ChangelogContent>
{
RelativeSizeAxes = Axes.X,
@ -77,8 +76,6 @@ namespace osu.Game.Overlays
sampleBack = audio.Samples.Get(@"UI/generic-select-soft");
Header.Build.BindTo(Current);
Current.BindValueChanged(e =>
{
if (e.NewValue != null)

View File

@ -22,7 +22,7 @@ namespace osu.Game.Overlays.Chat.Selection
{
public class ChannelSelectionOverlay : WaveOverlayContainer
{
public const float WIDTH_PADDING = 170;
public new const float WIDTH_PADDING = 170;
private const float transition_duration = 500;

View File

@ -26,8 +26,12 @@ using osu.Framework.Graphics.Sprites;
namespace osu.Game.Overlays
{
public class ChatOverlay : OsuFocusedOverlayContainer
public class ChatOverlay : OsuFocusedOverlayContainer, INamedOverlayComponent
{
public string IconTexture => "Icons/Hexacons/messaging";
public string Title => "chat";
public string Description => "Join the real-time discussion";
private const float textbox_height = 60;
private const float channel_selection_min_height = 0.3f;

View File

@ -12,7 +12,8 @@ namespace osu.Game.Overlays.Dashboard
public DashboardTitle()
{
Title = "dashboard";
IconTexture = "Icons/changelog";
Description = "View your friends and other information";
IconTexture = "Icons/Hexacons/social";
}
}
}

View File

@ -15,17 +15,21 @@ using osu.Game.Overlays.Dashboard.Friends;
namespace osu.Game.Overlays
{
public class DashboardOverlay : FullscreenOverlay
public class DashboardOverlay : FullscreenOverlay<DashboardOverlayHeader>
{
private CancellationTokenSource cancellationToken;
private Container content;
private DashboardOverlayHeader header;
private LoadingLayer loading;
private OverlayScrollContainer scrollFlow;
public DashboardOverlay()
: base(OverlayColourScheme.Purple)
: base(OverlayColourScheme.Purple, new DashboardOverlayHeader
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Depth = -float.MaxValue
})
{
}
@ -50,12 +54,7 @@ namespace osu.Game.Overlays
Direction = FillDirection.Vertical,
Children = new Drawable[]
{
header = new DashboardOverlayHeader
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Depth = -float.MaxValue
},
Header,
content = new Container
{
RelativeSizeAxes = Axes.X,
@ -72,7 +71,7 @@ namespace osu.Game.Overlays
{
base.LoadComplete();
header.Current.BindValueChanged(onTabChanged);
Header.Current.BindValueChanged(onTabChanged);
}
private bool displayUpdateRequired = true;
@ -84,7 +83,7 @@ namespace osu.Game.Overlays
// We don't want to create a new display on every call, only when exiting from fully closed state.
if (displayUpdateRequired)
{
header.Current.TriggerChange();
Header.Current.TriggerChange();
displayUpdateRequired = false;
}
}
@ -136,7 +135,7 @@ namespace osu.Game.Overlays
if (State.Value == Visibility.Hidden)
return;
header.Current.TriggerChange();
Header.Current.TriggerChange();
}
protected override void Dispose(bool isDisposing)

View File

@ -12,16 +12,25 @@ using osuTK.Graphics;
namespace osu.Game.Overlays
{
public abstract class FullscreenOverlay : WaveOverlayContainer, IOnlineComponent
public abstract class FullscreenOverlay<T> : WaveOverlayContainer, IOnlineComponent, INamedOverlayComponent
where T : OverlayHeader
{
public virtual string IconTexture => Header?.Title.IconTexture ?? string.Empty;
public virtual string Title => Header?.Title.Title ?? string.Empty;
public virtual string Description => Header?.Title.Description ?? string.Empty;
public T Header { get; }
[Resolved]
protected IAPIProvider API { get; private set; }
[Cached]
protected readonly OverlayColourProvider ColourProvider;
protected FullscreenOverlay(OverlayColourScheme colourScheme)
protected FullscreenOverlay(OverlayColourScheme colourScheme, T header)
{
Header = header;
ColourProvider = new OverlayColourProvider(colourScheme);
RelativeSizeAxes = Axes.Both;

View File

@ -0,0 +1,14 @@
// 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.
namespace osu.Game.Overlays
{
public interface INamedOverlayComponent
{
string IconTexture { get; }
string Title { get; }
string Description { get; }
}
}

View File

@ -57,7 +57,8 @@ namespace osu.Game.Overlays.News
public NewsHeaderTitle()
{
Title = "news";
IconTexture = "Icons/news";
Description = "Get up-to-date on community happenings";
IconTexture = "Icons/Hexacons/news";
}
}
}

View File

@ -13,17 +13,16 @@ using osu.Game.Overlays.News.Displays;
namespace osu.Game.Overlays
{
public class NewsOverlay : FullscreenOverlay
public class NewsOverlay : FullscreenOverlay<NewsHeader>
{
private readonly Bindable<string> article = new Bindable<string>(null);
private Container content;
private LoadingLayer loading;
private NewsHeader header;
private OverlayScrollContainer scrollFlow;
public NewsOverlay()
: base(OverlayColourScheme.Purple)
: base(OverlayColourScheme.Purple, new NewsHeader())
{
}
@ -48,10 +47,10 @@ namespace osu.Game.Overlays
Direction = FillDirection.Vertical,
Children = new Drawable[]
{
header = new NewsHeader
Header.With(h =>
{
ShowFrontPage = ShowFrontPage
},
h.ShowFrontPage = ShowFrontPage;
}),
content = new Container
{
RelativeSizeAxes = Axes.X,
@ -112,12 +111,12 @@ namespace osu.Game.Overlays
if (e.NewValue == null)
{
header.SetFrontPage();
Header.SetFrontPage();
LoadDisplay(new FrontPageDisplay());
return;
}
header.SetArticle(e.NewValue);
Header.SetArticle(e.NewValue);
LoadDisplay(Empty());
}

View File

@ -16,8 +16,12 @@ using osu.Framework.Threading;
namespace osu.Game.Overlays
{
public class NotificationOverlay : OsuFocusedOverlayContainer
public class NotificationOverlay : OsuFocusedOverlayContainer, INamedOverlayComponent
{
public string IconTexture => "Icons/Hexacons/notification";
public string Title => "Notifications";
public string Description => "Waiting for 'ya";
private const float width = 320;
public const float TRANSITION_LENGTH = 600;

View File

@ -25,8 +25,12 @@ using osuTK.Graphics;
namespace osu.Game.Overlays
{
public class NowPlayingOverlay : OsuFocusedOverlayContainer
public class NowPlayingOverlay : OsuFocusedOverlayContainer, INamedOverlayComponent
{
public string IconTexture => "Icons/Hexacons/music";
public string Title => "now playing";
public string Description => "Manage the currently playing track";
private const float player_height = 130;
private const float transition_length = 800;
private const float progress_height = 10;

View File

@ -12,6 +12,8 @@ namespace osu.Game.Overlays
{
public abstract class OverlayHeader : Container
{
public OverlayTitle Title { get; }
private float contentSidePadding;
/// <summary>
@ -73,7 +75,7 @@ namespace osu.Game.Overlays
AutoSizeAxes = Axes.Y,
Children = new[]
{
CreateTitle().With(title =>
Title = CreateTitle().With(title =>
{
title.Anchor = Anchor.CentreLeft;
title.Origin = Anchor.CentreLeft;

View File

@ -17,7 +17,7 @@ using osuTK.Graphics;
namespace osu.Game.Overlays
{
/// <summary>
/// <see cref="OsuScrollContainer"/> which provides <see cref="ScrollToTopButton"/>. Mostly used in <see cref="FullscreenOverlay"/>.
/// <see cref="OsuScrollContainer"/> which provides <see cref="ScrollToTopButton"/>. Mostly used in <see cref="FullscreenOverlay{T}"/>.
/// </summary>
public class OverlayScrollContainer : OsuScrollContainer
{

View File

@ -12,19 +12,27 @@ using osuTK;
namespace osu.Game.Overlays
{
public abstract class OverlayTitle : CompositeDrawable
public abstract class OverlayTitle : CompositeDrawable, INamedOverlayComponent
{
private readonly OsuSpriteText title;
private readonly OsuSpriteText titleText;
private readonly Container icon;
protected string Title
private string title;
public string Title
{
set => title.Text = value;
get => title;
protected set => titleText.Text = title = value;
}
protected string IconTexture
public string Description { get; protected set; }
private string iconTexture;
public string IconTexture
{
set => icon.Child = new OverlayTitleIcon(value);
get => iconTexture;
protected set => icon.Child = new OverlayTitleIcon(iconTexture = value);
}
protected OverlayTitle()
@ -45,7 +53,7 @@ namespace osu.Game.Overlays
Margin = new MarginPadding { Horizontal = 5 }, // compensates for osu-web sprites having around 5px of whitespace on each side
Size = new Vector2(30)
},
title = new OsuSpriteText
titleText = new OsuSpriteText
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,

View File

@ -9,7 +9,7 @@ using osu.Game.Online.API;
namespace osu.Game.Overlays
{
/// <summary>
/// A subview containing online content, to be displayed inside a <see cref="FullscreenOverlay"/>.
/// A subview containing online content, to be displayed inside a <see cref="FullscreenOverlay{T}"/>.
/// </summary>
/// <remarks>
/// Automatically performs a data fetch on load.

View File

@ -97,7 +97,7 @@ namespace osu.Game.Overlays.Profile
public ProfileHeaderTitle()
{
Title = "player info";
IconTexture = "Icons/profile";
IconTexture = "Icons/Hexacons/profile";
}
}

View File

@ -30,7 +30,8 @@ namespace osu.Game.Overlays.Rankings
public RankingsTitle()
{
Title = "ranking";
IconTexture = "Icons/rankings";
Description = "Find out who's the best right now";
IconTexture = "Icons/Hexacons/rankings";
}
}
}

View File

@ -17,17 +17,16 @@ using osu.Game.Overlays.Rankings.Tables;
namespace osu.Game.Overlays
{
public class RankingsOverlay : FullscreenOverlay
public class RankingsOverlay : FullscreenOverlay<RankingsOverlayHeader>
{
protected Bindable<Country> Country => header.Country;
protected Bindable<Country> Country => Header.Country;
protected Bindable<RankingsScope> Scope => header.Current;
protected Bindable<RankingsScope> Scope => Header.Current;
private readonly OverlayScrollContainer scrollFlow;
private readonly Container contentContainer;
private readonly LoadingLayer loading;
private readonly Box background;
private readonly RankingsOverlayHeader header;
private APIRequest lastRequest;
private CancellationTokenSource cancellationToken;
@ -36,7 +35,12 @@ namespace osu.Game.Overlays
private IAPIProvider api { get; set; }
public RankingsOverlay()
: base(OverlayColourScheme.Green)
: base(OverlayColourScheme.Green, new RankingsOverlayHeader
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Depth = -float.MaxValue
})
{
Children = new Drawable[]
{
@ -55,12 +59,7 @@ namespace osu.Game.Overlays
Direction = FillDirection.Vertical,
Children = new Drawable[]
{
header = new RankingsOverlayHeader
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Depth = -float.MaxValue
},
Header,
new Container
{
RelativeSizeAxes = Axes.X,
@ -97,7 +96,7 @@ namespace osu.Game.Overlays
{
base.LoadComplete();
header.Ruleset.BindTo(ruleset);
Header.Ruleset.BindTo(ruleset);
Country.BindValueChanged(_ =>
{

View File

@ -36,7 +36,7 @@ namespace osu.Game.Overlays.SearchableList
/// <summary>
/// The amount of padding added to content (does not affect background or tab control strip).
/// </summary>
protected virtual float ContentHorizontalPadding => SearchableListOverlay.WIDTH_PADDING;
protected virtual float ContentHorizontalPadding => WaveOverlayContainer.WIDTH_PADDING;
protected SearchableListFilterControl()
{

View File

@ -1,82 +0,0 @@
// 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.
using System;
using osuTK;
using osuTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
namespace osu.Game.Overlays.SearchableList
{
public abstract class SearchableListHeader<T> : Container
where T : struct, Enum
{
public readonly HeaderTabControl<T> Tabs;
protected abstract Color4 BackgroundColour { get; }
protected abstract T DefaultTab { get; }
protected abstract Drawable CreateHeaderText();
protected abstract IconUsage Icon { get; }
protected SearchableListHeader()
{
RelativeSizeAxes = Axes.X;
Height = 90;
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = BackgroundColour,
},
new Container
{
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Left = SearchableListOverlay.WIDTH_PADDING, Right = SearchableListOverlay.WIDTH_PADDING },
Children = new Drawable[]
{
new FillFlowContainer
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.BottomLeft,
Position = new Vector2(-35f, 5f),
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal,
Spacing = new Vector2(10f, 0f),
Children = new[]
{
new SpriteIcon
{
Size = new Vector2(25),
Icon = Icon,
},
CreateHeaderText(),
},
},
Tabs = new HeaderTabControl<T>
{
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft,
RelativeSizeAxes = Axes.X,
},
},
},
};
Tabs.Current.Value = DefaultTab;
Tabs.Current.TriggerChange();
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
Tabs.StripColour = colours.Green;
}
}
}

View File

@ -1,128 +0,0 @@
// 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.
using System;
using osuTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Input.Events;
using osu.Game.Graphics.Backgrounds;
using osu.Game.Graphics.Cursor;
namespace osu.Game.Overlays.SearchableList
{
public abstract class SearchableListOverlay : FullscreenOverlay
{
public const float WIDTH_PADDING = 80;
protected SearchableListOverlay(OverlayColourScheme colourScheme)
: base(colourScheme)
{
}
}
public abstract class SearchableListOverlay<THeader, TTab, TCategory> : SearchableListOverlay
where THeader : struct, Enum
where TTab : struct, Enum
where TCategory : struct, Enum
{
private readonly Container scrollContainer;
protected readonly SearchableListHeader<THeader> Header;
protected readonly SearchableListFilterControl<TTab, TCategory> Filter;
protected readonly FillFlowContainer ScrollFlow;
protected abstract Color4 BackgroundColour { get; }
protected abstract Color4 TrianglesColourLight { get; }
protected abstract Color4 TrianglesColourDark { get; }
protected abstract SearchableListHeader<THeader> CreateHeader();
protected abstract SearchableListFilterControl<TTab, TCategory> CreateFilterControl();
protected SearchableListOverlay(OverlayColourScheme colourScheme)
: base(colourScheme)
{
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = BackgroundColour,
},
new Container
{
RelativeSizeAxes = Axes.Both,
Masking = true,
Children = new[]
{
new Triangles
{
RelativeSizeAxes = Axes.Both,
TriangleScale = 5,
ColourLight = TrianglesColourLight,
ColourDark = TrianglesColourDark,
},
},
},
scrollContainer = new Container
{
RelativeSizeAxes = Axes.Both,
Child = new OsuContextMenuContainer
{
RelativeSizeAxes = Axes.Both,
Masking = true,
Child = new OverlayScrollContainer
{
RelativeSizeAxes = Axes.Both,
ScrollbarVisible = false,
Child = ScrollFlow = new FillFlowContainer
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Padding = new MarginPadding { Horizontal = 10, Bottom = 50 },
Direction = FillDirection.Vertical,
},
},
},
},
new FillFlowContainer
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical,
Children = new Drawable[]
{
Header = CreateHeader(),
Filter = CreateFilterControl(),
},
},
};
}
protected override void Update()
{
base.Update();
scrollContainer.Padding = new MarginPadding { Top = Header.Height + Filter.Height };
}
protected override void OnFocus(FocusEvent e)
{
Filter.Search.TakeFocus();
}
protected override void PopIn()
{
base.PopIn();
Filter.Search.HoldFocus = true;
}
protected override void PopOut()
{
base.PopOut();
Filter.Search.HoldFocus = false;
}
}
}

View File

@ -4,22 +4,21 @@
using System;
using System.Linq;
using osu.Framework;
using osuTK;
using osuTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Input.Events;
using osu.Framework.Threading;
using osu.Game.Graphics.Containers;
using osu.Game.Overlays.Toolbar;
using osuTK;
using osuTK.Graphics;
namespace osu.Game.Overlays.Settings
{
public class Sidebar : Container<SidebarButton>, IStateful<ExpandedState>
{
private readonly FillFlowContainer<SidebarButton> content;
public const float DEFAULT_WIDTH = ToolbarButton.WIDTH;
public const float DEFAULT_WIDTH = Toolbar.Toolbar.HEIGHT * 1.4f;
public const int EXPANDED_WIDTH = 200;
public event Action<ExpandedState> StateChanged;

View File

@ -13,8 +13,12 @@ using osu.Framework.Bindables;
namespace osu.Game.Overlays
{
public class SettingsOverlay : SettingsPanel
public class SettingsOverlay : SettingsPanel, INamedOverlayComponent
{
public string IconTexture => "Icons/Hexacons/settings";
public string Title => "settings";
public string Description => "Change the way osu! behaves";
protected override IEnumerable<SettingsSection> CreateSections() => new SettingsSection[]
{
new GeneralSection(),
@ -30,7 +34,7 @@ namespace osu.Game.Overlays
private readonly List<SettingsSubPanel> subPanels = new List<SettingsSubPanel>();
protected override Drawable CreateHeader() => new SettingsHeader("settings", "Change the way osu! behaves");
protected override Drawable CreateHeader() => new SettingsHeader(Title, Description);
protected override Drawable CreateFooter() => new SettingsFooter();
public SettingsOverlay()

View File

@ -2,7 +2,6 @@
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Game.Graphics;
using osu.Game.Input.Bindings;
namespace osu.Game.Overlays.Toolbar
@ -11,10 +10,6 @@ namespace osu.Game.Overlays.Toolbar
{
public ToolbarBeatmapListingButton()
{
SetIcon(OsuIcon.ChevronDownCircle);
TooltipMain = "Beatmap listing";
TooltipSub = "Browse for new beatmaps";
Hotkey = GlobalAction.ToggleDirect;
}

View File

@ -9,6 +9,7 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Effects;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events;
using osu.Game.Graphics;
@ -25,8 +26,6 @@ namespace osu.Game.Overlays.Toolbar
{
public abstract class ToolbarButton : OsuClickableContainer, IKeyBindingHandler<GlobalAction>
{
public const float WIDTH = Toolbar.HEIGHT * 1.4f;
protected GlobalAction? Hotkey { get; set; }
public void SetIcon(Drawable icon)
@ -35,16 +34,14 @@ namespace osu.Game.Overlays.Toolbar
IconContainer.Show();
}
public void SetIcon(IconUsage icon) => SetIcon(new SpriteIcon
{
Size = new Vector2(20),
Icon = icon
});
[Resolved]
private TextureStore textures { get; set; }
public IconUsage Icon
{
set => SetIcon(value);
}
public void SetIcon(string texture) =>
SetIcon(new Sprite
{
Texture = textures.Get(texture),
});
public string Text
{
@ -82,7 +79,7 @@ namespace osu.Game.Overlays.Toolbar
protected ToolbarButton()
: base(HoverSampleSet.Loud)
{
Width = WIDTH;
Width = Toolbar.HEIGHT;
RelativeSizeAxes = Axes.Y;
Children = new Drawable[]
@ -116,7 +113,7 @@ namespace osu.Game.Overlays.Toolbar
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
Size = new Vector2(20),
Size = new Vector2(26),
Alpha = 0,
},
DrawableText = new OsuSpriteText

View File

@ -2,19 +2,11 @@
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Graphics.Sprites;
namespace osu.Game.Overlays.Toolbar
{
public class ToolbarChangelogButton : ToolbarOverlayToggleButton
{
public ToolbarChangelogButton()
{
SetIcon(FontAwesome.Solid.Bullhorn);
TooltipMain = "Changelog";
TooltipSub = "Track recent dev updates in the osu! ecosystem";
}
[BackgroundDependencyLoader(true)]
private void load(ChangelogOverlay changelog)
{

View File

@ -2,7 +2,6 @@
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Graphics.Sprites;
using osu.Game.Input.Bindings;
namespace osu.Game.Overlays.Toolbar
@ -11,10 +10,6 @@ namespace osu.Game.Overlays.Toolbar
{
public ToolbarChatButton()
{
SetIcon(FontAwesome.Solid.Comments);
TooltipMain = "Chat";
TooltipSub = "Join the real-time discussion";
Hotkey = GlobalAction.ToggleChat;
}

View File

@ -1,7 +1,7 @@
// 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.
using osu.Framework.Graphics.Sprites;
using osu.Framework.Allocation;
using osu.Game.Input.Bindings;
namespace osu.Game.Overlays.Toolbar
@ -10,11 +10,16 @@ namespace osu.Game.Overlays.Toolbar
{
public ToolbarHomeButton()
{
Icon = FontAwesome.Solid.Home;
Width *= 1.4f;
Hotkey = GlobalAction.Home;
}
[BackgroundDependencyLoader]
private void load()
{
TooltipMain = "Home";
TooltipSub = "Return to the main menu";
Hotkey = GlobalAction.Home;
SetIcon("Icons/Hexacons/home");
}
}
}

View File

@ -3,7 +3,6 @@
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Game.Input.Bindings;
namespace osu.Game.Overlays.Toolbar
@ -14,10 +13,6 @@ namespace osu.Game.Overlays.Toolbar
public ToolbarMusicButton()
{
Icon = FontAwesome.Solid.Music;
TooltipMain = "Now playing";
TooltipSub = "Manage the currently playing track";
Hotkey = GlobalAction.ToggleNowPlaying;
}

View File

@ -2,19 +2,11 @@
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Graphics.Sprites;
namespace osu.Game.Overlays.Toolbar
{
public class ToolbarNewsButton : ToolbarOverlayToggleButton
{
public ToolbarNewsButton()
{
Icon = FontAwesome.Solid.Newspaper;
TooltipMain = "News";
TooltipSub = "Get up-to-date on community happenings";
}
[BackgroundDependencyLoader(true)]
private void load(NewsOverlay news)
{

View File

@ -6,7 +6,6 @@ using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Input.Bindings;
@ -25,10 +24,6 @@ namespace osu.Game.Overlays.Toolbar
public ToolbarNotificationButton()
{
Icon = FontAwesome.Solid.Bars;
TooltipMain = "Notifications";
TooltipSub = "Waiting for 'ya";
Hotkey = GlobalAction.ToggleNotifications;
Add(countDisplay = new CountCircle

View File

@ -32,6 +32,13 @@ namespace osu.Game.Overlays.Toolbar
Action = stateContainer.ToggleVisibility;
overlayState.BindTo(stateContainer.State);
}
if (stateContainer is INamedOverlayComponent named)
{
TooltipMain = named.Title;
TooltipSub = named.Description;
SetIcon(named.IconTexture);
}
}
}

View File

@ -2,19 +2,11 @@
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Graphics.Sprites;
namespace osu.Game.Overlays.Toolbar
{
public class ToolbarRankingsButton : ToolbarOverlayToggleButton
{
public ToolbarRankingsButton()
{
SetIcon(FontAwesome.Regular.ChartBar);
TooltipMain = "Ranking";
TooltipSub = "Find out who's the best right now";
}
[BackgroundDependencyLoader(true)]
private void load(RankingsOverlay rankings)
{

View File

@ -37,7 +37,7 @@ namespace osu.Game.Overlays.Toolbar
},
ModeButtonLine = new Container
{
Size = new Vector2(ToolbarButton.WIDTH, 3),
Size = new Vector2(Toolbar.HEIGHT, 3),
Anchor = Anchor.BottomLeft,
Origin = Anchor.TopLeft,
Masking = true,

View File

@ -65,12 +65,6 @@ namespace osu.Game.Overlays.Toolbar
Parent.Click();
return base.OnClick(e);
}
protected override void LoadComplete()
{
base.LoadComplete();
IconContainer.Scale *= 1.4f;
}
}
}
}

View File

@ -2,7 +2,6 @@
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Graphics.Sprites;
using osu.Game.Input.Bindings;
namespace osu.Game.Overlays.Toolbar
@ -11,10 +10,7 @@ namespace osu.Game.Overlays.Toolbar
{
public ToolbarSettingsButton()
{
Icon = FontAwesome.Solid.Cog;
TooltipMain = "Settings";
TooltipSub = "Change your settings";
Width *= 1.4f;
Hotkey = GlobalAction.ToggleSettings;
}

View File

@ -2,7 +2,6 @@
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Graphics.Sprites;
using osu.Game.Input.Bindings;
namespace osu.Game.Overlays.Toolbar
@ -11,10 +10,6 @@ namespace osu.Game.Overlays.Toolbar
{
public ToolbarSocialButton()
{
Icon = FontAwesome.Solid.Users;
TooltipMain = "Friends";
TooltipSub = "Interact with those close to you";
Hotkey = GlobalAction.ToggleSocial;
}

View File

@ -17,19 +17,18 @@ using osuTK;
namespace osu.Game.Overlays
{
public class UserProfileOverlay : FullscreenOverlay
public class UserProfileOverlay : FullscreenOverlay<ProfileHeader>
{
private ProfileSection lastSection;
private ProfileSection[] sections;
private GetUserRequest userReq;
protected ProfileHeader Header;
private ProfileSectionsContainer sectionsContainer;
private ProfileSectionTabControl tabs;
public const float CONTENT_X_MARGIN = 70;
public UserProfileOverlay()
: base(OverlayColourScheme.Pink)
: base(OverlayColourScheme.Pink, new ProfileHeader())
{
}
@ -45,6 +44,9 @@ namespace osu.Game.Overlays
if (user.Id == Header?.User.Value?.Id)
return;
if (sectionsContainer != null)
sectionsContainer.ExpandableHeader = null;
userReq?.Cancel();
Clear();
lastSection = null;
@ -77,7 +79,7 @@ namespace osu.Game.Overlays
Add(sectionsContainer = new ProfileSectionsContainer
{
ExpandableHeader = Header = new ProfileHeader(),
ExpandableHeader = Header,
FixedHeader = tabs,
HeaderBackground = new Box
{

View File

@ -14,6 +14,8 @@ namespace osu.Game.Overlays
protected override bool BlockNonPositionalInput => true;
protected override Container<Drawable> Content => Waves;
public const float WIDTH_PADDING = 80;
protected override bool StartHidden => true;
protected WaveOverlayContainer()

View File

@ -11,8 +11,8 @@ using osu.Framework.Graphics.UserInterface;
using osu.Framework.Screens;
using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
using osu.Game.Overlays.SearchableList;
using osu.Game.Graphics.Sprites;
using osu.Game.Overlays;
using osuTK;
using osuTK.Graphics;
@ -42,7 +42,7 @@ namespace osu.Game.Screens.Multi
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Left = SearchableListOverlay.WIDTH_PADDING + OsuScreen.HORIZONTAL_OVERFLOW_PADDING },
Padding = new MarginPadding { Left = WaveOverlayContainer.WIDTH_PADDING + OsuScreen.HORIZONTAL_OVERFLOW_PADDING },
Children = new Drawable[]
{
title = new MultiHeaderTitle

View File

@ -12,7 +12,6 @@ using osu.Game.Graphics.Containers;
using osu.Game.Graphics.UserInterface;
using osu.Game.Online.Multiplayer;
using osu.Game.Overlays;
using osu.Game.Overlays.SearchableList;
using osu.Game.Screens.Multi.Lounge.Components;
using osu.Game.Screens.Multi.Match;
@ -102,8 +101,8 @@ namespace osu.Game.Screens.Multi.Lounge
content.Padding = new MarginPadding
{
Top = Filter.DrawHeight,
Left = SearchableListOverlay.WIDTH_PADDING - DrawableRoom.SELECTION_BORDER_WIDTH + HORIZONTAL_OVERFLOW_PADDING,
Right = SearchableListOverlay.WIDTH_PADDING + HORIZONTAL_OVERFLOW_PADDING,
Left = WaveOverlayContainer.WIDTH_PADDING - DrawableRoom.SELECTION_BORDER_WIDTH + HORIZONTAL_OVERFLOW_PADDING,
Right = WaveOverlayContainer.WIDTH_PADDING + HORIZONTAL_OVERFLOW_PADDING,
};
}

View File

@ -14,7 +14,7 @@ using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Online.Multiplayer;
using osu.Game.Overlays.SearchableList;
using osu.Game.Overlays;
using osuTK;
using osuTK.Graphics;
@ -117,7 +117,7 @@ namespace osu.Game.Screens.Multi.Match.Components
{
new Container
{
Padding = new MarginPadding { Horizontal = SearchableListOverlay.WIDTH_PADDING },
Padding = new MarginPadding { Horizontal = WaveOverlayContainer.WIDTH_PADDING },
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Children = new Drawable[]