mirror of
https://github.com/ppy/osu
synced 2025-02-18 11:26:57 +00:00
Make EditorScreen
inherit from VisibilityContainer
rather than unsafe transforms
This commit is contained in:
parent
c32168c61f
commit
3ad0b529fb
@ -605,19 +605,14 @@ namespace osu.Game.Screens.Edit
|
|||||||
{
|
{
|
||||||
var lastScreen = currentScreen;
|
var lastScreen = currentScreen;
|
||||||
|
|
||||||
lastScreen?
|
lastScreen?.Hide();
|
||||||
.ScaleTo(0.98f, 200, Easing.OutQuint)
|
|
||||||
.FadeOut(200, Easing.OutQuint);
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if ((currentScreen = screenContainer.SingleOrDefault(s => s.Type == e.NewValue)) != null)
|
if ((currentScreen = screenContainer.SingleOrDefault(s => s.Type == e.NewValue)) != null)
|
||||||
{
|
{
|
||||||
screenContainer.ChangeChildDepth(currentScreen, lastScreen?.Depth + 1 ?? 0);
|
screenContainer.ChangeChildDepth(currentScreen, lastScreen?.Depth + 1 ?? 0);
|
||||||
|
currentScreen.Show();
|
||||||
currentScreen
|
|
||||||
.ScaleTo(1, 200, Easing.OutQuint)
|
|
||||||
.FadeIn(200, Easing.OutQuint);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -650,7 +645,10 @@ namespace osu.Game.Screens.Edit
|
|||||||
LoadComponentAsync(currentScreen, newScreen =>
|
LoadComponentAsync(currentScreen, newScreen =>
|
||||||
{
|
{
|
||||||
if (newScreen == currentScreen)
|
if (newScreen == currentScreen)
|
||||||
|
{
|
||||||
screenContainer.Add(newScreen);
|
screenContainer.Add(newScreen);
|
||||||
|
newScreen.Show();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
@ -10,7 +10,7 @@ namespace osu.Game.Screens.Edit
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// TODO: eventually make this inherit Screen and add a local screen stack inside the Editor.
|
/// TODO: eventually make this inherit Screen and add a local screen stack inside the Editor.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class EditorScreen : Container
|
public abstract class EditorScreen : VisibilityContainer
|
||||||
{
|
{
|
||||||
[Resolved]
|
[Resolved]
|
||||||
protected EditorBeatmap EditorBeatmap { get; private set; }
|
protected EditorBeatmap EditorBeatmap { get; private set; }
|
||||||
@ -31,13 +31,16 @@ namespace osu.Game.Screens.Edit
|
|||||||
InternalChild = content = new Container { RelativeSizeAxes = Axes.Both };
|
InternalChild = content = new Container { RelativeSizeAxes = Axes.Both };
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void PopIn()
|
||||||
{
|
{
|
||||||
base.LoadComplete();
|
this.ScaleTo(1f, 200, Easing.OutQuint)
|
||||||
|
.FadeIn(200, Easing.OutQuint);
|
||||||
|
}
|
||||||
|
|
||||||
this.FadeTo(0)
|
protected override void PopOut()
|
||||||
.Then()
|
{
|
||||||
.FadeTo(1f, 250, Easing.OutQuint);
|
this.ScaleTo(0.98f, 200, Easing.OutQuint)
|
||||||
|
.FadeOut(200, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user