mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 13:37:25 +08:00
Merge branch 'master' into fix-music-paused-on-multi-exit
This commit is contained in:
commit
ecad85b5f5
@ -16,9 +16,9 @@
|
||||
<EmbeddedResource Include="Resources\**\*.*" />
|
||||
</ItemGroup>
|
||||
<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" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.0.0" PrivateAssets="All" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.1" PrivateAssets="All" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Code Analysis">
|
||||
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)CodeAnalysis\osu.ruleset</CodeAnalysisRuleSet>
|
||||
|
@ -5,6 +5,6 @@
|
||||
"version": "3.1.100"
|
||||
},
|
||||
"msbuild-sdks": {
|
||||
"Microsoft.Build.Traversal": "2.1.1"
|
||||
"Microsoft.Build.Traversal": "2.2.3"
|
||||
}
|
||||
}
|
@ -51,7 +51,7 @@
|
||||
<Reference Include="Java.Interop" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.1016.0" />
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.1030.0" />
|
||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2020.1029.1" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
@ -6,20 +6,20 @@
|
||||
"EndTime": 2750.0,
|
||||
"Column": 1,
|
||||
"NodeSamples": [
|
||||
["normal-hitnormal"],
|
||||
["soft-hitnormal"],
|
||||
["drum-hitnormal"]
|
||||
["Gameplay/normal-hitnormal"],
|
||||
["Gameplay/soft-hitnormal"],
|
||||
["Gameplay/drum-hitnormal"]
|
||||
],
|
||||
"Samples": ["-hitnormal"]
|
||||
"Samples": ["Gameplay/-hitnormal"]
|
||||
}, {
|
||||
"StartTime": 1875.0,
|
||||
"EndTime": 2750.0,
|
||||
"Column": 0,
|
||||
"NodeSamples": [
|
||||
["soft-hitnormal"],
|
||||
["drum-hitnormal"]
|
||||
["Gameplay/soft-hitnormal"],
|
||||
["Gameplay/drum-hitnormal"]
|
||||
],
|
||||
"Samples": ["-hitnormal"]
|
||||
"Samples": ["Gameplay/-hitnormal"]
|
||||
}]
|
||||
}, {
|
||||
"StartTime": 3750.0,
|
||||
@ -27,7 +27,7 @@
|
||||
"StartTime": 3750.0,
|
||||
"EndTime": 3750.0,
|
||||
"Column": 3,
|
||||
"Samples": ["normal-hitnormal"]
|
||||
"Samples": ["Gameplay/normal-hitnormal"]
|
||||
}]
|
||||
}]
|
||||
}
|
@ -6,10 +6,10 @@
|
||||
"EndTime": 1500.0,
|
||||
"Column": 0,
|
||||
"NodeSamples": [
|
||||
["normal-hitnormal"],
|
||||
["Gameplay/normal-hitnormal"],
|
||||
[]
|
||||
],
|
||||
"Samples": ["normal-hitnormal"]
|
||||
"Samples": ["Gameplay/normal-hitnormal"]
|
||||
}]
|
||||
}, {
|
||||
"StartTime": 2000.0,
|
||||
@ -18,10 +18,10 @@
|
||||
"EndTime": 3000.0,
|
||||
"Column": 2,
|
||||
"NodeSamples": [
|
||||
["drum-hitnormal"],
|
||||
["Gameplay/drum-hitnormal"],
|
||||
[]
|
||||
],
|
||||
"Samples": ["drum-hitnormal"]
|
||||
"Samples": ["Gameplay/drum-hitnormal"]
|
||||
}]
|
||||
}]
|
||||
}
|
@ -5,17 +5,17 @@
|
||||
"StartTime": 8470.0,
|
||||
"EndTime": 8470.0,
|
||||
"Column": 0,
|
||||
"Samples": ["normal-hitnormal", "normal-hitclap"]
|
||||
"Samples": ["Gameplay/normal-hitnormal", "Gameplay/normal-hitclap"]
|
||||
}, {
|
||||
"StartTime": 8626.470587768974,
|
||||
"EndTime": 8626.470587768974,
|
||||
"Column": 1,
|
||||
"Samples": ["normal-hitnormal"]
|
||||
"Samples": ["Gameplay/normal-hitnormal"]
|
||||
}, {
|
||||
"StartTime": 8782.941175537948,
|
||||
"EndTime": 8782.941175537948,
|
||||
"Column": 2,
|
||||
"Samples": ["normal-hitnormal", "normal-hitclap"]
|
||||
"Samples": ["Gameplay/normal-hitnormal", "Gameplay/normal-hitclap"]
|
||||
}]
|
||||
}]
|
||||
}
|
||||
|
@ -64,8 +64,8 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
/// </summary>
|
||||
private const float target_clamp = 1;
|
||||
|
||||
private readonly float targetBreakMultiplier = 0;
|
||||
private readonly float easing = 1;
|
||||
private readonly float targetBreakMultiplier;
|
||||
private readonly float easing;
|
||||
|
||||
private readonly CompositeDrawable restrictTo;
|
||||
|
||||
@ -86,6 +86,9 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
{
|
||||
this.restrictTo = restrictTo;
|
||||
this.beatmap = beatmap;
|
||||
|
||||
targetBreakMultiplier = 0;
|
||||
easing = 1;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
|
@ -162,7 +162,7 @@ namespace osu.Game.Rulesets.Taiko.Skinning
|
||||
get
|
||||
{
|
||||
foreach (var name in source.LookupNames)
|
||||
yield return $"taiko-{name}";
|
||||
yield return name.Insert(name.LastIndexOf('/') + 1, "taiko-");
|
||||
|
||||
foreach (var name in source.LookupNames)
|
||||
yield return name;
|
||||
|
@ -410,13 +410,13 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
||||
{
|
||||
var hitObjects = decoder.Decode(stream).HitObjects;
|
||||
|
||||
Assert.AreEqual("normal-hitnormal", getTestableSampleInfo(hitObjects[0]).LookupNames.First());
|
||||
Assert.AreEqual("normal-hitnormal", getTestableSampleInfo(hitObjects[1]).LookupNames.First());
|
||||
Assert.AreEqual("normal-hitnormal2", getTestableSampleInfo(hitObjects[2]).LookupNames.First());
|
||||
Assert.AreEqual("normal-hitnormal", getTestableSampleInfo(hitObjects[3]).LookupNames.First());
|
||||
Assert.AreEqual("Gameplay/normal-hitnormal", getTestableSampleInfo(hitObjects[0]).LookupNames.First());
|
||||
Assert.AreEqual("Gameplay/normal-hitnormal", getTestableSampleInfo(hitObjects[1]).LookupNames.First());
|
||||
Assert.AreEqual("Gameplay/normal-hitnormal2", getTestableSampleInfo(hitObjects[2]).LookupNames.First());
|
||||
Assert.AreEqual("Gameplay/normal-hitnormal", getTestableSampleInfo(hitObjects[3]).LookupNames.First());
|
||||
|
||||
// The control point at the end time of the slider should be applied
|
||||
Assert.AreEqual("soft-hitnormal8", getTestableSampleInfo(hitObjects[4]).LookupNames.First());
|
||||
Assert.AreEqual("Gameplay/soft-hitnormal8", getTestableSampleInfo(hitObjects[4]).LookupNames.First());
|
||||
}
|
||||
|
||||
static HitSampleInfo getTestableSampleInfo(HitObject hitObject) => hitObject.SampleControlPoint.ApplyTo(hitObject.Samples[0]);
|
||||
@ -432,9 +432,9 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
||||
{
|
||||
var hitObjects = decoder.Decode(stream).HitObjects;
|
||||
|
||||
Assert.AreEqual("normal-hitnormal", getTestableSampleInfo(hitObjects[0]).LookupNames.First());
|
||||
Assert.AreEqual("normal-hitnormal2", getTestableSampleInfo(hitObjects[1]).LookupNames.First());
|
||||
Assert.AreEqual("normal-hitnormal3", getTestableSampleInfo(hitObjects[2]).LookupNames.First());
|
||||
Assert.AreEqual("Gameplay/normal-hitnormal", getTestableSampleInfo(hitObjects[0]).LookupNames.First());
|
||||
Assert.AreEqual("Gameplay/normal-hitnormal2", getTestableSampleInfo(hitObjects[1]).LookupNames.First());
|
||||
Assert.AreEqual("Gameplay/normal-hitnormal3", getTestableSampleInfo(hitObjects[2]).LookupNames.First());
|
||||
}
|
||||
|
||||
static HitSampleInfo getTestableSampleInfo(HitObject hitObject) => hitObject.SampleControlPoint.ApplyTo(hitObject.Samples[0]);
|
||||
@ -452,7 +452,7 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
||||
|
||||
Assert.AreEqual("hit_1.wav", getTestableSampleInfo(hitObjects[0]).LookupNames.First());
|
||||
Assert.AreEqual("hit_2.wav", getTestableSampleInfo(hitObjects[1]).LookupNames.First());
|
||||
Assert.AreEqual("normal-hitnormal2", getTestableSampleInfo(hitObjects[2]).LookupNames.First());
|
||||
Assert.AreEqual("Gameplay/normal-hitnormal2", getTestableSampleInfo(hitObjects[2]).LookupNames.First());
|
||||
Assert.AreEqual("hit_1.wav", getTestableSampleInfo(hitObjects[3]).LookupNames.First());
|
||||
Assert.AreEqual(70, getTestableSampleInfo(hitObjects[3]).Volume);
|
||||
}
|
||||
|
@ -821,15 +821,13 @@ namespace osu.Game.Tests.Beatmaps.IO
|
||||
|
||||
var manager = osu.Dependencies.Get<BeatmapManager>();
|
||||
|
||||
await manager.Import(temp);
|
||||
|
||||
var imported = manager.GetAllUsableBeatmapSets();
|
||||
var importedSet = await manager.Import(temp);
|
||||
|
||||
ensureLoaded(osu);
|
||||
|
||||
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)
|
||||
|
@ -81,8 +81,8 @@ namespace osu.Game.Tests.Gameplay
|
||||
|
||||
private class TestHitObjectWithCombo : ConvertHitObject, IHasComboInformation
|
||||
{
|
||||
public bool NewCombo { get; set; } = false;
|
||||
public int ComboOffset { get; } = 0;
|
||||
public bool NewCombo { get; set; }
|
||||
public int ComboOffset => 0;
|
||||
|
||||
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));
|
||||
|
||||
private void createLoader()
|
||||
{
|
||||
AddStep("create loader", () =>
|
||||
=> AddStep("create loader", () =>
|
||||
{
|
||||
if (backgroundLoader != null)
|
||||
Remove(backgroundLoader);
|
||||
|
||||
LoadComponentAsync(backgroundLoader = new SeasonalBackgroundLoader(), Add);
|
||||
Add(backgroundLoader = new SeasonalBackgroundLoader());
|
||||
});
|
||||
|
||||
AddUntilStep("wait for loaded", () => backgroundLoader.IsLoaded);
|
||||
}
|
||||
|
||||
private void loadNextBackground()
|
||||
{
|
||||
SeasonalBackground background = null;
|
||||
|
@ -34,7 +34,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
skinSource = new TestSkinSourceContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Child = skinnableSound = new PausableSkinnableSound(new SampleInfo("normal-sliderslide"))
|
||||
Child = skinnableSound = new PausableSkinnableSound(new SampleInfo("Gameplay/normal-sliderslide"))
|
||||
},
|
||||
};
|
||||
});
|
||||
|
@ -135,7 +135,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
|
||||
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)
|
||||
{
|
||||
|
@ -120,7 +120,7 @@ namespace osu.Game.Tests.Visual.Ranking
|
||||
}
|
||||
}
|
||||
},
|
||||
new AccuracyCircle(score)
|
||||
new AccuracyCircle(score, true)
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
|
@ -197,8 +197,8 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
|
||||
private class TestHitObject : ConvertHitObject, IHasPosition
|
||||
{
|
||||
public float X { get; } = 0;
|
||||
public float Y { get; } = 0;
|
||||
public float X => 0;
|
||||
public float Y => 0;
|
||||
public Vector2 Position { get; } = Vector2.Zero;
|
||||
}
|
||||
}
|
||||
|
@ -50,9 +50,9 @@ namespace osu.Game.Audio
|
||||
get
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Suffix))
|
||||
yield return $"{Bank}-{Name}{Suffix}";
|
||||
yield return $"Gameplay/{Bank}-{Name}{Suffix}";
|
||||
|
||||
yield return $"{Bank}-{Name}";
|
||||
yield return $"Gameplay/{Bank}-{Name}";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10,14 +10,14 @@ namespace osu.Game.Audio
|
||||
/// </summary>
|
||||
public class SampleInfo : ISampleInfo
|
||||
{
|
||||
private readonly string sampleName;
|
||||
private readonly string[] sampleNames;
|
||||
|
||||
public SampleInfo(string sampleName)
|
||||
public SampleInfo(params string[] sampleNames)
|
||||
{
|
||||
this.sampleName = sampleName;
|
||||
this.sampleNames = sampleNames;
|
||||
}
|
||||
|
||||
public IEnumerable<string> LookupNames => new[] { sampleName };
|
||||
public IEnumerable<string> LookupNames => sampleNames;
|
||||
|
||||
public int Volume { get; } = 100;
|
||||
}
|
||||
|
@ -417,7 +417,7 @@ namespace osu.Game.Beatmaps.Formats
|
||||
string sampleFilename = samples.FirstOrDefault(s => string.IsNullOrEmpty(s.Name))?.LookupNames.First() ?? string.Empty;
|
||||
int volume = samples.FirstOrDefault()?.Volume ?? 100;
|
||||
|
||||
sb.Append(":");
|
||||
sb.Append(':');
|
||||
sb.Append(FormattableString.Invariant($"{customSampleBank}:"));
|
||||
sb.Append(FormattableString.Invariant($"{volume}:"));
|
||||
sb.Append(FormattableString.Invariant($"{sampleFilename}"));
|
||||
|
@ -347,7 +347,7 @@ namespace osu.Game.Beatmaps.Formats
|
||||
/// <param name="line">The line which may contains variables.</param>
|
||||
private void decodeVariables(ref string line)
|
||||
{
|
||||
while (line.IndexOf('$') >= 0)
|
||||
while (line.Contains('$'))
|
||||
{
|
||||
string origLine = line;
|
||||
|
||||
|
@ -26,7 +26,7 @@ namespace osu.Game.Database
|
||||
/// Whether this write usage will commit a transaction on completion.
|
||||
/// If false, there is a parent usage responsible for transaction commit.
|
||||
/// </summary>
|
||||
public bool IsTransactionLeader = false;
|
||||
public bool IsTransactionLeader;
|
||||
|
||||
protected void Dispose(bool disposing)
|
||||
{
|
||||
|
@ -15,7 +15,6 @@ using osu.Game.Online.API.Requests.Responses;
|
||||
|
||||
namespace osu.Game.Graphics.Backgrounds
|
||||
{
|
||||
[LongRunningLoad]
|
||||
public class SeasonalBackgroundLoader : Component
|
||||
{
|
||||
/// <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.
|
||||
/// Uses the value of <see cref="DistanceDecayOnRightMouseScrollbar"/> to smoothly scroll to the dragged location.
|
||||
/// </summary>
|
||||
public bool RightMouseScrollbar = false;
|
||||
public bool RightMouseScrollbar;
|
||||
|
||||
/// <summary>
|
||||
/// 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;
|
||||
|
||||
byte[] buffer = new byte[input.Length];
|
||||
await input.ReadAsync(buffer, 0, buffer.Length);
|
||||
await input.ReadAsync(buffer);
|
||||
return buffer;
|
||||
}
|
||||
}
|
||||
|
@ -69,10 +69,10 @@ namespace osu.Game.Rulesets.Mods
|
||||
{
|
||||
InternalChildren = new Drawable[]
|
||||
{
|
||||
hatSample = new PausableSkinnableSound(new SampleInfo("nightcore-hat")),
|
||||
clapSample = new PausableSkinnableSound(new SampleInfo("nightcore-clap")),
|
||||
kickSample = new PausableSkinnableSound(new SampleInfo("nightcore-kick")),
|
||||
finishSample = new PausableSkinnableSound(new SampleInfo("nightcore-finish")),
|
||||
hatSample = new PausableSkinnableSound(new SampleInfo("Gameplay/nightcore-hat")),
|
||||
clapSample = new PausableSkinnableSound(new SampleInfo("Gameplay/nightcore-clap")),
|
||||
kickSample = new PausableSkinnableSound(new SampleInfo("Gameplay/nightcore-kick")),
|
||||
finishSample = new PausableSkinnableSound(new SampleInfo("Gameplay/nightcore-finish")),
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -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.
|
||||
/// Disabling this can make replay playback smoother (useful for autoplay, currently).
|
||||
/// </summary>
|
||||
public bool FrameAccuratePlayback = false;
|
||||
public bool FrameAccuratePlayback;
|
||||
|
||||
protected bool HasFrames => Frames.Count > 0;
|
||||
|
||||
|
@ -44,6 +44,8 @@ namespace osu.Game.Screens.Backgrounds
|
||||
mode = config.GetBindable<BackgroundSource>(OsuSetting.MenuBackgroundSource);
|
||||
introSequence = config.GetBindable<IntroSequence>(OsuSetting.IntroSequence);
|
||||
|
||||
AddInternal(seasonalBackgroundLoader);
|
||||
|
||||
user.ValueChanged += _ => Next();
|
||||
skin.ValueChanged += _ => Next();
|
||||
mode.ValueChanged += _ => Next();
|
||||
@ -53,7 +55,6 @@ namespace osu.Game.Screens.Backgrounds
|
||||
|
||||
currentDisplay = RNG.Next(0, background_count);
|
||||
|
||||
LoadComponentAsync(seasonalBackgroundLoader);
|
||||
Next();
|
||||
}
|
||||
|
||||
|
@ -210,10 +210,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
}
|
||||
|
||||
if (DragBox.State == Visibility.Visible)
|
||||
{
|
||||
DragBox.Hide();
|
||||
SelectionHandler.UpdateVisibility();
|
||||
}
|
||||
}
|
||||
|
||||
protected override bool OnKeyDown(KeyDownEvent e)
|
||||
@ -352,11 +349,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
/// <summary>
|
||||
/// Selects all <see cref="SelectionBlueprint"/>s.
|
||||
/// </summary>
|
||||
private void selectAll()
|
||||
{
|
||||
SelectionBlueprints.ToList().ForEach(m => m.Select());
|
||||
SelectionHandler.UpdateVisibility();
|
||||
}
|
||||
private void selectAll() => SelectionBlueprints.ToList().ForEach(m => m.Select());
|
||||
|
||||
/// <summary>
|
||||
/// 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.
|
||||
if (!EditorBeatmap.SelectedHitObjects.Contains(blueprint.HitObject))
|
||||
EditorBeatmap.SelectedHitObjects.Add(blueprint.HitObject);
|
||||
|
||||
UpdateVisibility();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -214,8 +212,6 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
selectedBlueprints.Remove(blueprint);
|
||||
|
||||
EditorBeatmap.SelectedHitObjects.Remove(blueprint.HitObject);
|
||||
|
||||
UpdateVisibility();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -226,13 +222,21 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
internal void HandleSelectionRequested(SelectionBlueprint blueprint, InputState state)
|
||||
{
|
||||
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))
|
||||
blueprint.ToggleSelection();
|
||||
else
|
||||
ensureSelected(blueprint);
|
||||
}
|
||||
|
||||
private void handleQuickDeletion(SelectionBlueprint blueprint)
|
||||
{
|
||||
if (!blueprint.IsSelected)
|
||||
EditorBeatmap.Remove(blueprint.HitObject);
|
||||
else
|
||||
deleteSelected();
|
||||
}
|
||||
|
||||
private void ensureSelected(SelectionBlueprint blueprint)
|
||||
{
|
||||
if (blueprint.IsSelected)
|
||||
@ -254,23 +258,18 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
/// <summary>
|
||||
/// Updates whether this <see cref="SelectionHandler"/> is visible.
|
||||
/// </summary>
|
||||
internal void UpdateVisibility()
|
||||
private void updateVisibility()
|
||||
{
|
||||
int count = selectedBlueprints.Count;
|
||||
|
||||
selectionDetailsText.Text = count > 0 ? count.ToString() : string.Empty;
|
||||
|
||||
if (count > 0)
|
||||
{
|
||||
Show();
|
||||
this.FadeTo(count > 0 ? 1 : 0);
|
||||
OnSelectionChanged();
|
||||
}
|
||||
else
|
||||
Hide();
|
||||
}
|
||||
|
||||
/// <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.
|
||||
/// </summary>
|
||||
protected virtual void OnSelectionChanged()
|
||||
@ -421,7 +420,11 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
|
||||
// bring in updates from selection changes
|
||||
EditorBeatmap.HitObjectUpdated += _ => UpdateTernaryStates();
|
||||
EditorBeatmap.SelectedHitObjects.CollectionChanged += (sender, args) => UpdateTernaryStates();
|
||||
EditorBeatmap.SelectedHitObjects.CollectionChanged += (sender, args) =>
|
||||
{
|
||||
Scheduler.AddOnce(updateVisibility);
|
||||
UpdateTernaryStates();
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -9,10 +9,10 @@ using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Framework.Utils;
|
||||
using osu.Game.Rulesets.Edit;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using osu.Game.Screens.Edit.Components.Timelines.Summary.Parts;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
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 Vector2 lastMouseDown;
|
||||
private float localMouseDown;
|
||||
// the following values hold the start and end X positions of the drag box in the timeline's local space,
|
||||
// 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)
|
||||
: base(performSelect)
|
||||
@ -153,21 +159,34 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||
|
||||
public override bool HandleDrag(MouseButtonEvent e)
|
||||
{
|
||||
// store the original position of the mouse down, as we may be scrolled during selection.
|
||||
if (lastMouseDown != e.ScreenSpaceMouseDownPosition)
|
||||
{
|
||||
lastMouseDown = e.ScreenSpaceMouseDownPosition;
|
||||
localMouseDown = e.MouseDownPosition.X;
|
||||
selectionStart ??= e.MouseDownPosition.X / timeline.CurrentZoom;
|
||||
|
||||
// only calculate end when a transition is not in progress to avoid bouncing.
|
||||
if (Precision.AlmostEquals(timeline.CurrentZoom, timeline.Zoom))
|
||||
selectionEnd = e.MousePosition.X / timeline.CurrentZoom;
|
||||
|
||||
updateDragBoxPosition();
|
||||
return true;
|
||||
}
|
||||
|
||||
float selection1 = localMouseDown;
|
||||
float selection2 = e.MousePosition.X;
|
||||
private void updateDragBoxPosition()
|
||||
{
|
||||
if (selectionStart == null)
|
||||
return;
|
||||
|
||||
Box.X = Math.Min(selection1, selection2);
|
||||
Box.Width = Math.Abs(selection1 - selection2);
|
||||
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);
|
||||
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;
|
||||
protected override Container<Drawable> Content => zoomedContent;
|
||||
|
||||
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)]
|
||||
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));
|
||||
|
||||
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;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ namespace osu.Game.Screens.Play
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuConfigManager config)
|
||||
{
|
||||
InternalChild = comboBreakSample = new SkinnableSound(new SampleInfo("combobreak"));
|
||||
InternalChild = comboBreakSample = new SkinnableSound(new SampleInfo("Gameplay/combobreak"));
|
||||
alwaysPlay = config.GetBindable<bool>(OsuSetting.AlwaysPlayFirstComboBreak);
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ namespace osu.Game.Screens.Play
|
||||
AddButton("Retry", colours.YellowDark, () => OnRetry?.Invoke());
|
||||
AddButton("Quit", new Color4(170, 27, 39, 255), () => OnQuit?.Invoke());
|
||||
|
||||
AddInternal(pauseLoop = new SkinnableSound(new SampleInfo("pause-loop"))
|
||||
AddInternal(pauseLoop = new SkinnableSound(new SampleInfo("Gameplay/pause-loop"))
|
||||
{
|
||||
Looping = true,
|
||||
Volume = { Value = 0 }
|
||||
|
@ -4,14 +4,17 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Audio;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Colour;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Utils;
|
||||
using osu.Game.Audio;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Skinning;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Screens.Ranking.Expanded.Accuracy
|
||||
@ -73,18 +76,23 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy
|
||||
|
||||
private readonly ScoreInfo score;
|
||||
|
||||
private readonly bool withFlair;
|
||||
|
||||
private SmoothCircularProgress accuracyCircle;
|
||||
private SmoothCircularProgress innerMask;
|
||||
private Container<RankBadge> badges;
|
||||
private RankText rankText;
|
||||
|
||||
public AccuracyCircle(ScoreInfo score)
|
||||
private SkinnableSound applauseSound;
|
||||
|
||||
public AccuracyCircle(ScoreInfo score, bool withFlair)
|
||||
{
|
||||
this.score = score;
|
||||
this.withFlair = withFlair;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
private void load(AudioManager audio)
|
||||
{
|
||||
InternalChildren = new Drawable[]
|
||||
{
|
||||
@ -203,6 +211,13 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy
|
||||
},
|
||||
rankText = new RankText(score.Rank)
|
||||
};
|
||||
|
||||
if (withFlair)
|
||||
{
|
||||
AddInternal(applauseSound = score.Rank >= ScoreRank.A
|
||||
? new SkinnableSound(new SampleInfo("Results/rankpass", "applause"))
|
||||
: new SkinnableSound(new SampleInfo("Results/rankfail")));
|
||||
}
|
||||
}
|
||||
|
||||
private ScoreRank getRank(ScoreRank rank)
|
||||
@ -234,13 +249,18 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy
|
||||
continue;
|
||||
|
||||
using (BeginDelayedSequence(inverseEasing(ACCURACY_TRANSFORM_EASING, Math.Min(1 - virtual_ss_percentage, badge.Accuracy) / targetAccuracy) * ACCURACY_TRANSFORM_DURATION, true))
|
||||
{
|
||||
badge.Appear();
|
||||
}
|
||||
}
|
||||
|
||||
using (BeginDelayedSequence(TEXT_APPEAR_DELAY, true))
|
||||
{
|
||||
this.Delay(-1440).Schedule(() => applauseSound?.Play());
|
||||
rankText.Appear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private double inverseEasing(Easing easing, double targetValue)
|
||||
{
|
||||
|
@ -120,7 +120,7 @@ namespace osu.Game.Screens.Ranking.Expanded
|
||||
Margin = new MarginPadding { Top = 40 },
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Height = 230,
|
||||
Child = new AccuracyCircle(score)
|
||||
Child = new AccuracyCircle(score, withFlair)
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
|
@ -300,6 +300,7 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
public MetadataSection(string title)
|
||||
{
|
||||
Alpha = 0;
|
||||
RelativeSizeAxes = Axes.X;
|
||||
AutoSizeAxes = Axes.Y;
|
||||
|
||||
|
@ -59,7 +59,7 @@ namespace osu.Game.Screens.Select.Carousel
|
||||
var terms = Beatmap.SearchableTerms;
|
||||
|
||||
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.
|
||||
// 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))
|
||||
return false;
|
||||
|
||||
return value.IndexOf(SearchTerm, StringComparison.InvariantCultureIgnoreCase) >= 0;
|
||||
return value.Contains(SearchTerm, StringComparison.InvariantCultureIgnoreCase);
|
||||
}
|
||||
|
||||
public string SearchTerm;
|
||||
|
@ -32,11 +32,7 @@ namespace osu.Game.Screens.Select
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
BeatmapOptions.AddButton(@"Edit", @"beatmap", FontAwesome.Solid.PencilAlt, colours.Yellow, () =>
|
||||
{
|
||||
ValidForResume = false;
|
||||
Edit();
|
||||
});
|
||||
BeatmapOptions.AddButton(@"Edit", @"beatmap", FontAwesome.Solid.PencilAlt, colours.Yellow, () => Edit());
|
||||
|
||||
((PlayBeatmapDetailArea)BeatmapDetails).Leaderboard.ScoreSelected += PresentScore;
|
||||
}
|
||||
|
@ -417,10 +417,14 @@ namespace osu.Game.Skinning
|
||||
|
||||
public override SampleChannel GetSample(ISampleInfo sampleInfo)
|
||||
{
|
||||
var lookupNames = sampleInfo.LookupNames;
|
||||
IEnumerable<string> lookupNames;
|
||||
|
||||
if (sampleInfo is HitSampleInfo hitSample)
|
||||
lookupNames = getLegacyLookupNames(hitSample);
|
||||
else
|
||||
{
|
||||
lookupNames = sampleInfo.LookupNames.SelectMany(getFallbackNames);
|
||||
}
|
||||
|
||||
foreach (var lookup in lookupNames)
|
||||
{
|
||||
@ -433,6 +437,27 @@ namespace osu.Game.Skinning
|
||||
return null;
|
||||
}
|
||||
|
||||
private IEnumerable<string> getLegacyLookupNames(HitSampleInfo hitSample)
|
||||
{
|
||||
var lookupNames = hitSample.LookupNames.SelectMany(getFallbackNames);
|
||||
|
||||
if (!UseCustomSampleBanks && !string.IsNullOrEmpty(hitSample.Suffix))
|
||||
{
|
||||
// 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
|
||||
// (see LegacyTaikoSampleInfo for an example of one - prioritising the taiko prefix should still apply, but the sample bank should not).
|
||||
lookupNames = lookupNames.Where(name => !name.EndsWith(hitSample.Suffix, StringComparison.Ordinal));
|
||||
}
|
||||
|
||||
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.
|
||||
// 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.
|
||||
yield return hitSample.Name;
|
||||
}
|
||||
|
||||
private IEnumerable<string> getFallbackNames(string componentName)
|
||||
{
|
||||
// May be something like "Gameplay/osu/approachcircle" from lazer, or "Arrows/note1" from a user skin.
|
||||
@ -442,23 +467,5 @@ namespace osu.Game.Skinning
|
||||
string lastPiece = componentName.Split('/').Last();
|
||||
yield return componentName.StartsWith("Gameplay/taiko/", StringComparison.Ordinal) ? "taiko-" + lastPiece : lastPiece;
|
||||
}
|
||||
|
||||
private IEnumerable<string> getLegacyLookupNames(HitSampleInfo hitSample)
|
||||
{
|
||||
var lookupNames = hitSample.LookupNames;
|
||||
|
||||
if (!UseCustomSampleBanks && !string.IsNullOrEmpty(hitSample.Suffix))
|
||||
// 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
|
||||
// (see LegacyTaikoSampleInfo for an example of one - prioritising the taiko prefix should still apply, but the sample bank should not).
|
||||
lookupNames = hitSample.LookupNames.Where(name => !name.EndsWith(hitSample.Suffix, StringComparison.Ordinal));
|
||||
|
||||
// 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,
|
||||
// which is why this is done locally here.
|
||||
lookupNames = lookupNames.Append(hitSample.Name);
|
||||
|
||||
return lookupNames;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ namespace osu.Game.Skinning
|
||||
{
|
||||
foreach (var lookup in s.LookupNames)
|
||||
{
|
||||
if ((ch = samples.Get($"Gameplay/{lookup}")) != null)
|
||||
if ((ch = samples.Get(lookup)) != null)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ namespace osu.Game.Tests.Visual
|
||||
/// <summary>
|
||||
/// Whether custom test steps are provided. Custom tests should invoke <see cref="CreateTest"/> to create the test steps.
|
||||
/// </summary>
|
||||
protected virtual bool HasCustomSteps { get; } = false;
|
||||
protected virtual bool HasCustomSteps => false;
|
||||
|
||||
protected TestPlayer Player;
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||
<PackageReference Include="ppy.osu.Framework" Version="2020.1029.1" />
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.1016.0" />
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.1030.0" />
|
||||
<PackageReference Include="Sentry" Version="2.1.6" />
|
||||
<PackageReference Include="SharpCompress" Version="0.26.0" />
|
||||
<PackageReference Include="NUnit" Version="3.12.0" />
|
||||
|
@ -71,7 +71,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup Label="Package References">
|
||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2020.1029.1" />
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.1016.0" />
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.1030.0" />
|
||||
</ItemGroup>
|
||||
<!-- Xamarin.iOS does not automatically handle transitive dependencies from NuGet packages. -->
|
||||
<ItemGroup Label="Transitive Dependencies">
|
||||
|
Loading…
Reference in New Issue
Block a user