mirror of
https://github.com/ppy/osu.git
synced 2025-02-15 14:03:01 +08:00
Expose method to adjust header text, not whole drawable
This commit is contained in:
parent
6f248db519
commit
baa4089364
@ -10,6 +10,7 @@ using osu.Game.Screens;
|
||||
using osuTK;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Framework.Screens;
|
||||
@ -22,7 +23,10 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
||||
|
||||
private DirectorySelector directorySelector;
|
||||
|
||||
protected abstract OsuSpriteText CreateHeader();
|
||||
/// <summary>
|
||||
/// Text to display in the header to inform the user of what they are selecting.
|
||||
/// </summary>
|
||||
public abstract LocalisableString HeaderText { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Called upon selection of a directory by the user.
|
||||
@ -73,11 +77,13 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
||||
{
|
||||
new Drawable[]
|
||||
{
|
||||
CreateHeader().With(header =>
|
||||
new OsuSpriteText
|
||||
{
|
||||
header.Origin = Anchor.Centre;
|
||||
header.Anchor = Anchor.Centre;
|
||||
})
|
||||
Text = HeaderText,
|
||||
Font = OsuFont.Default.With(size: 40),
|
||||
Origin = Anchor.Centre,
|
||||
Anchor = Anchor.Centre,
|
||||
}
|
||||
},
|
||||
new Drawable[]
|
||||
{
|
||||
|
@ -4,11 +4,10 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Framework.Platform;
|
||||
using osu.Framework.Screens;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
|
||||
namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
||||
{
|
||||
@ -25,11 +24,7 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
||||
|
||||
public override bool HideOverlaysOnEnter => true;
|
||||
|
||||
protected override OsuSpriteText CreateHeader() => new OsuSpriteText
|
||||
{
|
||||
Text = "Please select a new location",
|
||||
Font = OsuFont.Default.With(size: 40)
|
||||
};
|
||||
public override LocalisableString HeaderText => "Please select a new location";
|
||||
|
||||
protected override void OnSelection(DirectoryInfo directory)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user