mirror of
https://github.com/ppy/osu.git
synced 2025-01-06 20:33:08 +08:00
Split out rounded content screen from SetupScreen for use in other places
This commit is contained in:
parent
513e470b52
commit
e143afb598
61
osu.Game/Screens/Edit/RoundedContentEditorScreen.cs
Normal file
61
osu.Game/Screens/Edit/RoundedContentEditorScreen.cs
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
// 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.Allocation;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Overlays;
|
||||||
|
|
||||||
|
namespace osu.Game.Screens.Edit
|
||||||
|
{
|
||||||
|
public class RoundedContentEditorScreen : EditorScreen
|
||||||
|
{
|
||||||
|
public const int HORIZONTAL_PADDING = 100;
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private OsuColour colours { get; set; }
|
||||||
|
|
||||||
|
[Cached]
|
||||||
|
protected readonly OverlayColourProvider ColourProvider;
|
||||||
|
|
||||||
|
private Container roundedContent;
|
||||||
|
|
||||||
|
protected override Container<Drawable> Content => roundedContent;
|
||||||
|
|
||||||
|
public RoundedContentEditorScreen(EditorScreenMode mode)
|
||||||
|
: base(mode)
|
||||||
|
{
|
||||||
|
ColourProvider = new OverlayColourProvider(OverlayColourScheme.Blue);
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load()
|
||||||
|
{
|
||||||
|
base.Content.Add(new Container
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Padding = new MarginPadding(50),
|
||||||
|
Child = new Container
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Masking = true,
|
||||||
|
CornerRadius = 10,
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new Box
|
||||||
|
{
|
||||||
|
Colour = ColourProvider.Dark4,
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
},
|
||||||
|
roundedContent = new Container
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -3,24 +3,12 @@
|
|||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
|
||||||
using osu.Framework.Graphics.Shapes;
|
|
||||||
using osu.Game.Graphics;
|
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Overlays;
|
|
||||||
|
|
||||||
namespace osu.Game.Screens.Edit.Setup
|
namespace osu.Game.Screens.Edit.Setup
|
||||||
{
|
{
|
||||||
public class SetupScreen : EditorScreen
|
public class SetupScreen : RoundedContentEditorScreen
|
||||||
{
|
{
|
||||||
public const int HORIZONTAL_PADDING = 100;
|
|
||||||
|
|
||||||
[Resolved]
|
|
||||||
private OsuColour colours { get; set; }
|
|
||||||
|
|
||||||
[Cached]
|
|
||||||
protected readonly OverlayColourProvider ColourProvider;
|
|
||||||
|
|
||||||
[Cached]
|
[Cached]
|
||||||
private SectionsContainer<SetupSection> sections = new SectionsContainer<SetupSection>();
|
private SectionsContainer<SetupSection> sections = new SectionsContainer<SetupSection>();
|
||||||
|
|
||||||
@ -30,42 +18,25 @@ namespace osu.Game.Screens.Edit.Setup
|
|||||||
public SetupScreen()
|
public SetupScreen()
|
||||||
: base(EditorScreenMode.SongSetup)
|
: base(EditorScreenMode.SongSetup)
|
||||||
{
|
{
|
||||||
ColourProvider = new OverlayColourProvider(OverlayColourScheme.Blue);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
Child = new Container
|
AddRange(new Drawable[]
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
sections = new SectionsContainer<SetupSection>
|
||||||
Padding = new MarginPadding(50),
|
|
||||||
Child = new Container
|
|
||||||
{
|
{
|
||||||
|
FixedHeader = header,
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Masking = true,
|
Children = new SetupSection[]
|
||||||
CornerRadius = 10,
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
{
|
||||||
new Box
|
new ResourcesSection(),
|
||||||
{
|
new MetadataSection(),
|
||||||
Colour = ColourProvider.Dark4,
|
new DifficultySection(),
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
},
|
|
||||||
sections = new SectionsContainer<SetupSection>
|
|
||||||
{
|
|
||||||
FixedHeader = header,
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Children = new SetupSection[]
|
|
||||||
{
|
|
||||||
new ResourcesSection(),
|
|
||||||
new MetadataSection(),
|
|
||||||
new DifficultySection(),
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
};
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -93,7 +93,7 @@ namespace osu.Game.Screens.Edit.Setup
|
|||||||
|
|
||||||
public SetupScreenTabControl()
|
public SetupScreenTabControl()
|
||||||
{
|
{
|
||||||
TabContainer.Margin = new MarginPadding { Horizontal = SetupScreen.HORIZONTAL_PADDING };
|
TabContainer.Margin = new MarginPadding { Horizontal = RoundedContentEditorScreen.HORIZONTAL_PADDING };
|
||||||
|
|
||||||
AddInternal(background = new Box
|
AddInternal(background = new Box
|
||||||
{
|
{
|
||||||
|
@ -33,7 +33,7 @@ namespace osu.Game.Screens.Edit.Setup
|
|||||||
Padding = new MarginPadding
|
Padding = new MarginPadding
|
||||||
{
|
{
|
||||||
Vertical = 10,
|
Vertical = 10,
|
||||||
Horizontal = SetupScreen.HORIZONTAL_PADDING
|
Horizontal = RoundedContentEditorScreen.HORIZONTAL_PADDING
|
||||||
};
|
};
|
||||||
|
|
||||||
InternalChild = new FillFlowContainer
|
InternalChild = new FillFlowContainer
|
||||||
|
@ -7,16 +7,16 @@ using osu.Framework.Bindables;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
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.Overlays;
|
||||||
using osu.Game.Rulesets.Edit;
|
using osu.Game.Rulesets.Edit;
|
||||||
using osu.Game.Rulesets.Edit.Checks.Components;
|
using osu.Game.Rulesets.Edit.Checks.Components;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Edit.Verify
|
namespace osu.Game.Screens.Edit.Verify
|
||||||
{
|
{
|
||||||
public class VerifyScreen : EditorScreen
|
public class VerifyScreen : RoundedContentEditorScreen
|
||||||
{
|
{
|
||||||
[Cached]
|
[Cached]
|
||||||
private Bindable<Issue> selectedIssue = new Bindable<Issue>();
|
private Bindable<Issue> selectedIssue = new Bindable<Issue>();
|
||||||
@ -32,7 +32,6 @@ namespace osu.Game.Screens.Edit.Verify
|
|||||||
Child = new Container
|
Child = new Container
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Padding = new MarginPadding(20),
|
|
||||||
Child = new GridContainer
|
Child = new GridContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
@ -70,7 +69,7 @@ namespace osu.Game.Screens.Edit.Verify
|
|||||||
private BeatmapVerifier generalVerifier;
|
private BeatmapVerifier generalVerifier;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load(OverlayColourProvider colours)
|
||||||
{
|
{
|
||||||
generalVerifier = new BeatmapVerifier();
|
generalVerifier = new BeatmapVerifier();
|
||||||
rulesetVerifier = Beatmap.BeatmapInfo.Ruleset?.CreateInstance()?.CreateBeatmapVerifier();
|
rulesetVerifier = Beatmap.BeatmapInfo.Ruleset?.CreateInstance()?.CreateBeatmapVerifier();
|
||||||
@ -81,7 +80,7 @@ namespace osu.Game.Screens.Edit.Verify
|
|||||||
{
|
{
|
||||||
new Box
|
new Box
|
||||||
{
|
{
|
||||||
Colour = colours.Gray0,
|
Colour = colours.Background2,
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
},
|
},
|
||||||
new OsuScrollContainer
|
new OsuScrollContainer
|
||||||
|
Loading…
Reference in New Issue
Block a user