Compare commits
2 Commits
master
...
e6a6352a9c
| Author | SHA1 | Date | |
|---|---|---|---|
| e6a6352a9c | |||
| e78c8fa03d |
11
osu.Game/Configuration/WelcomeMusicMode.cs
Normal file
11
osu.Game/Configuration/WelcomeMusicMode.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
// 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.
|
||||
|
||||
namespace osu.Game.Configuration
|
||||
{
|
||||
public enum WelcomeMusicMode
|
||||
{
|
||||
Default,
|
||||
Custom
|
||||
}
|
||||
}
|
||||
12
osu.Game/Online/API/Requests/GetMusicCategoriesRequest.cs
Normal file
12
osu.Game/Online/API/Requests/GetMusicCategoriesRequest.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
// 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.Game.Online.API.Requests.Responses;
|
||||
|
||||
namespace osu.Game.Online.API.Requests
|
||||
{
|
||||
public class GetMusicCategoriesRequest : APIRequest<APIBackgroundCategories>
|
||||
{
|
||||
protected override string Target => @"https://osu.jvnko.boats/welcome-music/categories";
|
||||
}
|
||||
}
|
||||
21
osu.Game/Online/API/Requests/GetWelcomeMusicRequest.cs
Normal file
21
osu.Game/Online/API/Requests/GetWelcomeMusicRequest.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
// 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 System.Collections.Generic;
|
||||
using System.Net;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
|
||||
namespace osu.Game.Online.API.Requests
|
||||
{
|
||||
public class GetWelcomeMusicRequest : APIRequest<List<APIWelcomeMusic>>
|
||||
{
|
||||
private readonly string category;
|
||||
|
||||
public GetWelcomeMusicRequest(string category)
|
||||
{
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
protected override string Target => $"https://osu.jvnko.boats/welcome-music/list?category={WebUtility.UrlEncode(category)}";
|
||||
}
|
||||
}
|
||||
17
osu.Game/Online/API/Requests/Responses/APIWelcomeMusic.cs
Normal file
17
osu.Game/Online/API/Requests/Responses/APIWelcomeMusic.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
// 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 Newtonsoft.Json;
|
||||
|
||||
namespace osu.Game.Online.API.Requests.Responses
|
||||
{
|
||||
// Описывает один трек, как он приходит с сервера
|
||||
public class APIWelcomeMusic
|
||||
{
|
||||
[JsonProperty("name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
[JsonProperty("url")]
|
||||
public string? Url { get; set; }
|
||||
}
|
||||
}
|
||||
30
osu.Game/Screens/Menu/IntroFade.cs
Normal file
30
osu.Game/Screens/Menu/IntroFade.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
// 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 osu.Framework.Graphics;
|
||||
using osu.Framework.Screens;
|
||||
using osu.Game.Audio;
|
||||
|
||||
namespace osu.Game.Screens.Menu
|
||||
{
|
||||
public partial class IntroFade : OsuScreen
|
||||
{
|
||||
[Resolved]
|
||||
private WelcomeMusicManager? musicManager { get; set; }
|
||||
|
||||
public override void OnEntering(ScreenTransitionEvent e)
|
||||
{
|
||||
base.OnEntering(e);
|
||||
|
||||
this.FadeInFromZero(1000, Easing.OutQuint);
|
||||
|
||||
#pragma warning disable CS8602 // Разыменование вероятной пустой ссылки.
|
||||
var track = musicManager.GetPreloadedTrack();
|
||||
#pragma warning restore CS8602 // Разыменование вероятной пустой ссылки.
|
||||
track?.Start();
|
||||
|
||||
Scheduler.AddDelayed(() => this.Push(new MainMenu()), 2000);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user