Skip to content

Commit

Permalink
Merge pull request #30914 from peppy/dev-footer-pass
Browse files Browse the repository at this point in the history
Simplify the dev footer display
  • Loading branch information
frenzibyte authored Nov 29, 2024
2 parents ca32720 + b697ddc commit b71bccc
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 116 deletions.
14 changes: 6 additions & 8 deletions osu.Game/OsuGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ public partial class OsuGame : OsuGameBase, IKeyBindingHandler<GlobalAction>, IL

private MainMenu menuScreen;

private VersionManager versionManager;
[CanBeNull]
private DevBuildBanner devBuildBanner;

[CanBeNull]
private IntroScreen introScreen;
Expand Down Expand Up @@ -1055,10 +1056,7 @@ protected override void LoadComplete()
}, topMostOverlayContent.Add);

if (!IsDeployedBuild)
{
dependencies.Cache(versionManager = new VersionManager());
loadComponentSingleFile(versionManager, ScreenContainer.Add);
}
loadComponentSingleFile(devBuildBanner = new DevBuildBanner(), ScreenContainer.Add);

loadComponentSingleFile(osuLogo, _ =>
{
Expand Down Expand Up @@ -1564,20 +1562,20 @@ private void screenChanged(IScreen current, IScreen newScreen)
{
case IntroScreen intro:
introScreen = intro;
versionManager?.Show();
devBuildBanner?.Show();
break;

case MainMenu menu:
menuScreen = menu;
versionManager?.Show();
devBuildBanner?.Show();
break;

case Player player:
player.PlayingState.BindTo(playingState);
break;

default:
versionManager?.Hide();
devBuildBanner?.Hide();
break;
}

Expand Down
58 changes: 58 additions & 0 deletions osu.Game/Overlays/DevBuildBanner.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// Copyright (c) ppy Pty Ltd <[email protected]>. 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.Sprites;
using osu.Framework.Graphics.Textures;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osuTK;

namespace osu.Game.Overlays
{
public partial class DevBuildBanner : VisibilityContainer
{
[BackgroundDependencyLoader]
private void load(OsuColour colours, TextureStore textures, OsuGameBase game)
{
AutoSizeAxes = Axes.Both;

Anchor = Anchor.BottomCentre;
Origin = Anchor.BottomCentre;

Alpha = 0;

AddRange(new Drawable[]
{
new OsuSpriteText
{
Anchor = Anchor.BottomCentre,
Origin = Anchor.BottomCentre,
Font = OsuFont.Numeric.With(weight: FontWeight.Bold, size: 12),
Colour = colours.YellowDark,
Text = @"DEVELOPER BUILD",
},
new Sprite
{
Anchor = Anchor.BottomCentre,
Origin = Anchor.BottomCentre,
Texture = textures.Get(@"Menu/dev-build-footer"),
Scale = new Vector2(0.4f, 1),
Y = 2,
},
});
}

protected override void PopIn()
{
this.FadeIn(1400, Easing.OutQuint);
}

protected override void PopOut()
{
this.FadeOut(500, Easing.OutQuint);
}
}
}
95 changes: 0 additions & 95 deletions osu.Game/Overlays/VersionManager.cs

This file was deleted.

13 changes: 0 additions & 13 deletions osu.Game/Screens/Menu/MainMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ public partial class MainMenu : OsuScreen, IHandlePresentBeatmap, IKeyBindingHan
[Resolved(canBeNull: true)]
private IDialogOverlay dialogOverlay { get; set; }

[Resolved(canBeNull: true)]
private VersionManager versionManager { get; set; }

protected override BackgroundScreen CreateBackground() => new BackgroundScreenDefault();

protected override bool PlayExitSound => false;
Expand Down Expand Up @@ -294,16 +291,6 @@ bool displayLogin(Func<bool> originalAction)
}
}

protected override void Update()
{
base.Update();

bottomElementsFlow.Margin = new MarginPadding
{
Bottom = (versionManager?.DrawHeight + 5) ?? 0
};
}

protected override void LogoSuspending(OsuLogo logo)
{
var seq = logo.FadeOut(300, Easing.InSine)
Expand Down

0 comments on commit b71bccc

Please sign in to comment.