Skip to content

Show supporter love message at main menu and remove the disclaimer screen #26183

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

Merged
merged 4 commits into from
Dec 28, 2023
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
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