Skip to content

Commit

Permalink
Merge pull request #26183 from peppy/menu-supporter-display
Browse files Browse the repository at this point in the history
Show supporter love message at main menu and remove the disclaimer screen
  • Loading branch information
bdach authored Dec 28, 2023
2 parents 17325ff + a717ad5 commit f5a3124
Show file tree
Hide file tree
Showing 5 changed files with 196 additions and 244 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using osu.Framework.Allocation;
using NUnit.Framework;
using osu.Framework.Graphics;
using osu.Game.Online.API;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Screens.Menu;

namespace osu.Game.Tests.Visual.Menus
{
public partial class TestSceneDisclaimer : ScreenTestScene
public partial class TestSceneSupporterDisplay : OsuTestScene
{
[BackgroundDependencyLoader]
private void load()
[Test]
public void TestBasic()
{
AddStep("load disclaimer", () => LoadScreen(new Disclaimer()));
AddStep("create display", () =>
{
Child = new SupporterDisplay
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
};
});

AddStep("toggle support", () =>
{
Expand Down
13 changes: 2 additions & 11 deletions osu.Game/Screens/Loader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ namespace osu.Game.Screens
{
public partial class Loader : StartupScreen
{
private bool showDisclaimer;

public Loader()
{
ValidForResume = false;
Expand All @@ -35,13 +33,7 @@ public Loader()
private LoadingSpinner spinner;
private ScheduledDelegate spinnerShow;

protected virtual OsuScreen CreateLoadableScreen()
{
if (showDisclaimer)
return new Disclaimer(getIntroSequence());

return getIntroSequence();
}
protected virtual OsuScreen CreateLoadableScreen() => getIntroSequence();

private IntroScreen getIntroSequence()
{
Expand Down Expand Up @@ -107,9 +99,8 @@ private void checkIfLoaded()
}

[BackgroundDependencyLoader]
private void load(OsuGameBase game, OsuConfigManager config)
private void load(OsuConfigManager config)
{
showDisclaimer = game.IsDeployedBuild;
introSequence = config.Get<IntroSequence>(OsuSetting.IntroSequence);
}

Expand Down
227 changes: 0 additions & 227 deletions osu.Game/Screens/Menu/Disclaimer.cs

This file was deleted.

13 changes: 13 additions & 0 deletions osu.Game/Screens/Menu/MainMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public partial class MainMenu : OsuScreen, IHandlePresentBeatmap, IKeyBindingHan
private Container logoTarget;
private MenuTip menuTip;
private FillFlowContainer bottomElementsFlow;
private SupporterDisplay supporterDisplay;

private Sample reappearSampleSwoosh;

Expand Down Expand Up @@ -179,6 +180,12 @@ private void load(BeatmapListingOverlay beatmapListing, SettingsOverlay settings
}
}
},
supporterDisplay = new SupporterDisplay
{
Margin = new MarginPadding(5),
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft,
},
holdToExitGameOverlay?.CreateProxy() ?? Empty()
});

Expand Down Expand Up @@ -339,6 +346,9 @@ public override void OnSuspending(ScreenTransitionEvent e)
bottomElementsFlow
.ScaleTo(0.9f, 1000, Easing.OutQuint)
.FadeOut(500, Easing.OutQuint);

supporterDisplay
.FadeOut(500, Easing.OutQuint);
}

public override void OnResuming(ScreenTransitionEvent e)
Expand Down Expand Up @@ -403,6 +413,9 @@ public override bool OnExiting(ScreenExitEvent e)
bottomElementsFlow
.FadeOut(500, Easing.OutQuint);

supporterDisplay
.FadeOut(500, Easing.OutQuint);

return base.OnExiting(e);
}

Expand Down
Loading

0 comments on commit f5a3124

Please sign in to comment.