mirror of
https://github.com/ppy/osu.git
synced 2024-12-17 06:42:54 +08:00
Add DailyChallengeIntroPlayed
session static
This commit is contained in:
parent
f4b8fc6165
commit
637c9aeef0
@ -80,5 +80,11 @@ namespace osu.Game.Configuration
|
||||
/// Stores the local user's last score (can be completed or aborted).
|
||||
/// </summary>
|
||||
LastLocalUserScore,
|
||||
|
||||
/// <summary>
|
||||
/// Whether the intro animation for the daily challenge screen has been played once.
|
||||
/// This is reset when a new challenge is up.
|
||||
/// </summary>
|
||||
DailyChallengeIntroPlayed,
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Threading;
|
||||
using osu.Framework.Utils;
|
||||
using osu.Game.Beatmaps.Drawables;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Localisation;
|
||||
@ -46,6 +47,9 @@ namespace osu.Game.Screens.Menu
|
||||
[Resolved]
|
||||
private INotificationOverlay? notificationOverlay { get; set; }
|
||||
|
||||
[Resolved]
|
||||
private SessionStatics statics { get; set; } = null!;
|
||||
|
||||
public DailyChallengeButton(string sampleName, Color4 colour, Action<MainMenuButton>? clickAction = null, params Key[] triggerKeys)
|
||||
: base(ButtonSystemStrings.DailyChallenge, sampleName, OsuIcon.DailyChallenge, colour, clickAction, triggerKeys)
|
||||
{
|
||||
@ -148,6 +152,9 @@ namespace osu.Game.Screens.Menu
|
||||
|
||||
roomRequest.Success += room =>
|
||||
{
|
||||
// force showing intro on the first time when a new daily challenge is up.
|
||||
statics.SetValue(Static.DailyChallengeIntroPlayed, false);
|
||||
|
||||
Room = room;
|
||||
cover.OnlineInfo = TooltipContent = room.Playlist.FirstOrDefault()?.Beatmap.BeatmapSet as APIBeatmapSet;
|
||||
|
||||
|
@ -150,7 +150,10 @@ namespace osu.Game.Screens.Menu
|
||||
OnPlaylists = () => this.Push(new Playlists()),
|
||||
OnDailyChallenge = room =>
|
||||
{
|
||||
this.Push(new DailyChallengeIntro(room));
|
||||
if (statics.Get<bool>(Static.DailyChallengeIntroPlayed))
|
||||
this.Push(new DailyChallenge(room));
|
||||
else
|
||||
this.Push(new DailyChallengeIntro(room));
|
||||
},
|
||||
OnExit = () =>
|
||||
{
|
||||
|
@ -70,6 +70,9 @@ namespace osu.Game.Screens.OnlinePlay.DailyChallenge
|
||||
[Resolved]
|
||||
private MusicController musicController { get; set; } = null!;
|
||||
|
||||
[Resolved]
|
||||
private SessionStatics statics { get; set; } = null!;
|
||||
|
||||
private Sample? dateWindupSample;
|
||||
private Sample? dateImpactSample;
|
||||
private Sample? beatmapWindupSample;
|
||||
@ -461,6 +464,8 @@ namespace osu.Game.Screens.OnlinePlay.DailyChallenge
|
||||
{
|
||||
Schedule(() =>
|
||||
{
|
||||
statics.SetValue(Static.DailyChallengeIntroPlayed, true);
|
||||
|
||||
if (this.IsCurrentScreen())
|
||||
this.Push(new DailyChallenge(room));
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user