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