1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 13:22:55 +08:00

Move timeline toggle controls to "view" menu

This commit is contained in:
Bartłomiej Dach 2024-06-17 10:16:40 +02:00
parent 030853ed5a
commit b42752c9f0
No known key found for this signature in database
6 changed files with 47 additions and 71 deletions

View File

@ -208,6 +208,9 @@ namespace osu.Game.Configuration
SetDefault(OsuSetting.ComboColourNormalisationAmount, 0.2f, 0f, 1f, 0.01f);
SetDefault<UserStatus?>(OsuSetting.UserOnlineStatus, null);
SetDefault(OsuSetting.EditorTimelineShowTimingChanges, true);
SetDefault(OsuSetting.EditorTimelineShowTicks, true);
}
protected override bool CheckLookupContainsPrivateInformation(OsuSetting lookup)
@ -439,5 +442,7 @@ namespace osu.Game.Configuration
UserOnlineStatus,
MultiplayerRoomFilter,
HideCountryFlags,
EditorTimelineShowTimingChanges,
EditorTimelineShowTicks,
}
}

View File

@ -99,16 +99,6 @@ namespace osu.Game.Localisation
/// </summary>
public static LocalisableString TestBeatmap => new TranslatableString(getKey(@"test_beatmap"), @"Test!");
/// <summary>
/// "Waveform"
/// </summary>
public static LocalisableString TimelineWaveform => new TranslatableString(getKey(@"timeline_waveform"), @"Waveform");
/// <summary>
/// "Ticks"
/// </summary>
public static LocalisableString TimelineTicks => new TranslatableString(getKey(@"timeline_ticks"), @"Ticks");
/// <summary>
/// "{0:0}&#176;"
/// </summary>
@ -134,6 +124,21 @@ namespace osu.Game.Localisation
/// </summary>
public static LocalisableString FailedToParseEditorLink => new TranslatableString(getKey(@"failed_to_parse_edtior_link"), @"Failed to parse editor link");
/// <summary>
/// "Timeline"
/// </summary>
public static LocalisableString Timeline => new TranslatableString(getKey(@"timeline"), @"Timeline");
/// <summary>
/// "Show timing changes"
/// </summary>
public static LocalisableString TimelineShowTimingChanges => new TranslatableString(getKey(@"timeline_show_timing_changes"), @"Show timing changes");
/// <summary>
/// "Show ticks"
/// </summary>
public static LocalisableString TimelineShowTicks => new TranslatableString(getKey(@"timeline_show_ticks"), @"Show ticks");
private static string getKey(string key) => $@"{prefix}:{key}";
}
}

View File

@ -30,12 +30,6 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
private readonly Drawable userContent;
public readonly Bindable<bool> WaveformVisible = new Bindable<bool>();
public readonly Bindable<bool> ControlPointsVisible = new Bindable<bool>();
public readonly Bindable<bool> TicksVisible = new Bindable<bool>();
[Resolved]
private EditorClock editorClock { get; set; }
@ -88,6 +82,8 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
private Container mainContent;
private Bindable<float> waveformOpacity;
private Bindable<bool> controlPointsVisible;
private Bindable<bool> ticksVisible;
private double trackLengthForZoom;
@ -139,6 +135,8 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
});
waveformOpacity = config.GetBindable<float>(OsuSetting.EditorWaveformOpacity);
controlPointsVisible = config.GetBindable<bool>(OsuSetting.EditorTimelineShowTimingChanges);
ticksVisible = config.GetBindable<bool>(OsuSetting.EditorTimelineShowTicks);
track.BindTo(editorClock.Track);
track.BindValueChanged(_ =>
@ -168,12 +166,11 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
{
base.LoadComplete();
WaveformVisible.BindValueChanged(_ => updateWaveformOpacity());
waveformOpacity.BindValueChanged(_ => updateWaveformOpacity(), true);
TicksVisible.BindValueChanged(visible => ticks.FadeTo(visible.NewValue ? 1 : 0, 200, Easing.OutQuint), true);
ticksVisible.BindValueChanged(visible => ticks.FadeTo(visible.NewValue ? 1 : 0, 200, Easing.OutQuint), true);
ControlPointsVisible.BindValueChanged(visible =>
controlPointsVisible.BindValueChanged(visible =>
{
if (visible.NewValue)
{
@ -195,7 +192,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
}
private void updateWaveformOpacity() =>
waveform.FadeTo(WaveformVisible.Value ? waveformOpacity.Value : 0, 200, Easing.OutQuint);
waveform.FadeTo(waveformOpacity.Value, 200, Easing.OutQuint);
protected override void Update()
{

View File

@ -7,10 +7,7 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
using osu.Game.Localisation;
using osu.Game.Overlays;
using osu.Game.Resources.Localisation.Web;
using osu.Game.Rulesets.Edit;
using osuTK;
@ -33,10 +30,6 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
[BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider, OsuColour colours)
{
OsuCheckbox waveformCheckbox;
OsuCheckbox controlPointsCheckbox;
OsuCheckbox ticksCheckbox;
const float padding = 10;
InternalChildren = new Drawable[]
@ -51,7 +44,6 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
},
ColumnDimensions = new[]
{
new Dimension(GridSizeMode.Absolute, 135),
new Dimension(),
new Dimension(GridSizeMode.Absolute, 35),
new Dimension(GridSizeMode.Absolute, HitObjectComposer.TOOLBOX_CONTRACTED_SIZE_RIGHT - padding * 2),
@ -60,44 +52,6 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
{
new Drawable[]
{
new Container
{
RelativeSizeAxes = Axes.Both,
Name = @"Toggle controls",
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = colourProvider.Background2,
},
new FillFlowContainer
{
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding(padding),
Direction = FillDirection.Vertical,
Spacing = new Vector2(0, 4),
Children = new[]
{
waveformCheckbox = new OsuCheckbox(nubSize: 30f)
{
LabelText = EditorStrings.TimelineWaveform,
Current = { Value = true },
},
ticksCheckbox = new OsuCheckbox(nubSize: 30f)
{
LabelText = EditorStrings.TimelineTicks,
Current = { Value = true },
},
controlPointsCheckbox = new OsuCheckbox(nubSize: 30f)
{
LabelText = BeatmapsetsStrings.ShowStatsBpm,
Current = { Value = true },
},
}
}
}
},
new Container
{
RelativeSizeAxes = Axes.X,
@ -167,10 +121,6 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
},
}
};
Timeline.WaveformVisible.BindTo(waveformCheckbox.Current);
Timeline.ControlPointsVisible.BindTo(controlPointsCheckbox.Current);
Timeline.TicksVisible.BindTo(ticksCheckbox.Current);
}
}
}

View File

@ -211,6 +211,8 @@ namespace osu.Game.Screens.Edit
private Bindable<bool> editorHitMarkers;
private Bindable<bool> editorAutoSeekOnPlacement;
private Bindable<bool> editorLimitedDistanceSnap;
private Bindable<bool> editorTimelineShowTimingChanges;
private Bindable<bool> editorTimelineShowTicks;
public Editor(EditorLoader loader = null)
{
@ -305,6 +307,8 @@ namespace osu.Game.Screens.Edit
editorHitMarkers = config.GetBindable<bool>(OsuSetting.EditorShowHitMarkers);
editorAutoSeekOnPlacement = config.GetBindable<bool>(OsuSetting.EditorAutoSeekOnPlacement);
editorLimitedDistanceSnap = config.GetBindable<bool>(OsuSetting.EditorLimitedDistanceSnap);
editorTimelineShowTimingChanges = config.GetBindable<bool>(OsuSetting.EditorTimelineShowTimingChanges);
editorTimelineShowTicks = config.GetBindable<bool>(OsuSetting.EditorTimelineShowTicks);
AddInternal(new OsuContextMenuContainer
{
@ -357,7 +361,21 @@ namespace osu.Game.Screens.Edit
{
Items = new MenuItem[]
{
new WaveformOpacityMenuItem(config.GetBindable<float>(OsuSetting.EditorWaveformOpacity)),
new MenuItem(EditorStrings.Timeline)
{
Items =
[
new WaveformOpacityMenuItem(config.GetBindable<float>(OsuSetting.EditorWaveformOpacity)),
new ToggleMenuItem(EditorStrings.TimelineShowTimingChanges)
{
State = { BindTarget = editorTimelineShowTimingChanges }
},
new ToggleMenuItem(EditorStrings.TimelineShowTicks)
{
State = { BindTarget = editorTimelineShowTicks }
},
]
},
new BackgroundDimMenuItem(editorBackgroundDim),
new ToggleMenuItem(EditorStrings.ShowHitMarkers)
{

View File

@ -20,6 +20,7 @@ namespace osu.Game.Screens.Edit
{
Items = new[]
{
createMenuItem(0f),
createMenuItem(0.25f),
createMenuItem(0.5f),
createMenuItem(0.75f),