1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-16 09:22:58 +08:00

added DailyChallengeIntro to notification

This commit is contained in:
Ianlucht 2024-09-07 13:46:42 -06:00
parent e88083adc1
commit 958bfde51d

View File

@ -5,12 +5,14 @@ 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;
using osu.Game.Screens.Menu;
using osu.Game.Localisation;
namespace osu.Game.Screens.OnlinePlay.DailyChallenge
{
public partial class NewDailyChallengeNotification : SimpleNotification
@ -24,14 +26,18 @@ namespace osu.Game.Screens.OnlinePlay.DailyChallenge
this.room = room;
}
[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;
};
}