Move logo depth to a forward passing

This commit is contained in:
Dean Herbert 2024-07-12 19:20:41 +09:00
parent 3ea0f58daa
commit e8f7213b3b
No known key found for this signature in database
2 changed files with 5 additions and 4 deletions

View File

@ -297,8 +297,6 @@ namespace osu.Game
if (hideToolbar) Toolbar.Hide();
}
public void ChangeLogoDepth(bool inFrontOfFooter) => ScreenContainer.ChangeChildDepth(logoContainer, inFrontOfFooter ? float.MinValue : 0);
protected override UserInputManager CreateUserInputManager()
{
var userInputManager = base.CreateUserInputManager();
@ -996,6 +994,7 @@ namespace osu.Game
RelativeSizeAxes = Axes.Both,
Child = ScreenFooter = new ScreenFooter(backReceptor)
{
RequestLogoInFront = inFront => ScreenContainer.ChangeChildDepth(logoContainer, inFront ? float.MinValue : 0),
OnBack = () =>
{
if (!(ScreenStack.CurrentScreen is IOsuScreen currentScreen))

View File

@ -44,6 +44,8 @@ namespace osu.Game.Screens.Footer
public ScreenBackButton BackButton { get; private set; } = null!;
public Action<bool>? RequestLogoInFront { get; set; }
public Action? OnBack;
public ScreenFooter(BackReceptor? receptor = null)
@ -114,7 +116,7 @@ namespace osu.Game.Screens.Footer
changeLogoDepthDelegate = null;
logoTrackingContainer.StartTracking(logo, duration, easing);
game?.ChangeLogoDepth(inFrontOfFooter: true);
RequestLogoInFront?.Invoke(true);
}
public void StopTrackingLogo()
@ -122,7 +124,7 @@ namespace osu.Game.Screens.Footer
logoTrackingContainer.StopTracking();
if (game != null)
changeLogoDepthDelegate = Scheduler.AddDelayed(() => game.ChangeLogoDepth(inFrontOfFooter: false), transition_duration);
changeLogoDepthDelegate = Scheduler.AddDelayed(() => RequestLogoInFront?.Invoke(false), transition_duration);
}
protected override void PopIn()