mirror of
https://github.com/ppy/osu.git
synced 2025-03-06 03:03:05 +08:00
Merge branch 'master' into results-screen-applause
This commit is contained in:
commit
bd7c3d0d9f
@ -16,9 +16,9 @@
|
|||||||
<EmbeddedResource Include="Resources\**\*.*" />
|
<EmbeddedResource Include="Resources\**\*.*" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Label="Code Analysis">
|
<ItemGroup Label="Code Analysis">
|
||||||
<PackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.0" PrivateAssets="All" />
|
<PackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.1" PrivateAssets="All" />
|
||||||
<AdditionalFiles Include="$(MSBuildThisFileDirectory)CodeAnalysis\BannedSymbols.txt" />
|
<AdditionalFiles Include="$(MSBuildThisFileDirectory)CodeAnalysis\BannedSymbols.txt" />
|
||||||
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.0.0" PrivateAssets="All" />
|
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.1" PrivateAssets="All" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<PropertyGroup Label="Code Analysis">
|
<PropertyGroup Label="Code Analysis">
|
||||||
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)CodeAnalysis\osu.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)CodeAnalysis\osu.ruleset</CodeAnalysisRuleSet>
|
||||||
|
@ -5,6 +5,6 @@
|
|||||||
"version": "3.1.100"
|
"version": "3.1.100"
|
||||||
},
|
},
|
||||||
"msbuild-sdks": {
|
"msbuild-sdks": {
|
||||||
"Microsoft.Build.Traversal": "2.1.1"
|
"Microsoft.Build.Traversal": "2.2.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -64,8 +64,8 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private const float target_clamp = 1;
|
private const float target_clamp = 1;
|
||||||
|
|
||||||
private readonly float targetBreakMultiplier = 0;
|
private readonly float targetBreakMultiplier;
|
||||||
private readonly float easing = 1;
|
private readonly float easing;
|
||||||
|
|
||||||
private readonly CompositeDrawable restrictTo;
|
private readonly CompositeDrawable restrictTo;
|
||||||
|
|
||||||
@ -86,6 +86,9 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
{
|
{
|
||||||
this.restrictTo = restrictTo;
|
this.restrictTo = restrictTo;
|
||||||
this.beatmap = beatmap;
|
this.beatmap = beatmap;
|
||||||
|
|
||||||
|
targetBreakMultiplier = 0;
|
||||||
|
easing = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
|
@ -821,15 +821,13 @@ namespace osu.Game.Tests.Beatmaps.IO
|
|||||||
|
|
||||||
var manager = osu.Dependencies.Get<BeatmapManager>();
|
var manager = osu.Dependencies.Get<BeatmapManager>();
|
||||||
|
|
||||||
await manager.Import(temp);
|
var importedSet = await manager.Import(temp);
|
||||||
|
|
||||||
var imported = manager.GetAllUsableBeatmapSets();
|
|
||||||
|
|
||||||
ensureLoaded(osu);
|
ensureLoaded(osu);
|
||||||
|
|
||||||
waitForOrAssert(() => !File.Exists(temp), "Temporary file still exists after standard import", 5000);
|
waitForOrAssert(() => !File.Exists(temp), "Temporary file still exists after standard import", 5000);
|
||||||
|
|
||||||
return imported.LastOrDefault();
|
return manager.GetAllUsableBeatmapSets().Find(beatmapSet => beatmapSet.ID == importedSet.ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void deleteBeatmapSet(BeatmapSetInfo imported, OsuGameBase osu)
|
private void deleteBeatmapSet(BeatmapSetInfo imported, OsuGameBase osu)
|
||||||
|
@ -81,8 +81,8 @@ namespace osu.Game.Tests.Gameplay
|
|||||||
|
|
||||||
private class TestHitObjectWithCombo : ConvertHitObject, IHasComboInformation
|
private class TestHitObjectWithCombo : ConvertHitObject, IHasComboInformation
|
||||||
{
|
{
|
||||||
public bool NewCombo { get; set; } = false;
|
public bool NewCombo { get; set; }
|
||||||
public int ComboOffset { get; } = 0;
|
public int ComboOffset => 0;
|
||||||
|
|
||||||
public Bindable<int> IndexInCurrentComboBindable { get; } = new Bindable<int>();
|
public Bindable<int> IndexInCurrentComboBindable { get; } = new Bindable<int>();
|
||||||
|
|
||||||
|
@ -149,18 +149,14 @@ namespace osu.Game.Tests.Visual.Background
|
|||||||
=> AddStep($"set seasonal mode to {mode}", () => config.Set(OsuSetting.SeasonalBackgroundMode, mode));
|
=> AddStep($"set seasonal mode to {mode}", () => config.Set(OsuSetting.SeasonalBackgroundMode, mode));
|
||||||
|
|
||||||
private void createLoader()
|
private void createLoader()
|
||||||
{
|
=> AddStep("create loader", () =>
|
||||||
AddStep("create loader", () =>
|
|
||||||
{
|
{
|
||||||
if (backgroundLoader != null)
|
if (backgroundLoader != null)
|
||||||
Remove(backgroundLoader);
|
Remove(backgroundLoader);
|
||||||
|
|
||||||
LoadComponentAsync(backgroundLoader = new SeasonalBackgroundLoader(), Add);
|
Add(backgroundLoader = new SeasonalBackgroundLoader());
|
||||||
});
|
});
|
||||||
|
|
||||||
AddUntilStep("wait for loaded", () => backgroundLoader.IsLoaded);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void loadNextBackground()
|
private void loadNextBackground()
|
||||||
{
|
{
|
||||||
SeasonalBackground background = null;
|
SeasonalBackground background = null;
|
||||||
|
@ -135,7 +135,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
|
|
||||||
public Bindable<bool> InitialRoomsReceived { get; } = new Bindable<bool>(true);
|
public Bindable<bool> InitialRoomsReceived { get; } = new Bindable<bool>(true);
|
||||||
|
|
||||||
public IBindableList<Room> Rooms { get; } = null;
|
public IBindableList<Room> Rooms => null;
|
||||||
|
|
||||||
public void CreateRoom(Room room, Action<Room> onSuccess = null, Action<string> onError = null)
|
public void CreateRoom(Room room, Action<Room> onSuccess = null, Action<string> onError = null)
|
||||||
{
|
{
|
||||||
|
@ -197,8 +197,8 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
|
|
||||||
private class TestHitObject : ConvertHitObject, IHasPosition
|
private class TestHitObject : ConvertHitObject, IHasPosition
|
||||||
{
|
{
|
||||||
public float X { get; } = 0;
|
public float X => 0;
|
||||||
public float Y { get; } = 0;
|
public float Y => 0;
|
||||||
public Vector2 Position { get; } = Vector2.Zero;
|
public Vector2 Position { get; } = Vector2.Zero;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -417,7 +417,7 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
string sampleFilename = samples.FirstOrDefault(s => string.IsNullOrEmpty(s.Name))?.LookupNames.First() ?? string.Empty;
|
string sampleFilename = samples.FirstOrDefault(s => string.IsNullOrEmpty(s.Name))?.LookupNames.First() ?? string.Empty;
|
||||||
int volume = samples.FirstOrDefault()?.Volume ?? 100;
|
int volume = samples.FirstOrDefault()?.Volume ?? 100;
|
||||||
|
|
||||||
sb.Append(":");
|
sb.Append(':');
|
||||||
sb.Append(FormattableString.Invariant($"{customSampleBank}:"));
|
sb.Append(FormattableString.Invariant($"{customSampleBank}:"));
|
||||||
sb.Append(FormattableString.Invariant($"{volume}:"));
|
sb.Append(FormattableString.Invariant($"{volume}:"));
|
||||||
sb.Append(FormattableString.Invariant($"{sampleFilename}"));
|
sb.Append(FormattableString.Invariant($"{sampleFilename}"));
|
||||||
|
@ -347,7 +347,7 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
/// <param name="line">The line which may contains variables.</param>
|
/// <param name="line">The line which may contains variables.</param>
|
||||||
private void decodeVariables(ref string line)
|
private void decodeVariables(ref string line)
|
||||||
{
|
{
|
||||||
while (line.IndexOf('$') >= 0)
|
while (line.Contains('$'))
|
||||||
{
|
{
|
||||||
string origLine = line;
|
string origLine = line;
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ namespace osu.Game.Database
|
|||||||
/// Whether this write usage will commit a transaction on completion.
|
/// Whether this write usage will commit a transaction on completion.
|
||||||
/// If false, there is a parent usage responsible for transaction commit.
|
/// If false, there is a parent usage responsible for transaction commit.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsTransactionLeader = false;
|
public bool IsTransactionLeader;
|
||||||
|
|
||||||
protected void Dispose(bool disposing)
|
protected void Dispose(bool disposing)
|
||||||
{
|
{
|
||||||
|
@ -15,7 +15,6 @@ using osu.Game.Online.API.Requests.Responses;
|
|||||||
|
|
||||||
namespace osu.Game.Graphics.Backgrounds
|
namespace osu.Game.Graphics.Backgrounds
|
||||||
{
|
{
|
||||||
[LongRunningLoad]
|
|
||||||
public class SeasonalBackgroundLoader : Component
|
public class SeasonalBackgroundLoader : Component
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -21,7 +21,7 @@ namespace osu.Game.Graphics.Containers
|
|||||||
/// Allows controlling the scroll bar from any position in the container using the right mouse button.
|
/// Allows controlling the scroll bar from any position in the container using the right mouse button.
|
||||||
/// Uses the value of <see cref="DistanceDecayOnRightMouseScrollbar"/> to smoothly scroll to the dragged location.
|
/// Uses the value of <see cref="DistanceDecayOnRightMouseScrollbar"/> to smoothly scroll to the dragged location.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool RightMouseScrollbar = false;
|
public bool RightMouseScrollbar;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Controls the rate with which the target position is approached when performing a relative drag. Default is 0.02.
|
/// Controls the rate with which the target position is approached when performing a relative drag. Default is 0.02.
|
||||||
|
@ -41,7 +41,7 @@ namespace osu.Game.IO.Archives
|
|||||||
return null;
|
return null;
|
||||||
|
|
||||||
byte[] buffer = new byte[input.Length];
|
byte[] buffer = new byte[input.Length];
|
||||||
await input.ReadAsync(buffer, 0, buffer.Length);
|
await input.ReadAsync(buffer);
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,7 @@ namespace osu.Game.Rulesets.Replays
|
|||||||
/// When set, we will ensure frames executed by nested drawables are frame-accurate to replay data.
|
/// When set, we will ensure frames executed by nested drawables are frame-accurate to replay data.
|
||||||
/// Disabling this can make replay playback smoother (useful for autoplay, currently).
|
/// Disabling this can make replay playback smoother (useful for autoplay, currently).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool FrameAccuratePlayback = false;
|
public bool FrameAccuratePlayback;
|
||||||
|
|
||||||
protected bool HasFrames => Frames.Count > 0;
|
protected bool HasFrames => Frames.Count > 0;
|
||||||
|
|
||||||
|
@ -44,6 +44,8 @@ namespace osu.Game.Screens.Backgrounds
|
|||||||
mode = config.GetBindable<BackgroundSource>(OsuSetting.MenuBackgroundSource);
|
mode = config.GetBindable<BackgroundSource>(OsuSetting.MenuBackgroundSource);
|
||||||
introSequence = config.GetBindable<IntroSequence>(OsuSetting.IntroSequence);
|
introSequence = config.GetBindable<IntroSequence>(OsuSetting.IntroSequence);
|
||||||
|
|
||||||
|
AddInternal(seasonalBackgroundLoader);
|
||||||
|
|
||||||
user.ValueChanged += _ => Next();
|
user.ValueChanged += _ => Next();
|
||||||
skin.ValueChanged += _ => Next();
|
skin.ValueChanged += _ => Next();
|
||||||
mode.ValueChanged += _ => Next();
|
mode.ValueChanged += _ => Next();
|
||||||
@ -53,7 +55,6 @@ namespace osu.Game.Screens.Backgrounds
|
|||||||
|
|
||||||
currentDisplay = RNG.Next(0, background_count);
|
currentDisplay = RNG.Next(0, background_count);
|
||||||
|
|
||||||
LoadComponentAsync(seasonalBackgroundLoader);
|
|
||||||
Next();
|
Next();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,10 +210,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (DragBox.State == Visibility.Visible)
|
if (DragBox.State == Visibility.Visible)
|
||||||
{
|
|
||||||
DragBox.Hide();
|
DragBox.Hide();
|
||||||
SelectionHandler.UpdateVisibility();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnKeyDown(KeyDownEvent e)
|
protected override bool OnKeyDown(KeyDownEvent e)
|
||||||
@ -352,11 +349,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Selects all <see cref="SelectionBlueprint"/>s.
|
/// Selects all <see cref="SelectionBlueprint"/>s.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void selectAll()
|
private void selectAll() => SelectionBlueprints.ToList().ForEach(m => m.Select());
|
||||||
{
|
|
||||||
SelectionBlueprints.ToList().ForEach(m => m.Select());
|
|
||||||
SelectionHandler.UpdateVisibility();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Deselects all selected <see cref="SelectionBlueprint"/>s.
|
/// Deselects all selected <see cref="SelectionBlueprint"/>s.
|
||||||
|
@ -201,8 +201,6 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
// there are potentially multiple SelectionHandlers active, but we only want to add hitobjects to the selected list once.
|
// there are potentially multiple SelectionHandlers active, but we only want to add hitobjects to the selected list once.
|
||||||
if (!EditorBeatmap.SelectedHitObjects.Contains(blueprint.HitObject))
|
if (!EditorBeatmap.SelectedHitObjects.Contains(blueprint.HitObject))
|
||||||
EditorBeatmap.SelectedHitObjects.Add(blueprint.HitObject);
|
EditorBeatmap.SelectedHitObjects.Add(blueprint.HitObject);
|
||||||
|
|
||||||
UpdateVisibility();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -214,8 +212,6 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
selectedBlueprints.Remove(blueprint);
|
selectedBlueprints.Remove(blueprint);
|
||||||
|
|
||||||
EditorBeatmap.SelectedHitObjects.Remove(blueprint.HitObject);
|
EditorBeatmap.SelectedHitObjects.Remove(blueprint.HitObject);
|
||||||
|
|
||||||
UpdateVisibility();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -226,13 +222,21 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
internal void HandleSelectionRequested(SelectionBlueprint blueprint, InputState state)
|
internal void HandleSelectionRequested(SelectionBlueprint blueprint, InputState state)
|
||||||
{
|
{
|
||||||
if (state.Keyboard.ShiftPressed && state.Mouse.IsPressed(MouseButton.Right))
|
if (state.Keyboard.ShiftPressed && state.Mouse.IsPressed(MouseButton.Right))
|
||||||
EditorBeatmap.Remove(blueprint.HitObject);
|
handleQuickDeletion(blueprint);
|
||||||
else if (state.Keyboard.ControlPressed && state.Mouse.IsPressed(MouseButton.Left))
|
else if (state.Keyboard.ControlPressed && state.Mouse.IsPressed(MouseButton.Left))
|
||||||
blueprint.ToggleSelection();
|
blueprint.ToggleSelection();
|
||||||
else
|
else
|
||||||
ensureSelected(blueprint);
|
ensureSelected(blueprint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void handleQuickDeletion(SelectionBlueprint blueprint)
|
||||||
|
{
|
||||||
|
if (!blueprint.IsSelected)
|
||||||
|
EditorBeatmap.Remove(blueprint.HitObject);
|
||||||
|
else
|
||||||
|
deleteSelected();
|
||||||
|
}
|
||||||
|
|
||||||
private void ensureSelected(SelectionBlueprint blueprint)
|
private void ensureSelected(SelectionBlueprint blueprint)
|
||||||
{
|
{
|
||||||
if (blueprint.IsSelected)
|
if (blueprint.IsSelected)
|
||||||
@ -254,23 +258,18 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Updates whether this <see cref="SelectionHandler"/> is visible.
|
/// Updates whether this <see cref="SelectionHandler"/> is visible.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal void UpdateVisibility()
|
private void updateVisibility()
|
||||||
{
|
{
|
||||||
int count = selectedBlueprints.Count;
|
int count = selectedBlueprints.Count;
|
||||||
|
|
||||||
selectionDetailsText.Text = count > 0 ? count.ToString() : string.Empty;
|
selectionDetailsText.Text = count > 0 ? count.ToString() : string.Empty;
|
||||||
|
|
||||||
if (count > 0)
|
this.FadeTo(count > 0 ? 1 : 0);
|
||||||
{
|
OnSelectionChanged();
|
||||||
Show();
|
|
||||||
OnSelectionChanged();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Hide();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Triggered whenever more than one object is selected, on each change.
|
/// Triggered whenever the set of selected objects changes.
|
||||||
/// Should update the selection box's state to match supported operations.
|
/// Should update the selection box's state to match supported operations.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected virtual void OnSelectionChanged()
|
protected virtual void OnSelectionChanged()
|
||||||
@ -421,7 +420,11 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
|
|
||||||
// bring in updates from selection changes
|
// bring in updates from selection changes
|
||||||
EditorBeatmap.HitObjectUpdated += _ => UpdateTernaryStates();
|
EditorBeatmap.HitObjectUpdated += _ => UpdateTernaryStates();
|
||||||
EditorBeatmap.SelectedHitObjects.CollectionChanged += (sender, args) => UpdateTernaryStates();
|
EditorBeatmap.SelectedHitObjects.CollectionChanged += (sender, args) =>
|
||||||
|
{
|
||||||
|
Scheduler.AddOnce(updateVisibility);
|
||||||
|
UpdateTernaryStates();
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -9,10 +9,10 @@ using osu.Framework.Graphics.Containers;
|
|||||||
using osu.Framework.Graphics.Primitives;
|
using osu.Framework.Graphics.Primitives;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
|
using osu.Framework.Utils;
|
||||||
using osu.Game.Rulesets.Edit;
|
using osu.Game.Rulesets.Edit;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Screens.Edit.Components.Timelines.Summary.Parts;
|
using osu.Game.Screens.Edit.Components.Timelines.Summary.Parts;
|
||||||
using osuTK;
|
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||||
@ -137,8 +137,14 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
|
|
||||||
private class TimelineDragBox : DragBox
|
private class TimelineDragBox : DragBox
|
||||||
{
|
{
|
||||||
private Vector2 lastMouseDown;
|
// the following values hold the start and end X positions of the drag box in the timeline's local space,
|
||||||
private float localMouseDown;
|
// but with zoom unapplied in order to be able to compensate for positional changes
|
||||||
|
// while the timeline is being zoomed in/out.
|
||||||
|
private float? selectionStart;
|
||||||
|
private float selectionEnd;
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private Timeline timeline { get; set; }
|
||||||
|
|
||||||
public TimelineDragBox(Action<RectangleF> performSelect)
|
public TimelineDragBox(Action<RectangleF> performSelect)
|
||||||
: base(performSelect)
|
: base(performSelect)
|
||||||
@ -153,21 +159,34 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
|
|
||||||
public override bool HandleDrag(MouseButtonEvent e)
|
public override bool HandleDrag(MouseButtonEvent e)
|
||||||
{
|
{
|
||||||
// store the original position of the mouse down, as we may be scrolled during selection.
|
selectionStart ??= e.MouseDownPosition.X / timeline.CurrentZoom;
|
||||||
if (lastMouseDown != e.ScreenSpaceMouseDownPosition)
|
|
||||||
{
|
|
||||||
lastMouseDown = e.ScreenSpaceMouseDownPosition;
|
|
||||||
localMouseDown = e.MouseDownPosition.X;
|
|
||||||
}
|
|
||||||
|
|
||||||
float selection1 = localMouseDown;
|
// only calculate end when a transition is not in progress to avoid bouncing.
|
||||||
float selection2 = e.MousePosition.X;
|
if (Precision.AlmostEquals(timeline.CurrentZoom, timeline.Zoom))
|
||||||
|
selectionEnd = e.MousePosition.X / timeline.CurrentZoom;
|
||||||
|
|
||||||
Box.X = Math.Min(selection1, selection2);
|
updateDragBoxPosition();
|
||||||
Box.Width = Math.Abs(selection1 - selection2);
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateDragBoxPosition()
|
||||||
|
{
|
||||||
|
if (selectionStart == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
float rescaledStart = selectionStart.Value * timeline.CurrentZoom;
|
||||||
|
float rescaledEnd = selectionEnd * timeline.CurrentZoom;
|
||||||
|
|
||||||
|
Box.X = Math.Min(rescaledStart, rescaledEnd);
|
||||||
|
Box.Width = Math.Abs(rescaledStart - rescaledEnd);
|
||||||
|
|
||||||
PerformSelection?.Invoke(Box.ScreenSpaceDrawQuad.AABBFloat);
|
PerformSelection?.Invoke(Box.ScreenSpaceDrawQuad.AABBFloat);
|
||||||
return true;
|
}
|
||||||
|
|
||||||
|
public override void Hide()
|
||||||
|
{
|
||||||
|
base.Hide();
|
||||||
|
selectionStart = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,9 +29,14 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
|
|
||||||
private readonly Container zoomedContent;
|
private readonly Container zoomedContent;
|
||||||
protected override Container<Drawable> Content => zoomedContent;
|
protected override Container<Drawable> Content => zoomedContent;
|
||||||
|
|
||||||
private float currentZoom = 1;
|
private float currentZoom = 1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The current zoom level of <see cref="ZoomableScrollContainer" />.
|
||||||
|
/// It may differ from <see cref="Zoom" /> during transitions.
|
||||||
|
/// </summary>
|
||||||
|
public float CurrentZoom => currentZoom;
|
||||||
|
|
||||||
[Resolved(canBeNull: true)]
|
[Resolved(canBeNull: true)]
|
||||||
private IFrameBasedClock editorClock { get; set; }
|
private IFrameBasedClock editorClock { get; set; }
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
|||||||
matchingFilter &= r.Room.Playlist.Count == 0 || r.Room.Playlist.Any(i => i.Ruleset.Value.Equals(criteria.Ruleset));
|
matchingFilter &= r.Room.Playlist.Count == 0 || r.Room.Playlist.Any(i => i.Ruleset.Value.Equals(criteria.Ruleset));
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(criteria.SearchString))
|
if (!string.IsNullOrEmpty(criteria.SearchString))
|
||||||
matchingFilter &= r.FilterTerms.Any(term => term.IndexOf(criteria.SearchString, StringComparison.InvariantCultureIgnoreCase) >= 0);
|
matchingFilter &= r.FilterTerms.Any(term => term.Contains(criteria.SearchString, StringComparison.InvariantCultureIgnoreCase));
|
||||||
|
|
||||||
r.MatchingFilter = matchingFilter;
|
r.MatchingFilter = matchingFilter;
|
||||||
}
|
}
|
||||||
|
@ -300,6 +300,7 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
public MetadataSection(string title)
|
public MetadataSection(string title)
|
||||||
{
|
{
|
||||||
|
Alpha = 0;
|
||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
AutoSizeAxes = Axes.Y;
|
AutoSizeAxes = Axes.Y;
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ namespace osu.Game.Screens.Select.Carousel
|
|||||||
var terms = Beatmap.SearchableTerms;
|
var terms = Beatmap.SearchableTerms;
|
||||||
|
|
||||||
foreach (var criteriaTerm in criteria.SearchTerms)
|
foreach (var criteriaTerm in criteria.SearchTerms)
|
||||||
match &= terms.Any(term => term.IndexOf(criteriaTerm, StringComparison.InvariantCultureIgnoreCase) >= 0);
|
match &= terms.Any(term => term.Contains(criteriaTerm, StringComparison.InvariantCultureIgnoreCase));
|
||||||
|
|
||||||
// if a match wasn't found via text matching of terms, do a second catch-all check matching against online IDs.
|
// if a match wasn't found via text matching of terms, do a second catch-all check matching against online IDs.
|
||||||
// this should be done after text matching so we can prioritise matching numbers in metadata.
|
// this should be done after text matching so we can prioritise matching numbers in metadata.
|
||||||
|
@ -126,7 +126,7 @@ namespace osu.Game.Screens.Select
|
|||||||
if (string.IsNullOrEmpty(value))
|
if (string.IsNullOrEmpty(value))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return value.IndexOf(SearchTerm, StringComparison.InvariantCultureIgnoreCase) >= 0;
|
return value.Contains(SearchTerm, StringComparison.InvariantCultureIgnoreCase);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string SearchTerm;
|
public string SearchTerm;
|
||||||
|
@ -32,11 +32,7 @@ namespace osu.Game.Screens.Select
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load(OsuColour colours)
|
||||||
{
|
{
|
||||||
BeatmapOptions.AddButton(@"Edit", @"beatmap", FontAwesome.Solid.PencilAlt, colours.Yellow, () =>
|
BeatmapOptions.AddButton(@"Edit", @"beatmap", FontAwesome.Solid.PencilAlt, colours.Yellow, () => Edit());
|
||||||
{
|
|
||||||
ValidForResume = false;
|
|
||||||
Edit();
|
|
||||||
});
|
|
||||||
|
|
||||||
((PlayBeatmapDetailArea)BeatmapDetails).Leaderboard.ScoreSelected += PresentScore;
|
((PlayBeatmapDetailArea)BeatmapDetails).Leaderboard.ScoreSelected += PresentScore;
|
||||||
}
|
}
|
||||||
|
@ -446,21 +446,12 @@ namespace osu.Game.Skinning
|
|||||||
// for compatibility with stable, exclude the lookup names with the custom sample bank suffix, if they are not valid for use in this skin.
|
// for compatibility with stable, exclude the lookup names with the custom sample bank suffix, if they are not valid for use in this skin.
|
||||||
// using .EndsWith() is intentional as it ensures parity in all edge cases
|
// using .EndsWith() is intentional as it ensures parity in all edge cases
|
||||||
// (see LegacyTaikoSampleInfo for an example of one - prioritising the taiko prefix should still apply, but the sample bank should not).
|
// (see LegacyTaikoSampleInfo for an example of one - prioritising the taiko prefix should still apply, but the sample bank should not).
|
||||||
foreach (var l in lookupNames)
|
lookupNames = lookupNames.Where(name => !name.EndsWith(hitSample.Suffix, StringComparison.Ordinal));
|
||||||
{
|
|
||||||
if (!l.EndsWith(hitSample.Suffix, StringComparison.Ordinal))
|
|
||||||
{
|
|
||||||
foreach (var n in getFallbackNames(l))
|
|
||||||
yield return n;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
foreach (var l in lookupNames)
|
|
||||||
yield return l;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (var l in lookupNames)
|
||||||
|
yield return l;
|
||||||
|
|
||||||
// also for compatibility, try falling back to non-bank samples (so-called "universal" samples) as the last resort.
|
// also for compatibility, try falling back to non-bank samples (so-called "universal" samples) as the last resort.
|
||||||
// going forward specifying banks shall always be required, even for elements that wouldn't require it on stable,
|
// going forward specifying banks shall always be required, even for elements that wouldn't require it on stable,
|
||||||
// which is why this is done locally here.
|
// which is why this is done locally here.
|
||||||
|
@ -18,7 +18,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether custom test steps are provided. Custom tests should invoke <see cref="CreateTest"/> to create the test steps.
|
/// Whether custom test steps are provided. Custom tests should invoke <see cref="CreateTest"/> to create the test steps.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected virtual bool HasCustomSteps { get; } = false;
|
protected virtual bool HasCustomSteps => false;
|
||||||
|
|
||||||
protected TestPlayer Player;
|
protected TestPlayer Player;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user