mirror of
https://github.com/osukey/osukey.git
synced 2025-05-17 03:27:21 +09:00
Merge branch 'master' into fix-taiko-editor-type-stats
This commit is contained in:
commit
00b0228b61
@ -52,6 +52,6 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.904.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.904.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2020.911.0" />
|
<PackageReference Include="ppy.osu.Framework.Android" Version="2020.923.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -46,7 +46,20 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections
|
|||||||
private void addConnection(FollowPointConnection connection)
|
private void addConnection(FollowPointConnection connection)
|
||||||
{
|
{
|
||||||
// Groups are sorted by their start time when added such that the index can be used to post-process other surrounding connections
|
// Groups are sorted by their start time when added such that the index can be used to post-process other surrounding connections
|
||||||
int index = connections.AddInPlace(connection, Comparer<FollowPointConnection>.Create((g1, g2) => g1.StartTime.Value.CompareTo(g2.StartTime.Value)));
|
int index = connections.AddInPlace(connection, Comparer<FollowPointConnection>.Create((g1, g2) =>
|
||||||
|
{
|
||||||
|
int comp = g1.StartTime.Value.CompareTo(g2.StartTime.Value);
|
||||||
|
|
||||||
|
if (comp != 0)
|
||||||
|
return comp;
|
||||||
|
|
||||||
|
// we always want to insert the new item after equal ones.
|
||||||
|
// this is important for beatmaps with multiple hitobjects at the same point in time.
|
||||||
|
// if we use standard comparison insert order, there will be a churn of connections getting re-updated to
|
||||||
|
// the next object at the point-in-time, adding a construction/disposal overhead (see FollowPointConnection.End implementation's ClearInternal).
|
||||||
|
// this is easily visible on https://osu.ppy.sh/beatmapsets/150945#osu/372245
|
||||||
|
return -1;
|
||||||
|
}));
|
||||||
|
|
||||||
if (index < connections.Count - 1)
|
if (index < connections.Count - 1)
|
||||||
{
|
{
|
||||||
|
@ -22,6 +22,8 @@ namespace osu.Game.Rulesets.Taiko.Edit
|
|||||||
|
|
||||||
yield return new TernaryStateMenuItem("Rim", action: state =>
|
yield return new TernaryStateMenuItem("Rim", action: state =>
|
||||||
{
|
{
|
||||||
|
ChangeHandler.BeginChange();
|
||||||
|
|
||||||
foreach (var h in hits)
|
foreach (var h in hits)
|
||||||
{
|
{
|
||||||
switch (state)
|
switch (state)
|
||||||
@ -35,6 +37,8 @@ namespace osu.Game.Rulesets.Taiko.Edit
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ChangeHandler.EndChange();
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
State = { Value = getTernaryState(hits, h => h.Type == HitType.Rim) }
|
State = { Value = getTernaryState(hits, h => h.Type == HitType.Rim) }
|
||||||
@ -47,6 +51,8 @@ namespace osu.Game.Rulesets.Taiko.Edit
|
|||||||
|
|
||||||
yield return new TernaryStateMenuItem("Strong", action: state =>
|
yield return new TernaryStateMenuItem("Strong", action: state =>
|
||||||
{
|
{
|
||||||
|
ChangeHandler.BeginChange();
|
||||||
|
|
||||||
foreach (var h in hits)
|
foreach (var h in hits)
|
||||||
{
|
{
|
||||||
switch (state)
|
switch (state)
|
||||||
@ -62,6 +68,8 @@ namespace osu.Game.Rulesets.Taiko.Edit
|
|||||||
|
|
||||||
EditorBeatmap?.UpdateHitObject(h);
|
EditorBeatmap?.UpdateHitObject(h);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ChangeHandler.EndChange();
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
State = { Value = getTernaryState(hits, h => h.IsStrong) }
|
State = { Value = getTernaryState(hits, h => h.IsStrong) }
|
||||||
|
@ -81,7 +81,7 @@ namespace osu.Game.Tests.Gameplay
|
|||||||
|
|
||||||
private class TestHitObjectWithCombo : ConvertHitObject, IHasComboInformation
|
private class TestHitObjectWithCombo : ConvertHitObject, IHasComboInformation
|
||||||
{
|
{
|
||||||
public bool NewCombo { get; } = false;
|
public bool NewCombo { get; set; } = false;
|
||||||
public int ComboOffset { get; } = 0;
|
public int ComboOffset { get; } = 0;
|
||||||
|
|
||||||
public Bindable<int> IndexInCurrentComboBindable { get; } = new Bindable<int>();
|
public Bindable<int> IndexInCurrentComboBindable { get; } = new Bindable<int>();
|
||||||
|
@ -68,7 +68,7 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
public void TestMultipleLoads()
|
public void TestMultipleLoads()
|
||||||
{
|
{
|
||||||
var comments = exampleComments;
|
var comments = exampleComments;
|
||||||
int topLevelCommentCount = exampleComments.Comments.Count(comment => comment.IsTopLevel);
|
int topLevelCommentCount = exampleComments.Comments.Count;
|
||||||
|
|
||||||
AddStep("hide container", () => commentsContainer.Hide());
|
AddStep("hide container", () => commentsContainer.Hide());
|
||||||
setUpCommentsResponse(comments);
|
setUpCommentsResponse(comments);
|
||||||
|
@ -78,7 +78,7 @@ namespace osu.Game.Rulesets.Edit
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Logger.Error(e, "Could not load beatmap sucessfully!");
|
Logger.Error(e, "Could not load beatmap successfully!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,6 +24,11 @@ namespace osu.Game.Rulesets.Objects.Types
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
int ComboIndex { get; set; }
|
int ComboIndex { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether the HitObject starts a new combo.
|
||||||
|
/// </summary>
|
||||||
|
new bool NewCombo { get; set; }
|
||||||
|
|
||||||
Bindable<bool> LastInComboBindable { get; }
|
Bindable<bool> LastInComboBindable { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -43,10 +43,20 @@ namespace osu.Game.Rulesets.UI
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void Dispose(bool isDisposing)
|
||||||
|
{
|
||||||
|
base.Dispose(isDisposing);
|
||||||
|
unbindStartTimeMap();
|
||||||
|
}
|
||||||
|
|
||||||
public virtual void Clear(bool disposeChildren = true)
|
public virtual void Clear(bool disposeChildren = true)
|
||||||
{
|
{
|
||||||
ClearInternal(disposeChildren);
|
ClearInternal(disposeChildren);
|
||||||
|
unbindStartTimeMap();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void unbindStartTimeMap()
|
||||||
|
{
|
||||||
foreach (var kvp in startTimeMap)
|
foreach (var kvp in startTimeMap)
|
||||||
kvp.Value.bindable.UnbindAll();
|
kvp.Value.bindable.UnbindAll();
|
||||||
startTimeMap.Clear();
|
startTimeMap.Clear();
|
||||||
|
@ -20,6 +20,7 @@ using osu.Game.Graphics.UserInterface;
|
|||||||
using osu.Game.Rulesets.Edit;
|
using osu.Game.Rulesets.Edit;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
|
using osu.Game.Rulesets.Objects.Types;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Edit.Compose.Components
|
namespace osu.Game.Screens.Edit.Compose.Components
|
||||||
@ -44,7 +45,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
protected EditorBeatmap EditorBeatmap { get; private set; }
|
protected EditorBeatmap EditorBeatmap { get; private set; }
|
||||||
|
|
||||||
[Resolved(CanBeNull = true)]
|
[Resolved(CanBeNull = true)]
|
||||||
private IEditorChangeHandler changeHandler { get; set; }
|
protected IEditorChangeHandler ChangeHandler { get; private set; }
|
||||||
|
|
||||||
public SelectionHandler()
|
public SelectionHandler()
|
||||||
{
|
{
|
||||||
@ -193,12 +194,12 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
|
|
||||||
private void deleteSelected()
|
private void deleteSelected()
|
||||||
{
|
{
|
||||||
changeHandler?.BeginChange();
|
ChangeHandler?.BeginChange();
|
||||||
|
|
||||||
foreach (var h in selectedBlueprints.ToList())
|
foreach (var h in selectedBlueprints.ToList())
|
||||||
EditorBeatmap?.Remove(h.HitObject);
|
EditorBeatmap?.Remove(h.HitObject);
|
||||||
|
|
||||||
changeHandler?.EndChange();
|
ChangeHandler?.EndChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@ -254,7 +255,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
/// <param name="sampleName">The name of the hit sample.</param>
|
/// <param name="sampleName">The name of the hit sample.</param>
|
||||||
public void AddHitSample(string sampleName)
|
public void AddHitSample(string sampleName)
|
||||||
{
|
{
|
||||||
changeHandler?.BeginChange();
|
ChangeHandler?.BeginChange();
|
||||||
|
|
||||||
foreach (var h in SelectedHitObjects)
|
foreach (var h in SelectedHitObjects)
|
||||||
{
|
{
|
||||||
@ -265,7 +266,30 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
h.Samples.Add(new HitSampleInfo { Name = sampleName });
|
h.Samples.Add(new HitSampleInfo { Name = sampleName });
|
||||||
}
|
}
|
||||||
|
|
||||||
changeHandler?.EndChange();
|
ChangeHandler?.EndChange();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set the new combo state of all selected <see cref="HitObject"/>s.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="state">Whether to set or unset.</param>
|
||||||
|
/// <exception cref="InvalidOperationException">Throws if any selected object doesn't implement <see cref="IHasComboInformation"/></exception>
|
||||||
|
public void SetNewCombo(bool state)
|
||||||
|
{
|
||||||
|
ChangeHandler?.BeginChange();
|
||||||
|
|
||||||
|
foreach (var h in SelectedHitObjects)
|
||||||
|
{
|
||||||
|
var comboInfo = h as IHasComboInformation;
|
||||||
|
|
||||||
|
if (comboInfo == null)
|
||||||
|
throw new InvalidOperationException($"Tried to change combo state of a {h.GetType()}, which doesn't implement {nameof(IHasComboInformation)}");
|
||||||
|
|
||||||
|
comboInfo.NewCombo = state;
|
||||||
|
EditorBeatmap?.UpdateHitObject(h);
|
||||||
|
}
|
||||||
|
|
||||||
|
ChangeHandler?.EndChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -274,12 +298,12 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
/// <param name="sampleName">The name of the hit sample.</param>
|
/// <param name="sampleName">The name of the hit sample.</param>
|
||||||
public void RemoveHitSample(string sampleName)
|
public void RemoveHitSample(string sampleName)
|
||||||
{
|
{
|
||||||
changeHandler?.BeginChange();
|
ChangeHandler?.BeginChange();
|
||||||
|
|
||||||
foreach (var h in SelectedHitObjects)
|
foreach (var h in SelectedHitObjects)
|
||||||
h.SamplesBindable.RemoveAll(s => s.Name == sampleName);
|
h.SamplesBindable.RemoveAll(s => s.Name == sampleName);
|
||||||
|
|
||||||
changeHandler?.EndChange();
|
ChangeHandler?.EndChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@ -297,6 +321,9 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
|
|
||||||
items.AddRange(GetContextMenuItemsForSelection(selectedBlueprints));
|
items.AddRange(GetContextMenuItemsForSelection(selectedBlueprints));
|
||||||
|
|
||||||
|
if (selectedBlueprints.All(b => b.HitObject is IHasComboInformation))
|
||||||
|
items.Add(createNewComboMenuItem());
|
||||||
|
|
||||||
if (selectedBlueprints.Count == 1)
|
if (selectedBlueprints.Count == 1)
|
||||||
items.AddRange(selectedBlueprints[0].ContextMenuItems);
|
items.AddRange(selectedBlueprints[0].ContextMenuItems);
|
||||||
|
|
||||||
@ -326,6 +353,41 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
protected virtual IEnumerable<MenuItem> GetContextMenuItemsForSelection(IEnumerable<SelectionBlueprint> selection)
|
protected virtual IEnumerable<MenuItem> GetContextMenuItemsForSelection(IEnumerable<SelectionBlueprint> selection)
|
||||||
=> Enumerable.Empty<MenuItem>();
|
=> Enumerable.Empty<MenuItem>();
|
||||||
|
|
||||||
|
private MenuItem createNewComboMenuItem()
|
||||||
|
{
|
||||||
|
return new TernaryStateMenuItem("New combo", MenuItemType.Standard, setNewComboState)
|
||||||
|
{
|
||||||
|
State = { Value = getHitSampleState() }
|
||||||
|
};
|
||||||
|
|
||||||
|
void setNewComboState(TernaryState state)
|
||||||
|
{
|
||||||
|
switch (state)
|
||||||
|
{
|
||||||
|
case TernaryState.False:
|
||||||
|
SetNewCombo(false);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case TernaryState.True:
|
||||||
|
SetNewCombo(true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TernaryState getHitSampleState()
|
||||||
|
{
|
||||||
|
int countExisting = selectedBlueprints.Select(b => (IHasComboInformation)b.HitObject).Count(h => h.NewCombo);
|
||||||
|
|
||||||
|
if (countExisting == 0)
|
||||||
|
return TernaryState.False;
|
||||||
|
|
||||||
|
if (countExisting < SelectedHitObjects.Count())
|
||||||
|
return TernaryState.Indeterminate;
|
||||||
|
|
||||||
|
return TernaryState.True;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private MenuItem createHitSampleMenuItem(string name, string sampleName)
|
private MenuItem createHitSampleMenuItem(string name, string sampleName)
|
||||||
{
|
{
|
||||||
return new TernaryStateMenuItem(name, MenuItemType.Standard, setHitSampleState)
|
return new TernaryStateMenuItem(name, MenuItemType.Standard, setHitSampleState)
|
||||||
|
@ -399,7 +399,7 @@ namespace osu.Game.Screens.Play
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Logger.Error(e, "Could not load beatmap sucessfully!");
|
Logger.Error(e, "Could not load beatmap successfully!");
|
||||||
//couldn't load, hard abort!
|
//couldn't load, hard abort!
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,10 @@ namespace osu.Game.Screens.Ranking.Statistics
|
|||||||
{
|
{
|
||||||
var rows = new FillFlowContainer
|
var rows = new FillFlowContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.X,
|
||||||
|
AutoSizeAxes = Axes.Y,
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
Direction = FillDirection.Vertical,
|
Direction = FillDirection.Vertical,
|
||||||
Spacing = new Vector2(30, 15),
|
Spacing = new Vector2(30, 15),
|
||||||
Alpha = 0
|
Alpha = 0
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2020.911.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2020.923.1" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.904.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.904.0" />
|
||||||
<PackageReference Include="Sentry" Version="2.1.6" />
|
<PackageReference Include="Sentry" Version="2.1.6" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.26.0" />
|
<PackageReference Include="SharpCompress" Version="0.26.0" />
|
||||||
|
@ -70,7 +70,7 @@
|
|||||||
<Reference Include="System.Net.Http" />
|
<Reference Include="System.Net.Http" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Label="Package References">
|
<ItemGroup Label="Package References">
|
||||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2020.911.0" />
|
<PackageReference Include="ppy.osu.Framework.iOS" Version="2020.923.1" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.904.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.904.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<!-- Xamarin.iOS does not automatically handle transitive dependencies from NuGet packages. -->
|
<!-- Xamarin.iOS does not automatically handle transitive dependencies from NuGet packages. -->
|
||||||
@ -80,7 +80,7 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2020.911.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2020.923.1" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.26.0" />
|
<PackageReference Include="SharpCompress" Version="0.26.0" />
|
||||||
<PackageReference Include="NUnit" Version="3.12.0" />
|
<PackageReference Include="NUnit" Version="3.12.0" />
|
||||||
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user