Merge branch 'master' into editor-object-object-snapping

This commit is contained in:
Dan Balasescu 2020-09-25 13:17:30 +09:00 committed by GitHub
commit 952e84396a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 43 additions and 4 deletions

View File

@ -13,6 +13,11 @@ namespace osu.Game.Screens.Edit.Compose
{
private HitObjectComposer composer;
public ComposeScreen()
: base(EditorScreenMode.Compose)
{
}
protected override Drawable CreateMainContent()
{
var ruleset = Beatmap.Value.BeatmapInfo.Ruleset?.CreateInstance();

View File

@ -6,6 +6,7 @@ namespace osu.Game.Screens.Edit.Design
public class DesignScreen : EditorScreen
{
public DesignScreen()
: base(EditorScreenMode.Design)
{
Child = new ScreenWhiteBox.UnderConstructionMessage("Design mode");
}

View File

@ -68,7 +68,7 @@ namespace osu.Game.Screens.Edit
private string lastSavedHash;
private Box bottomBackground;
private Container screenContainer;
private Container<EditorScreen> screenContainer;
private EditorScreen currentScreen;
@ -163,7 +163,7 @@ namespace osu.Game.Screens.Edit
Name = "Screen container",
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Top = 40, Bottom = 60 },
Child = screenContainer = new Container
Child = screenContainer = new Container<EditorScreen>
{
RelativeSizeAxes = Axes.Both,
Masking = true
@ -512,7 +512,21 @@ namespace osu.Game.Screens.Edit
private void onModeChanged(ValueChangedEvent<EditorScreenMode> e)
{
currentScreen?.Exit();
var lastScreen = currentScreen;
lastScreen?
.ScaleTo(0.98f, 200, Easing.OutQuint)
.FadeOut(200, Easing.OutQuint);
if ((currentScreen = screenContainer.SingleOrDefault(s => s.Type == e.NewValue)) != null)
{
screenContainer.ChangeChildDepth(currentScreen, lastScreen?.Depth + 1 ?? 0);
currentScreen
.ScaleTo(1, 200, Easing.OutQuint)
.FadeIn(200, Easing.OutQuint);
return;
}
switch (e.NewValue)
{

View File

@ -23,8 +23,12 @@ namespace osu.Game.Screens.Edit
protected override Container<Drawable> Content => content;
private readonly Container content;
protected EditorScreen()
public readonly EditorScreenMode Type;
protected EditorScreen(EditorScreenMode type)
{
Type = type;
Anchor = Anchor.Centre;
Origin = Anchor.Centre;
RelativeSizeAxes = Axes.Both;

View File

@ -25,6 +25,11 @@ namespace osu.Game.Screens.Edit
private Container timelineContainer;
protected EditorScreenWithTimeline(EditorScreenMode type)
: base(type)
{
}
[BackgroundDependencyLoader(true)]
private void load([CanBeNull] BindableBeatDivisor beatDivisor)
{

View File

@ -24,6 +24,11 @@ namespace osu.Game.Screens.Edit.Setup
private LabelledTextBox creatorTextBox;
private LabelledTextBox difficultyTextBox;
public SetupScreen()
: base(EditorScreenMode.SongSetup)
{
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{

View File

@ -24,6 +24,11 @@ namespace osu.Game.Screens.Edit.Timing
[Resolved]
private EditorClock clock { get; set; }
public TimingScreen()
: base(EditorScreenMode.Timing)
{
}
protected override Drawable CreateMainContent() => new GridContainer
{
RelativeSizeAxes = Axes.Both,