Improve layout of ui scale step

This commit is contained in:
Dean Herbert 2022-04-18 15:21:09 +09:00
parent e064f2f23e
commit 3b94e01fe6

View File

@ -5,13 +5,14 @@ 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.Localisation; using osu.Framework.Localisation;
using osu.Framework.Screens;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Localisation; using osu.Game.Localisation;
using osu.Game.Overlays.Settings; using osu.Game.Overlays.Settings;
using osu.Game.Screens; using osu.Game.Screens;
using osu.Game.Screens.Menu;
using osu.Game.Screens.OnlinePlay.Match.Components; using osu.Game.Screens.OnlinePlay.Match.Components;
using osu.Game.Screens.Select; using osu.Game.Screens.Select;
using osuTK; using osuTK;
@ -23,6 +24,9 @@ namespace osu.Game.Overlays.FirstRunSetup
[Resolved] [Resolved]
private OsuConfigManager osuConfig { get; set; } private OsuConfigManager osuConfig { get; set; }
[Cached]
private OsuLogo osuLogo = new OsuLogo();
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
{ {
@ -36,7 +40,7 @@ namespace osu.Game.Overlays.FirstRunSetup
Spacing = new Vector2(20), Spacing = new Vector2(20),
Children = new Drawable[] Children = new Drawable[]
{ {
new OsuTextFlowContainer new OsuTextFlowContainer(cp => cp.Font = OsuFont.Default.With(size: 32))
{ {
Text = "The osu! user interface size can be adjusted to your liking.", Text = "The osu! user interface size can be adjusted to your liking.",
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
@ -49,12 +53,42 @@ namespace osu.Game.Overlays.FirstRunSetup
Current = osuConfig.GetBindable<float>(OsuSetting.UIScale), Current = osuConfig.GetBindable<float>(OsuSetting.UIScale),
KeyboardStep = 0.01f, KeyboardStep = 0.01f,
}, },
new DrawSizePreservingFillContainer new GridContainer
{
RelativeSizeAxes = Axes.Both,
Content = new[]
{
new Drawable[]
{
new ScalingContainer(ScalingMode.Off)
{ {
Masking = true, Masking = true,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.Both,
Height = 300,
Child = stack = new OsuScreenStack() Child = stack = new OsuScreenStack()
},
new ScalingContainer(ScalingMode.Off)
{
Masking = true,
RelativeSizeAxes = Axes.Both,
Child = stack = new OsuScreenStack()
}
},
new Drawable[]
{
new ScalingContainer(ScalingMode.Off)
{
Masking = true,
RelativeSizeAxes = Axes.Both,
Child = stack = new OsuScreenStack()
},
new ScalingContainer(ScalingMode.Off)
{
Masking = true,
RelativeSizeAxes = Axes.Both,
Child = stack = new OsuScreenStack()
}
}
}
} }
} }
}, },
@ -72,13 +106,6 @@ namespace osu.Game.Overlays.FirstRunSetup
stack.Push(new PlaySongSelect()); stack.Push(new PlaySongSelect());
} }
public override void OnEntering(IScreen last)
{
base.OnEntering(last);
Overlay.MoveDisplayTo(new Vector2(0.5f));
Overlay.ResizeDisplayTo(new Vector2(0.8f));
}
private class UIScaleSlider : OsuSliderBar<float> private class UIScaleSlider : OsuSliderBar<float>
{ {
public override LocalisableString TooltipText => base.TooltipText + "x"; public override LocalisableString TooltipText => base.TooltipText + "x";