mirror of
https://github.com/ppy/osu
synced 2024-12-15 19:36:34 +00:00
Merge pull request #25153 from peppy/store-speed-change-config
Persist the state of "show speed changes" between editor sessions
This commit is contained in:
commit
5833c20be5
@ -184,6 +184,7 @@ namespace osu.Game.Configuration
|
|||||||
SetDefault(OsuSetting.EditorShowHitMarkers, true);
|
SetDefault(OsuSetting.EditorShowHitMarkers, true);
|
||||||
SetDefault(OsuSetting.EditorAutoSeekOnPlacement, true);
|
SetDefault(OsuSetting.EditorAutoSeekOnPlacement, true);
|
||||||
SetDefault(OsuSetting.EditorLimitedDistanceSnap, false);
|
SetDefault(OsuSetting.EditorLimitedDistanceSnap, false);
|
||||||
|
SetDefault(OsuSetting.EditorShowSpeedChanges, false);
|
||||||
|
|
||||||
SetDefault(OsuSetting.LastProcessedMetadataId, -1);
|
SetDefault(OsuSetting.LastProcessedMetadataId, -1);
|
||||||
|
|
||||||
@ -407,5 +408,6 @@ namespace osu.Game.Configuration
|
|||||||
EditorLimitedDistanceSnap,
|
EditorLimitedDistanceSnap,
|
||||||
ReplaySettingsOverlay,
|
ReplaySettingsOverlay,
|
||||||
AutomaticallyDownloadMissingBeatmaps,
|
AutomaticallyDownloadMissingBeatmaps,
|
||||||
|
EditorShowSpeedChanges
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ using osu.Framework.Bindables;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Rulesets.UI.Scrolling;
|
using osu.Game.Rulesets.UI.Scrolling;
|
||||||
@ -18,6 +19,7 @@ namespace osu.Game.Rulesets.Edit
|
|||||||
where TObject : HitObject
|
where TObject : HitObject
|
||||||
{
|
{
|
||||||
private readonly Bindable<TernaryState> showSpeedChanges = new Bindable<TernaryState>();
|
private readonly Bindable<TernaryState> showSpeedChanges = new Bindable<TernaryState>();
|
||||||
|
private Bindable<bool> configShowSpeedChanges = null!;
|
||||||
|
|
||||||
protected ScrollingHitObjectComposer(Ruleset ruleset)
|
protected ScrollingHitObjectComposer(Ruleset ruleset)
|
||||||
: base(ruleset)
|
: base(ruleset)
|
||||||
@ -25,7 +27,7 @@ namespace osu.Game.Rulesets.Edit
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load(OsuConfigManager config)
|
||||||
{
|
{
|
||||||
if (DrawableRuleset is ISupportConstantAlgorithmToggle toggleRuleset)
|
if (DrawableRuleset is ISupportConstantAlgorithmToggle toggleRuleset)
|
||||||
{
|
{
|
||||||
@ -44,7 +46,16 @@ namespace osu.Game.Rulesets.Edit
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
showSpeedChanges.BindValueChanged(state => toggleRuleset.ShowSpeedChanges.Value = state.NewValue == TernaryState.True, true);
|
configShowSpeedChanges = config.GetBindable<bool>(OsuSetting.EditorShowSpeedChanges);
|
||||||
|
configShowSpeedChanges.BindValueChanged(enabled => showSpeedChanges.Value = enabled.NewValue ? TernaryState.True : TernaryState.False, true);
|
||||||
|
|
||||||
|
showSpeedChanges.BindValueChanged(state =>
|
||||||
|
{
|
||||||
|
bool enabled = state.NewValue == TernaryState.True;
|
||||||
|
|
||||||
|
toggleRuleset.ShowSpeedChanges.Value = enabled;
|
||||||
|
configShowSpeedChanges.Value = enabled;
|
||||||
|
}, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user