Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify the dev footer display #30914

Merged
merged 1 commit into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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