Merge branch 'master' into no-more-difficulty-control-points-info

This commit is contained in:
Dean Herbert
2021-09-28 13:53:56 +09:00
307 changed files with 6952 additions and 2297 deletions

View File

@ -0,0 +1,27 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Graphics.Sprites;
using osu.Game.Beatmaps;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Screens.Edit.Components.Menus
{
public class DifficultyMenuItem : StatefulMenuItem<bool>
{
public BeatmapInfo Beatmap { get; }
public DifficultyMenuItem(BeatmapInfo beatmapInfo, bool selected, Action<BeatmapInfo> difficultyChangeFunc)
: base(beatmapInfo.Version ?? "(unnamed)", null)
{
Beatmap = beatmapInfo;
State.Value = selected;
if (!selected)
Action.Value = () => difficultyChangeFunc.Invoke(beatmapInfo);
}
public override IconUsage? GetIconForState(bool state) => state ? (IconUsage?)FontAwesome.Solid.Check : null;
}
}

View File

@ -228,9 +228,9 @@ namespace osu.Game.Screens.Edit.Compose.Components
return false;
}
public bool OnPressed(PlatformAction action)
public bool OnPressed(KeyBindingPressEvent<PlatformAction> e)
{
switch (action)
switch (e.Action)
{
case PlatformAction.SelectAll:
SelectAll();
@ -240,7 +240,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
return false;
}
public void OnReleased(PlatformAction action)
public void OnReleased(KeyBindingReleaseEvent<PlatformAction> e)
{
}

View File

@ -1,12 +1,12 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using osu.Framework.Bindables;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Types;
namespace osu.Game.Screens.Edit.Compose.Components
{
@ -15,69 +15,62 @@ namespace osu.Game.Screens.Edit.Compose.Components
/// </summary>
public sealed class HitObjectOrderedSelectionContainer : Container<SelectionBlueprint<HitObject>>
{
[Resolved]
private EditorBeatmap editorBeatmap { get; set; }
protected override void LoadComplete()
{
base.LoadComplete();
editorBeatmap.HitObjectUpdated += hitObjectUpdated;
}
private void hitObjectUpdated(HitObject _) => SortInternal();
public override void Add(SelectionBlueprint<HitObject> drawable)
{
SortInternal();
base.Add(drawable);
bindStartTime(drawable);
}
public override bool Remove(SelectionBlueprint<HitObject> drawable)
{
if (!base.Remove(drawable))
return false;
unbindStartTime(drawable);
return true;
}
public override void Clear(bool disposeChildren)
{
base.Clear(disposeChildren);
unbindAllStartTimes();
}
private readonly Dictionary<SelectionBlueprint<HitObject>, IBindable> startTimeMap = new Dictionary<SelectionBlueprint<HitObject>, IBindable>();
private void bindStartTime(SelectionBlueprint<HitObject> blueprint)
{
var bindable = blueprint.Item.StartTimeBindable.GetBoundCopy();
bindable.BindValueChanged(_ =>
{
if (LoadState >= LoadState.Ready)
SortInternal();
});
startTimeMap[blueprint] = bindable;
}
private void unbindStartTime(SelectionBlueprint<HitObject> blueprint)
{
startTimeMap[blueprint].UnbindAll();
startTimeMap.Remove(blueprint);
}
private void unbindAllStartTimes()
{
foreach (var kvp in startTimeMap)
kvp.Value.UnbindAll();
startTimeMap.Clear();
SortInternal();
return base.Remove(drawable);
}
protected override int Compare(Drawable x, Drawable y)
{
var xObj = (SelectionBlueprint<HitObject>)x;
var yObj = (SelectionBlueprint<HitObject>)y;
var xObj = ((SelectionBlueprint<HitObject>)x).Item;
var yObj = ((SelectionBlueprint<HitObject>)y).Item;
// Put earlier blueprints towards the end of the list, so they handle input first
int i = yObj.Item.StartTime.CompareTo(xObj.Item.StartTime);
if (i != 0) return i;
int result = yObj.StartTime.CompareTo(xObj.StartTime);
if (result != 0) return result;
// Fall back to end time if the start time is equal.
i = yObj.Item.GetEndTime().CompareTo(xObj.Item.GetEndTime());
result = yObj.GetEndTime().CompareTo(xObj.GetEndTime());
if (result != 0) return result;
return i == 0 ? CompareReverseChildID(y, x) : i;
// As a final fallback, use combo information if available.
if (xObj is IHasComboInformation xHasCombo && yObj is IHasComboInformation yHasCombo)
{
result = yHasCombo.ComboIndex.CompareTo(xHasCombo.ComboIndex);
if (result != 0) return result;
result = yHasCombo.IndexInCurrentCombo.CompareTo(xHasCombo.IndexInCurrentCombo);
if (result != 0) return result;
}
return CompareReverseChildID(y, x);
}
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);
if (editorBeatmap != null)
editorBeatmap.HitObjectUpdated -= hitObjectUpdated;
}
}
}

View File

@ -0,0 +1,113 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Layout;
using osuTK;
namespace osu.Game.Screens.Edit.Compose.Components
{
public class RectangularPositionSnapGrid : CompositeDrawable
{
/// <summary>
/// The position of the origin of this <see cref="RectangularPositionSnapGrid"/> in local coordinates.
/// </summary>
public Vector2 StartPosition { get; }
private Vector2 spacing = Vector2.One;
/// <summary>
/// The spacing between grid lines of this <see cref="RectangularPositionSnapGrid"/>.
/// </summary>
public Vector2 Spacing
{
get => spacing;
set
{
if (spacing.X <= 0 || spacing.Y <= 0)
throw new ArgumentException("Grid spacing must be positive.");
spacing = value;
gridCache.Invalidate();
}
}
private readonly LayoutValue gridCache = new LayoutValue(Invalidation.RequiredParentSizeToFit);
public RectangularPositionSnapGrid(Vector2 startPosition)
{
StartPosition = startPosition;
AddLayout(gridCache);
}
protected override void Update()
{
base.Update();
if (!gridCache.IsValid)
{
ClearInternal();
createContent();
gridCache.Validate();
}
}
private void createContent()
{
var drawSize = DrawSize;
generateGridLines(Direction.Horizontal, StartPosition.Y, 0, -Spacing.Y);
generateGridLines(Direction.Horizontal, StartPosition.Y, drawSize.Y, Spacing.Y);
generateGridLines(Direction.Vertical, StartPosition.X, 0, -Spacing.X);
generateGridLines(Direction.Vertical, StartPosition.X, drawSize.X, Spacing.X);
}
private void generateGridLines(Direction direction, float startPosition, float endPosition, float step)
{
int index = 0;
float currentPosition = startPosition;
while ((endPosition - currentPosition) * Math.Sign(step) > 0)
{
var gridLine = new Box
{
Colour = Colour4.White,
Alpha = index == 0 ? 0.3f : 0.1f,
EdgeSmoothness = new Vector2(0.2f)
};
if (direction == Direction.Horizontal)
{
gridLine.RelativeSizeAxes = Axes.X;
gridLine.Height = 1;
gridLine.Y = currentPosition;
}
else
{
gridLine.RelativeSizeAxes = Axes.Y;
gridLine.Width = 1;
gridLine.X = currentPosition;
}
AddInternal(gridLine);
index += 1;
currentPosition = startPosition + index * step;
}
}
public Vector2 GetSnappedPosition(Vector2 original)
{
Vector2 relativeToStart = original - StartPosition;
Vector2 offset = Vector2.Divide(relativeToStart, Spacing);
Vector2 roundedOffset = new Vector2(MathF.Round(offset.X), MathF.Round(offset.Y));
return StartPosition + Vector2.Multiply(roundedOffset, Spacing);
}
}
}

View File

@ -137,9 +137,9 @@ namespace osu.Game.Screens.Edit.Compose.Components
/// <returns>Whether any items could be reversed.</returns>
public virtual bool HandleReverse() => false;
public bool OnPressed(PlatformAction action)
public bool OnPressed(KeyBindingPressEvent<PlatformAction> e)
{
switch (action)
switch (e.Action)
{
case PlatformAction.Delete:
DeleteSelected();
@ -149,7 +149,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
return false;
}
public void OnReleased(PlatformAction action)
public void OnReleased(KeyBindingReleaseEvent<PlatformAction> e)
{
}
@ -191,7 +191,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
/// <param name="blueprint">The blueprint.</param>
/// <param name="e">The mouse event responsible for selection.</param>
/// <returns>Whether a selection was performed.</returns>
internal bool MouseDownSelectionRequested(SelectionBlueprint<T> blueprint, MouseButtonEvent e)
internal virtual bool MouseDownSelectionRequested(SelectionBlueprint<T> blueprint, MouseButtonEvent e)
{
if (e.ShiftPressed && e.Button == MouseButton.Right)
{

View File

@ -1,12 +1,19 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events;
using osu.Game.Input.Bindings;
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Objects;
using osuTK;
using osuTK.Input;
namespace osu.Game.Screens.Edit.Compose.Components.Timeline
{
@ -20,9 +27,9 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
// for now we always allow movement. snapping is provided by the Timeline's "distance" snap implementation
public override bool HandleMovement(MoveSelectionEvent<HitObject> moveEvent) => true;
public bool OnPressed(GlobalAction action)
public bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
{
switch (action)
switch (e.Action)
{
case GlobalAction.EditorNudgeLeft:
nudgeSelection(-1);
@ -36,7 +43,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
return false;
}
public void OnReleased(GlobalAction action)
public void OnReleased(KeyBindingReleaseEvent<GlobalAction> e)
{
}
@ -61,5 +68,62 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
EditorBeatmap.Update(h);
});
}
/// <summary>
/// The "pivot" object, used in range selection mode.
/// When in range selection, the range to select is determined by the pivot object
/// (last existing object interacted with prior to holding down Shift)
/// and by the object clicked last when Shift was pressed.
/// </summary>
[CanBeNull]
private HitObject pivot;
internal override bool MouseDownSelectionRequested(SelectionBlueprint<HitObject> blueprint, MouseButtonEvent e)
{
if (e.ShiftPressed && e.Button == MouseButton.Left && pivot != null)
{
handleRangeSelection(blueprint, e.ControlPressed);
return true;
}
bool result = base.MouseDownSelectionRequested(blueprint, e);
// ensure that the object wasn't removed by the base implementation before making it the new pivot.
if (EditorBeatmap.HitObjects.Contains(blueprint.Item))
pivot = blueprint.Item;
return result;
}
/// <summary>
/// Handles a request for range selection (triggered when Shift is held down).
/// </summary>
/// <param name="blueprint">The blueprint which was clicked in range selection mode.</param>
/// <param name="cumulative">
/// Whether the selection should be cumulative.
/// In cumulative mode, consecutive range selections will shift the pivot (which usually stays fixed for the duration of a range selection)
/// and will never deselect an object that was previously selected.
/// </param>
private void handleRangeSelection(SelectionBlueprint<HitObject> blueprint, bool cumulative)
{
var clickedObject = blueprint.Item;
Debug.Assert(pivot != null);
double rangeStart = Math.Min(clickedObject.StartTime, pivot.StartTime);
double rangeEnd = Math.Max(clickedObject.GetEndTime(), pivot.GetEndTime());
var newSelection = new HashSet<HitObject>(EditorBeatmap.HitObjects.Where(obj => isInRange(obj, rangeStart, rangeEnd)));
if (cumulative)
{
pivot = clickedObject;
newSelection.UnionWith(EditorBeatmap.SelectedHitObjects);
}
EditorBeatmap.SelectedHitObjects.Clear();
EditorBeatmap.SelectedHitObjects.AddRange(newSelection);
bool isInRange(HitObject hitObject, double start, double end)
=> hitObject.StartTime >= start && hitObject.GetEndTime() <= end;
}
}
}

View File

@ -9,6 +9,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Input;
using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events;
using osu.Framework.Platform;
using osu.Game.Beatmaps;
using osu.Game.Extensions;
@ -77,15 +78,15 @@ namespace osu.Game.Screens.Edit.Compose
#region Input Handling
public bool OnPressed(PlatformAction action)
public bool OnPressed(KeyBindingPressEvent<PlatformAction> e)
{
if (action == PlatformAction.Copy)
host.GetClipboard().SetText(formatSelectionAsString());
if (e.Action == PlatformAction.Copy)
host.GetClipboard()?.SetText(formatSelectionAsString());
return false;
}
public void OnReleased(PlatformAction action)
public void OnReleased(KeyBindingReleaseEvent<PlatformAction> e)
{
}

View File

@ -5,6 +5,7 @@ using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using JetBrains.Annotations;
using osu.Framework;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
@ -55,7 +56,7 @@ namespace osu.Game.Screens.Edit
public override bool DisallowExternalBeatmapRulesetChanges => true;
public override bool AllowTrackAdjustments => false;
public override bool? AllowTrackAdjustments => false;
protected bool HasUnsavedChanges => lastSavedHash != changeHandler.CurrentStateHash;
@ -75,6 +76,9 @@ namespace osu.Game.Screens.Edit
private Container<EditorScreen> screenContainer;
[CanBeNull]
private readonly EditorLoader loader;
private EditorScreen currentScreen;
private readonly BindableBeatDivisor beatDivisor = new BindableBeatDivisor();
@ -101,6 +105,11 @@ namespace osu.Game.Screens.Edit
[Resolved]
private MusicController music { get; set; }
public Editor(EditorLoader loader = null)
{
this.loader = loader;
}
[BackgroundDependencyLoader]
private void load(OsuColour colours, OsuConfigManager config)
{
@ -308,6 +317,16 @@ namespace osu.Game.Screens.Edit
/// </summary>
public void UpdateClockSource() => clock.ChangeSource(Beatmap.Value.Track);
/// <summary>
/// Restore the editor to a provided state.
/// </summary>
/// <param name="state">The state to restore.</param>
public void RestoreState([NotNull] EditorState state) => Schedule(() =>
{
clock.Seek(state.Time);
clipboard.Value = state.ClipboardContent;
});
protected void Save()
{
// no longer new after first user-triggered save.
@ -328,9 +347,9 @@ namespace osu.Game.Screens.Edit
clock.ProcessFrame();
}
public bool OnPressed(PlatformAction action)
public bool OnPressed(KeyBindingPressEvent<PlatformAction> e)
{
switch (action)
switch (e.Action)
{
case PlatformAction.Cut:
Cut();
@ -360,7 +379,7 @@ namespace osu.Game.Screens.Edit
return false;
}
public void OnReleased(PlatformAction action)
public void OnReleased(KeyBindingReleaseEvent<PlatformAction> e)
{
}
@ -415,9 +434,9 @@ namespace osu.Game.Screens.Edit
return true;
}
public bool OnPressed(GlobalAction action)
public bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
{
switch (action)
switch (e.Action)
{
case GlobalAction.Back:
// as we don't want to display the back button, manual handling of exit action is required.
@ -449,7 +468,7 @@ namespace osu.Game.Screens.Edit
}
}
public void OnReleased(GlobalAction action)
public void OnReleased(KeyBindingReleaseEvent<GlobalAction> e)
{
}
@ -489,7 +508,7 @@ namespace osu.Game.Screens.Edit
if (isNewBeatmap || HasUnsavedChanges)
{
dialogOverlay?.Push(new PromptForSaveDialog(confirmExit, confirmExitWithSave));
dialogOverlay?.Push(new PromptForSaveDialog(confirmExit, confirmExitWithSave, cancelExit));
return true;
}
}
@ -703,11 +722,42 @@ namespace osu.Game.Screens.Edit
if (RuntimeInfo.IsDesktop)
fileMenuItems.Add(new EditorMenuItem("Export package", MenuItemType.Standard, exportBeatmap));
fileMenuItems.Add(new EditorMenuItemSpacer());
var beatmapSet = beatmapManager.QueryBeatmapSet(bs => bs.ID == Beatmap.Value.BeatmapSetInfo.ID) ?? playableBeatmap.BeatmapInfo.BeatmapSet;
var difficultyItems = new List<MenuItem>();
foreach (var rulesetBeatmaps in beatmapSet.Beatmaps.GroupBy(b => b.RulesetID).OrderBy(group => group.Key))
{
if (difficultyItems.Count > 0)
difficultyItems.Add(new EditorMenuItemSpacer());
foreach (var beatmap in rulesetBeatmaps.OrderBy(b => b.StarDifficulty))
difficultyItems.Add(createDifficultyMenuItem(beatmap));
}
fileMenuItems.Add(new EditorMenuItem("Change difficulty") { Items = difficultyItems });
fileMenuItems.Add(new EditorMenuItemSpacer());
fileMenuItems.Add(new EditorMenuItem("Exit", MenuItemType.Standard, this.Exit));
return fileMenuItems;
}
private DifficultyMenuItem createDifficultyMenuItem(BeatmapInfo beatmapInfo)
{
bool isCurrentDifficulty = playableBeatmap.BeatmapInfo.Equals(beatmapInfo);
return new DifficultyMenuItem(beatmapInfo, isCurrentDifficulty, SwitchToDifficulty);
}
protected void SwitchToDifficulty(BeatmapInfo nextBeatmap) => loader?.ScheduleDifficultySwitch(nextBeatmap, new EditorState
{
Time = clock.CurrentTimeAccurate,
ClipboardContent = editorBeatmap.BeatmapInfo.RulesetID == nextBeatmap.RulesetID ? clipboard.Value : string.Empty
});
private void cancelExit() => loader?.CancelPendingDifficultySwitch();
public double SnapTime(double time, double? referenceTime) => editorBeatmap.SnapTime(time, referenceTime);
public double GetBeatLengthAtTime(double referenceTime) => editorBeatmap.GetBeatLengthAtTime(referenceTime);

View File

@ -0,0 +1,110 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Screens;
using osu.Framework.Threading;
using osu.Game.Beatmaps;
using osu.Game.Graphics.UserInterface;
using osu.Game.Screens.Menu;
using osu.Game.Screens.Play;
namespace osu.Game.Screens.Edit
{
/// <summary>
/// Transition screen for the editor.
/// Used to avoid backing out to main menu/song select when switching difficulties from within the editor.
/// </summary>
public class EditorLoader : ScreenWithBeatmapBackground
{
/// <summary>
/// The stored state from the last editor opened.
/// This will be read by the next editor instance to be opened to restore any relevant previous state.
/// </summary>
[CanBeNull]
private EditorState state;
public override float BackgroundParallaxAmount => 0.1f;
public override bool AllowBackButton => false;
public override bool HideOverlaysOnEnter => true;
public override bool DisallowExternalBeatmapRulesetChanges => true;
[Resolved]
private BeatmapManager beatmapManager { get; set; }
[CanBeNull]
private ScheduledDelegate scheduledDifficultySwitch;
[BackgroundDependencyLoader]
private void load()
{
AddRangeInternal(new Drawable[]
{
new LoadingSpinner(true)
{
State = { Value = Visibility.Visible },
}
});
}
protected virtual Editor CreateEditor() => new Editor(this);
protected override void LogoArriving(OsuLogo logo, bool resuming)
{
base.LogoArriving(logo, resuming);
if (!resuming)
{
// the push cannot happen in OnEntering() or similar (even if scheduled), because the transition from main menu will look bad.
// that is because this screen pushing the editor makes it no longer current, and OsuScreen checks if the screen is current
// before enqueueing this screen's LogoArriving onto the logo animation sequence.
pushEditor();
}
}
public void ScheduleDifficultySwitch(BeatmapInfo nextBeatmap, EditorState editorState)
{
scheduledDifficultySwitch?.Cancel();
ValidForResume = true;
this.MakeCurrent();
scheduledDifficultySwitch = Schedule(() =>
{
Beatmap.Value = beatmapManager.GetWorkingBeatmap(nextBeatmap);
state = editorState;
// This screen is a weird exception to the rule that nothing after song select changes the global beatmap.
// Because of this, we need to update the background stack's beatmap to match.
// If we don't do this, the editor will see a discrepancy and create a new background, along with an unnecessary transition.
ApplyToBackground(b => b.Beatmap = Beatmap.Value);
pushEditor();
});
}
private void pushEditor()
{
var editor = CreateEditor();
this.Push(editor);
if (state != null)
editor.RestoreState(state);
ValidForResume = false;
}
public void CancelPendingDifficultySwitch()
{
scheduledDifficultySwitch?.Cancel();
ValidForResume = false;
}
}
}

View File

@ -0,0 +1,23 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable enable
namespace osu.Game.Screens.Edit
{
/// <summary>
/// Structure used to convey the general state of an <see cref="Editor"/> instance.
/// </summary>
public class EditorState
{
/// <summary>
/// The current audio time.
/// </summary>
public double Time { get; set; }
/// <summary>
/// The editor clipboard content.
/// </summary>
public string ClipboardContent { get; set; } = string.Empty;
}
}

View File

@ -9,7 +9,7 @@ namespace osu.Game.Screens.Edit
{
public class PromptForSaveDialog : PopupDialog
{
public PromptForSaveDialog(Action exit, Action saveAndExit)
public PromptForSaveDialog(Action exit, Action saveAndExit, Action cancel)
{
HeaderText = "Did you want to save your changes?";
@ -30,6 +30,7 @@ namespace osu.Game.Screens.Edit
new PopupDialogCancelButton
{
Text = @"Oops, continue editing",
Action = cancel
},
};
}

View File

@ -25,6 +25,7 @@ namespace osu.Game.Screens.Edit.Setup
private LabelledSwitchButton widescreenSupport;
private LabelledSwitchButton epilepsyWarning;
private LabelledSwitchButton letterboxDuringBreaks;
private LabelledSwitchButton samplesMatchPlaybackRate;
public override LocalisableString Title => "Design";
@ -79,6 +80,12 @@ namespace osu.Game.Screens.Edit.Setup
Label = "Letterbox during breaks",
Description = "Adds horizontal letterboxing to give a cinematic look during breaks.",
Current = { Value = Beatmap.BeatmapInfo.LetterboxInBreaks }
},
samplesMatchPlaybackRate = new LabelledSwitchButton
{
Label = "Samples match playback rate",
Description = "When enabled, all samples will speed up or slow down when rate-changing mods are enabled.",
Current = { Value = Beatmap.BeatmapInfo.SamplesMatchPlaybackRate }
}
};
}
@ -96,6 +103,7 @@ namespace osu.Game.Screens.Edit.Setup
widescreenSupport.Current.BindValueChanged(_ => updateBeatmap());
epilepsyWarning.Current.BindValueChanged(_ => updateBeatmap());
letterboxDuringBreaks.Current.BindValueChanged(_ => updateBeatmap());
samplesMatchPlaybackRate.Current.BindValueChanged(_ => updateBeatmap());
}
private void updateCountdownSettingsVisibility() => CountdownSettings.FadeTo(EnableCountdown.Current.Value ? 1 : 0);
@ -115,6 +123,7 @@ namespace osu.Game.Screens.Edit.Setup
Beatmap.BeatmapInfo.WidescreenStoryboard = widescreenSupport.Current.Value;
Beatmap.BeatmapInfo.EpilepsyWarning = epilepsyWarning.Current.Value;
Beatmap.BeatmapInfo.LetterboxInBreaks = letterboxDuringBreaks.Current.Value;
Beatmap.BeatmapInfo.SamplesMatchPlaybackRate = samplesMatchPlaybackRate.Current.Value;
}
}
}

View File

@ -8,6 +8,7 @@ using osu.Framework.Bindables;
using osu.Framework.Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Input.Events;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Input.Bindings;
@ -52,7 +53,7 @@ namespace osu.Game.Screens.Edit.Verify
if (issue.Time != null)
{
clock.Seek(issue.Time.Value);
editor.OnPressed(GlobalAction.EditorComposeMode);
editor.OnPressed(new KeyBindingPressEvent<GlobalAction>(GetContainingInputManager().CurrentState, GlobalAction.EditorComposeMode));
}
if (!issue.HitObjects.Any())