1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 12:17:26 +08:00

Merge pull request #29770 from Ianlucht/Add-Animation-to-challenge-notification

Add daily challenge animation to daily challenge notification
This commit is contained in:
Bartłomiej Dach 2024-09-08 13:13:59 +02:00 committed by GitHub
commit 139fc07a09
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -5,6 +5,7 @@ using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Screens;
using osu.Game.Beatmaps.Drawables.Cards;
using osu.Game.Configuration;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Online.Rooms;
using osu.Game.Overlays.Notifications;
@ -25,13 +26,17 @@ namespace osu.Game.Screens.OnlinePlay.DailyChallenge
}
[BackgroundDependencyLoader]
private void load(OsuGame? game)
private void load(OsuGame? game, SessionStatics statics)
{
Text = DailyChallengeStrings.ChallengeLiveNotification;
Content.Add(card = new BeatmapCardNano((APIBeatmapSet)room.Playlist.Single().Beatmap.BeatmapSet!));
Activated = () =>
{
game?.PerformFromScreen(s => s.Push(new DailyChallenge(room)), [typeof(MainMenu)]);
if (statics.Get<bool>(Static.DailyChallengeIntroPlayed))
game?.PerformFromScreen(s => s.Push(new DailyChallenge(room)), [typeof(MainMenu)]);
else
game?.PerformFromScreen(s => s.Push(new DailyChallengeIntro(room)), [typeof(MainMenu)]);
return true;
};
}