mirror of
https://github.com/ppy/osu
synced 2024-12-15 11:25:29 +00:00
Merge pull request #22629 from Cootz/SkinSetOnNotificationClick
Select skin by clicking on an import notification
This commit is contained in:
commit
215049a5f3
@ -60,6 +60,7 @@ using osu.Game.Screens.Menu;
|
||||
using osu.Game.Screens.Play;
|
||||
using osu.Game.Screens.Ranking;
|
||||
using osu.Game.Screens.Select;
|
||||
using osu.Game.Skinning;
|
||||
using osu.Game.Updater;
|
||||
using osu.Game.Users;
|
||||
using osu.Game.Utils;
|
||||
@ -501,6 +502,23 @@ namespace osu.Game
|
||||
/// <param name="version">The build version of the update stream</param>
|
||||
public void ShowChangelogBuild(string updateStream, string version) => waitForReady(() => changelogOverlay, _ => changelogOverlay.ShowBuild(updateStream, version));
|
||||
|
||||
/// <summary>
|
||||
/// Present a skin select immediately.
|
||||
/// </summary>
|
||||
/// <param name="skin">The skin to select.</param>
|
||||
public void PresentSkin(SkinInfo skin)
|
||||
{
|
||||
var databasedSkin = SkinManager.Query(s => s.ID == skin.ID);
|
||||
|
||||
if (databasedSkin == null)
|
||||
{
|
||||
Logger.Log("The requested skin could not be loaded.", LoggingTarget.Information);
|
||||
return;
|
||||
}
|
||||
|
||||
SkinManager.CurrentSkinInfo.Value = databasedSkin;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Present a beatmap at song select immediately.
|
||||
/// The user should have already requested this interactively.
|
||||
@ -777,6 +795,7 @@ namespace osu.Game
|
||||
|
||||
// todo: all archive managers should be able to be looped here.
|
||||
SkinManager.PostNotification = n => Notifications.Post(n);
|
||||
SkinManager.PresentImport = items => PresentSkin(items.First().Value);
|
||||
|
||||
BeatmapManager.PostNotification = n => Notifications.Post(n);
|
||||
BeatmapManager.PresentImport = items => PresentBeatmap(items.First().Value);
|
||||
|
Loading…
Reference in New Issue
Block a user