mirror of
https://github.com/ppy/osu.git
synced 2025-01-27 14:12:56 +08:00
Remove obsoleted ShowProgressGraph
global setting
This was moved to the component itself.
This commit is contained in:
parent
bdc6755ee2
commit
71970d83cf
@ -127,7 +127,6 @@ namespace osu.Game.Configuration
|
|||||||
SetDefault(OsuSetting.HitLighting, true);
|
SetDefault(OsuSetting.HitLighting, true);
|
||||||
|
|
||||||
SetDefault(OsuSetting.HUDVisibilityMode, HUDVisibilityMode.Always);
|
SetDefault(OsuSetting.HUDVisibilityMode, HUDVisibilityMode.Always);
|
||||||
SetDefault(OsuSetting.ShowProgressGraph, true);
|
|
||||||
SetDefault(OsuSetting.ShowHealthDisplayWhenCantFail, true);
|
SetDefault(OsuSetting.ShowHealthDisplayWhenCantFail, true);
|
||||||
SetDefault(OsuSetting.FadePlayfieldWhenHealthLow, true);
|
SetDefault(OsuSetting.FadePlayfieldWhenHealthLow, true);
|
||||||
SetDefault(OsuSetting.KeyOverlay, false);
|
SetDefault(OsuSetting.KeyOverlay, false);
|
||||||
@ -302,8 +301,6 @@ namespace osu.Game.Configuration
|
|||||||
FloatingComments,
|
FloatingComments,
|
||||||
HUDVisibilityMode,
|
HUDVisibilityMode,
|
||||||
|
|
||||||
// This has been migrated to the component itself. can be removed 20221027.
|
|
||||||
ShowProgressGraph,
|
|
||||||
ShowHealthDisplayWhenCantFail,
|
ShowHealthDisplayWhenCantFail,
|
||||||
FadePlayfieldWhenHealthLow,
|
FadePlayfieldWhenHealthLow,
|
||||||
MouseDisableButtons,
|
MouseDisableButtons,
|
||||||
|
@ -9,7 +9,6 @@ using osu.Game.Configuration;
|
|||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
using osu.Game.Skinning;
|
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Play.HUD
|
namespace osu.Game.Screens.Play.HUD
|
||||||
@ -45,12 +44,6 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private DrawableRuleset? drawableRuleset { get; set; }
|
private DrawableRuleset? drawableRuleset { get; set; }
|
||||||
|
|
||||||
[Resolved]
|
|
||||||
private OsuConfigManager config { get; set; } = null!;
|
|
||||||
|
|
||||||
[Resolved]
|
|
||||||
private SkinManager skinManager { get; set; } = null!;
|
|
||||||
|
|
||||||
public DefaultSongProgress()
|
public DefaultSongProgress()
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
@ -100,47 +93,6 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
{
|
{
|
||||||
AllowSeeking.BindValueChanged(_ => updateBarVisibility(), true);
|
AllowSeeking.BindValueChanged(_ => updateBarVisibility(), true);
|
||||||
ShowGraph.BindValueChanged(_ => updateGraphVisibility(), true);
|
ShowGraph.BindValueChanged(_ => updateGraphVisibility(), true);
|
||||||
|
|
||||||
migrateSettingFromConfig();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// This setting has been migrated to a per-component level.
|
|
||||||
/// Only take the value from the config if it is in a non-default state (then reset it to default so it only applies once).
|
|
||||||
///
|
|
||||||
/// Can be removed 20221027.
|
|
||||||
/// </summary>
|
|
||||||
private void migrateSettingFromConfig()
|
|
||||||
{
|
|
||||||
Bindable<bool> configShowGraph = config.GetBindable<bool>(OsuSetting.ShowProgressGraph);
|
|
||||||
|
|
||||||
if (!configShowGraph.IsDefault)
|
|
||||||
{
|
|
||||||
ShowGraph.Value = configShowGraph.Value;
|
|
||||||
|
|
||||||
// This is pretty ugly, but the only way to make this stick...
|
|
||||||
var skinnableTarget = this.FindClosestParent<ISkinnableTarget>();
|
|
||||||
|
|
||||||
if (skinnableTarget != null)
|
|
||||||
{
|
|
||||||
// If the skin is not mutable, a mutable instance will be created, causing this migration logic to run again on the correct skin.
|
|
||||||
// Therefore we want to avoid resetting the config value on this invocation.
|
|
||||||
if (skinManager.EnsureMutableSkin())
|
|
||||||
return;
|
|
||||||
|
|
||||||
// If `EnsureMutableSkin` actually changed the skin, default layout may take a frame to apply.
|
|
||||||
// See `SkinnableTargetComponentsContainer`'s use of ScheduleAfterChildren.
|
|
||||||
ScheduleAfterChildren(() =>
|
|
||||||
{
|
|
||||||
var skin = skinManager.CurrentSkin.Value;
|
|
||||||
skin.UpdateDrawableTarget(skinnableTarget);
|
|
||||||
|
|
||||||
skinManager.Save(skin);
|
|
||||||
});
|
|
||||||
|
|
||||||
configShowGraph.SetDefault();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void PopIn()
|
protected override void PopIn()
|
||||||
|
Loading…
Reference in New Issue
Block a user