1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 04:02:59 +08:00

Add basic scene selector

This commit is contained in:
Dean Herbert 2022-03-11 23:30:46 +09:00
parent c807ad7e4e
commit d062810ff2
3 changed files with 55 additions and 2 deletions

View File

@ -24,7 +24,7 @@ namespace osu.Game.Tests.Visual.Gameplay
AddStep("reload skin editor", () =>
{
skinEditor?.Expire();
Player.ScaleTo(SkinEditorOverlay.VISIBLE_TARGET_SCALE);
Player.ScaleTo(0.8f);
LoadComponentAsync(skinEditor = new SkinEditor(Player), Add);
});
}

View File

@ -10,14 +10,20 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input.Events;
using osu.Framework.Screens;
using osu.Framework.Testing;
using osu.Game.Configuration;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Cursor;
using osu.Game.Graphics.UserInterface;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Edit;
using osu.Game.Screens.Edit.Components.Menus;
using osu.Game.Screens.OnlinePlay.Match.Components;
using osu.Game.Screens.Play;
using osu.Game.Screens.Select;
using osuTK;
namespace osu.Game.Skinning.Editor
{
@ -42,6 +48,12 @@ namespace osu.Game.Skinning.Editor
[Resolved]
private OsuColour colours { get; set; }
[Resolved]
private IBindable<RulesetInfo> ruleset { get; set; }
[Resolved(canBeNull: true)]
private OsuGame game { get; set; }
private bool hasBegunMutating;
private Container content;
@ -105,6 +117,47 @@ namespace osu.Game.Skinning.Editor
},
},
},
new FillFlowContainer
{
RelativeSizeAxes = Axes.X,
Y = 45,
Height = 30,
Name = "Scene library",
Spacing = new Vector2(10),
Padding = new MarginPadding(10),
Direction = FillDirection.Horizontal,
Children = new Drawable[]
{
new PurpleTriangleButton
{
Text = "Song Select",
Width = 100,
Height = 30,
Action = () => game?.PerformFromScreen(screen =>
{
if (screen is SongSelect)
return;
screen.Push(new PlaySongSelect());
}, new[] { typeof(SongSelect) })
},
new PurpleTriangleButton
{
Text = "Gameplay",
Width = 100,
Height = 30,
Action = () => game?.PerformFromScreen(screen =>
{
if (screen is Player)
return;
var replayGeneratingMod = ruleset.Value.CreateInstance().GetAutoplayMod();
if (replayGeneratingMod != null)
screen.Push(new ReplayPlayer((beatmap, mods) => replayGeneratingMod.CreateReplayScore(beatmap, mods)));
}, new[] { typeof(Player) })
},
}
},
new GridContainer
{
RelativeSizeAxes = Axes.Both,

View File

@ -114,7 +114,7 @@ namespace osu.Game.Skinning.Editor
if (skinEditor.State.Value == Visibility.Visible)
{
scalingContainer.SetCustomRect(new RectangleF(toolbar_padding_requirement, 0.1f, 0.8f - toolbar_padding_requirement, 0.7f), true);
scalingContainer.SetCustomRect(new RectangleF(toolbar_padding_requirement, 0.2f, 0.8f - toolbar_padding_requirement, 0.7f), true);
game?.Toolbar.Hide();
game?.CloseAllOverlays();