1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-15 13:07:24 +08:00

Add ability to hide breaks from timeline

This was another IRL request from a mapper / team member. The rationale
here is that it can be very annoying to map with break time enabled if
you have a large gap in the beatmap you are trying to fill with
hitobjects, as you are placing objects on top of a very gray area.
This commit is contained in:
Dean Herbert 2024-11-05 12:51:26 +09:00
parent 00e795cf76
commit 9d65d394d3
No known key found for this signature in database
4 changed files with 27 additions and 1 deletions

View File

@ -207,6 +207,7 @@ namespace osu.Game.Configuration
SetDefault<UserStatus?>(OsuSetting.UserOnlineStatus, null); SetDefault<UserStatus?>(OsuSetting.UserOnlineStatus, null);
SetDefault(OsuSetting.EditorTimelineShowTimingChanges, true); SetDefault(OsuSetting.EditorTimelineShowTimingChanges, true);
SetDefault(OsuSetting.EditorTimelineShowBreaks, true);
SetDefault(OsuSetting.EditorTimelineShowTicks, true); SetDefault(OsuSetting.EditorTimelineShowTicks, true);
SetDefault(OsuSetting.EditorContractSidebars, false); SetDefault(OsuSetting.EditorContractSidebars, false);
@ -439,6 +440,7 @@ namespace osu.Game.Configuration
AlwaysShowHoldForMenuButton, AlwaysShowHoldForMenuButton,
EditorContractSidebars, EditorContractSidebars,
EditorScaleOrigin, EditorScaleOrigin,
EditorRotationOrigin EditorRotationOrigin,
EditorTimelineShowBreaks,
} }
} }

View File

@ -139,6 +139,11 @@ namespace osu.Game.Localisation
/// </summary> /// </summary>
public static LocalisableString TimelineShowTimingChanges => new TranslatableString(getKey(@"timeline_show_timing_changes"), @"Show timing changes"); public static LocalisableString TimelineShowTimingChanges => new TranslatableString(getKey(@"timeline_show_timing_changes"), @"Show timing changes");
/// <summary>
/// "Show breaks"
/// </summary>
public static LocalisableString TimelineShowBreaks => new TranslatableString(getKey(@"timeline_show_breaks"), @"Show breaks");
/// <summary> /// <summary>
/// "Show ticks" /// "Show ticks"
/// </summary> /// </summary>

View File

@ -6,6 +6,7 @@ using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Caching; using osu.Framework.Caching;
using osu.Game.Beatmaps.Timing; using osu.Game.Beatmaps.Timing;
using osu.Game.Configuration;
using osu.Game.Screens.Edit.Components.Timelines.Summary.Parts; using osu.Game.Screens.Edit.Components.Timelines.Summary.Parts;
namespace osu.Game.Screens.Edit.Compose.Components.Timeline namespace osu.Game.Screens.Edit.Compose.Components.Timeline
@ -27,6 +28,15 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
private readonly BindableList<BreakPeriod> breaks = new BindableList<BreakPeriod>(); private readonly BindableList<BreakPeriod> breaks = new BindableList<BreakPeriod>();
private readonly BindableBool showBreaks = new BindableBool(true);
[BackgroundDependencyLoader]
private void load(OsuConfigManager configManager)
{
configManager.BindWith(OsuSetting.EditorTimelineShowBreaks, showBreaks);
showBreaks.BindValueChanged(_ => breakCache.Invalidate());
}
protected override void LoadBeatmap(EditorBeatmap beatmap) protected override void LoadBeatmap(EditorBeatmap beatmap)
{ {
base.LoadBeatmap(beatmap); base.LoadBeatmap(beatmap);
@ -67,6 +77,9 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
{ {
Clear(); Clear();
if (!showBreaks.Value)
return;
for (int i = 0; i < breaks.Count; i++) for (int i = 0; i < breaks.Count; i++)
{ {
var breakPeriod = breaks[i]; var breakPeriod = breaks[i];

View File

@ -214,6 +214,7 @@ namespace osu.Game.Screens.Edit
private Bindable<bool> editorAutoSeekOnPlacement; private Bindable<bool> editorAutoSeekOnPlacement;
private Bindable<bool> editorLimitedDistanceSnap; private Bindable<bool> editorLimitedDistanceSnap;
private Bindable<bool> editorTimelineShowTimingChanges; private Bindable<bool> editorTimelineShowTimingChanges;
private Bindable<bool> editorTimelineShowBreaks;
private Bindable<bool> editorTimelineShowTicks; private Bindable<bool> editorTimelineShowTicks;
private Bindable<bool> editorContractSidebars; private Bindable<bool> editorContractSidebars;
@ -323,6 +324,7 @@ namespace osu.Game.Screens.Edit
editorAutoSeekOnPlacement = config.GetBindable<bool>(OsuSetting.EditorAutoSeekOnPlacement); editorAutoSeekOnPlacement = config.GetBindable<bool>(OsuSetting.EditorAutoSeekOnPlacement);
editorLimitedDistanceSnap = config.GetBindable<bool>(OsuSetting.EditorLimitedDistanceSnap); editorLimitedDistanceSnap = config.GetBindable<bool>(OsuSetting.EditorLimitedDistanceSnap);
editorTimelineShowTimingChanges = config.GetBindable<bool>(OsuSetting.EditorTimelineShowTimingChanges); editorTimelineShowTimingChanges = config.GetBindable<bool>(OsuSetting.EditorTimelineShowTimingChanges);
editorTimelineShowBreaks = config.GetBindable<bool>(OsuSetting.EditorTimelineShowBreaks);
editorTimelineShowTicks = config.GetBindable<bool>(OsuSetting.EditorTimelineShowTicks); editorTimelineShowTicks = config.GetBindable<bool>(OsuSetting.EditorTimelineShowTicks);
editorContractSidebars = config.GetBindable<bool>(OsuSetting.EditorContractSidebars); editorContractSidebars = config.GetBindable<bool>(OsuSetting.EditorContractSidebars);
@ -390,6 +392,10 @@ namespace osu.Game.Screens.Edit
{ {
State = { BindTarget = editorTimelineShowTicks } State = { BindTarget = editorTimelineShowTicks }
}, },
new ToggleMenuItem(EditorStrings.TimelineShowBreaks)
{
State = { BindTarget = editorTimelineShowBreaks }
},
] ]
}, },
new BackgroundDimMenuItem(editorBackgroundDim), new BackgroundDimMenuItem(editorBackgroundDim),