Display skin changes via on-screen display overlay

This commit is contained in:
Dean Herbert 2020-11-11 12:19:01 +09:00
parent 451f0a29c6
commit 9caa56c64f
2 changed files with 12 additions and 0 deletions

View File

@ -1,6 +1,7 @@
// 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;
using osu.Framework.Bindables;
using osu.Framework.Configuration;
using osu.Framework.Configuration.Tracking;
@ -177,7 +178,14 @@ namespace osu.Game.Configuration
new TrackedSetting<bool>(OsuSetting.MouseDisableButtons, v => new SettingDescription(!v, "gameplay mouse buttons", v ? "disabled" : "enabled")),
new TrackedSetting<HUDVisibilityMode>(OsuSetting.HUDVisibilityMode, m => new SettingDescription(m, "HUD Visibility", m.GetDescription())),
new TrackedSetting<ScalingMode>(OsuSetting.Scaling, m => new SettingDescription(m, "scaling", m.GetDescription())),
new TrackedSetting<int>(OsuSetting.Skin, m =>
{
string skinName = LookupSkinName?.Invoke(m) ?? string.Empty;
return new SettingDescription(skinName, "skin", skinName);
})
};
public Func<int, string> LookupSkinName { get; set; }
}
public enum OsuSetting

View File

@ -548,6 +548,10 @@ namespace osu.Game
ScoreManager.GetStableStorage = GetStorageForStableInstall;
ScoreManager.PresentImport = items => PresentScore(items.First());
// make config aware of how to lookup skins for on-screen display purposes.
// if this becomes a more common thing, tracked settings should be reconsidered to allow local DI.
LocalConfig.LookupSkinName = id => SkinManager.GetAllUsableSkins().FirstOrDefault(s => s.ID == id)?.ToString() ?? "Unknown";
Container logoContainer;
BackButton.Receptor receptor;