mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 02:32:55 +08:00
Add setting to disable automatic seeking after object placement
This commit is contained in:
parent
79e1dbfb6d
commit
ddd37bb319
@ -178,6 +178,7 @@ namespace osu.Game.Configuration
|
||||
SetDefault(OsuSetting.EditorDim, 0.25f, 0f, 0.75f, 0.25f);
|
||||
SetDefault(OsuSetting.EditorWaveformOpacity, 0.25f, 0f, 1f, 0.25f);
|
||||
SetDefault(OsuSetting.EditorShowHitMarkers, true);
|
||||
SetDefault(OsuSetting.EditorSeekToHitobject, true);
|
||||
|
||||
SetDefault(OsuSetting.LastProcessedMetadataId, -1);
|
||||
|
||||
@ -374,6 +375,7 @@ namespace osu.Game.Configuration
|
||||
SeasonalBackgroundMode,
|
||||
EditorWaveformOpacity,
|
||||
EditorShowHitMarkers,
|
||||
EditorSeekToHitobject,
|
||||
DiscordRichPresence,
|
||||
AutomaticallyDownloadWhenSpectating,
|
||||
ShowOnlineExplicitContent,
|
||||
|
@ -19,6 +19,11 @@ namespace osu.Game.Localisation
|
||||
/// </summary>
|
||||
public static LocalisableString ShowHitMarkers => new TranslatableString(getKey(@"show_hit_markers"), @"Show hit markers");
|
||||
|
||||
/// <summary>
|
||||
/// "Seek to Object after placement"
|
||||
/// </summary>
|
||||
public static LocalisableString SeekToHitobject => new TranslatableString(getKey(@"seek_to_hitobject"), @"Seek to Object after placement");
|
||||
|
||||
/// <summary>
|
||||
/// "Timing"
|
||||
/// </summary>
|
||||
|
@ -17,6 +17,7 @@ using osu.Framework.Input;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Rulesets.Configuration;
|
||||
using osu.Game.Rulesets.Edit.Tools;
|
||||
@ -70,6 +71,7 @@ namespace osu.Game.Rulesets.Edit
|
||||
private FillFlowContainer togglesCollection;
|
||||
|
||||
private IBindable<bool> hasTiming;
|
||||
protected Bindable<bool> SeekToHitobject { get; private set; }
|
||||
|
||||
protected HitObjectComposer(Ruleset ruleset)
|
||||
: base(ruleset)
|
||||
@ -80,8 +82,10 @@ namespace osu.Game.Rulesets.Edit
|
||||
dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OverlayColourProvider colourProvider)
|
||||
private void load(OverlayColourProvider colourProvider, OsuConfigManager config)
|
||||
{
|
||||
SeekToHitobject = config.GetBindable<bool>(OsuSetting.EditorSeekToHitobject);
|
||||
|
||||
Config = Dependencies.Get<IRulesetConfigCache>().GetConfigFor(Ruleset);
|
||||
|
||||
try
|
||||
@ -365,6 +369,9 @@ namespace osu.Game.Rulesets.Edit
|
||||
{
|
||||
EditorBeatmap.Add(hitObject);
|
||||
|
||||
// conditionally seek based on setting
|
||||
if (!SeekToHitobject.Value) return;
|
||||
|
||||
if (EditorClock.CurrentTime < hitObject.StartTime)
|
||||
EditorClock.SeekSmoothlyTo(hitObject.StartTime);
|
||||
}
|
||||
|
@ -185,6 +185,7 @@ namespace osu.Game.Screens.Edit
|
||||
|
||||
private Bindable<float> editorBackgroundDim;
|
||||
private Bindable<bool> editorHitMarkers;
|
||||
private Bindable<bool> editorSeekToHitobject;
|
||||
|
||||
public Editor(EditorLoader loader = null)
|
||||
{
|
||||
@ -272,6 +273,7 @@ namespace osu.Game.Screens.Edit
|
||||
|
||||
editorBackgroundDim = config.GetBindable<float>(OsuSetting.EditorDim);
|
||||
editorHitMarkers = config.GetBindable<bool>(OsuSetting.EditorShowHitMarkers);
|
||||
editorSeekToHitobject = config.GetBindable<bool>(OsuSetting.EditorSeekToHitobject);
|
||||
|
||||
AddInternal(new OsuContextMenuContainer
|
||||
{
|
||||
@ -329,6 +331,10 @@ namespace osu.Game.Screens.Edit
|
||||
new ToggleMenuItem(EditorStrings.ShowHitMarkers)
|
||||
{
|
||||
State = { BindTarget = editorHitMarkers },
|
||||
},
|
||||
new ToggleMenuItem(EditorStrings.SeekToHitobject)
|
||||
{
|
||||
State = { BindTarget = editorSeekToHitobject },
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user