1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-15 17:47:18 +08:00

Merge pull request #10684 from peppy/ios-editor-crash-fix

Fix crash on entering the editor on iOS
This commit is contained in:
Dan Balasescu 2020-11-04 17:02:09 +09:00 committed by GitHub
commit a386765a9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 23 additions and 21 deletions

2
.gitignore vendored
View File

@ -334,3 +334,5 @@ inspectcode
# BenchmarkDotNet
/BenchmarkDotNet.Artifacts
*.GeneratedMSBuildEditorConfig.editorconfig

View File

@ -4,5 +4,6 @@ M:System.ValueType.Equals(System.Object)~System.Boolean;Don't use object.Equals(
M:System.Nullable`1.Equals(System.Object)~System.Boolean;Use == instead.
T:System.IComparable;Don't use non-generic IComparable. Use generic version instead.
M:osu.Framework.Graphics.Sprites.SpriteText.#ctor;Use OsuSpriteText.
M:osu.Framework.Bindables.IBindableList`1.GetBoundCopy();Fails on iOS. Use manual ctor + BindTo instead. (see https://github.com/mono/mono/issues/19900)
T:Microsoft.EntityFrameworkCore.Internal.EnumerableExtensions;Don't use internal extension methods.
T:Microsoft.EntityFrameworkCore.Internal.TypeExtensions;Don't use internal extension methods.

View File

@ -22,7 +22,7 @@ namespace osu.Game.Rulesets.Taiko.Audio
private readonly ControlPointInfo controlPoints;
private readonly Dictionary<double, DrumSample> mappings = new Dictionary<double, DrumSample>();
private IBindableList<SampleControlPoint> samplePoints;
private readonly IBindableList<SampleControlPoint> samplePoints = new BindableList<SampleControlPoint>();
public DrumSampleContainer(ControlPointInfo controlPoints)
{
@ -32,7 +32,7 @@ namespace osu.Game.Rulesets.Taiko.Audio
[BackgroundDependencyLoader]
private void load()
{
samplePoints = controlPoints.SamplePoints.GetBoundCopy();
samplePoints.BindTo(controlPoints.SamplePoints);
samplePoints.BindCollectionChanged((_, __) => recreateMappings(), true);
}

View File

@ -43,7 +43,7 @@ namespace osu.Game.Tests.Visual.Gameplay
private Replay replay;
private IBindableList<int> users;
private readonly IBindableList<int> users = new BindableList<int>();
private TestReplayRecorder recorder;
@ -67,7 +67,7 @@ namespace osu.Game.Tests.Visual.Gameplay
{
replay = new Replay();
users = streamingClient.PlayingUsers.GetBoundCopy();
users.BindTo(streamingClient.PlayingUsers);
users.BindCollectionChanged((obj, args) =>
{
switch (args.Action)

View File

@ -20,7 +20,7 @@ namespace osu.Game.Overlays.Dashboard
{
internal class CurrentlyPlayingDisplay : CompositeDrawable
{
private IBindableList<int> playingUsers;
private readonly IBindableList<int> playingUsers = new BindableList<int>();
private FillFlowContainer<PlayingUserPanel> userFlow;
@ -48,7 +48,7 @@ namespace osu.Game.Overlays.Dashboard
{
base.LoadComplete();
playingUsers = spectatorStreaming.PlayingUsers.GetBoundCopy();
playingUsers.BindTo(spectatorStreaming.PlayingUsers);
playingUsers.BindCollectionChanged((sender, e) => Schedule(() =>
{
switch (e.Action)

View File

@ -14,13 +14,13 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
/// </summary>
public class ControlPointPart : TimelinePart<GroupVisualisation>
{
private IBindableList<ControlPointGroup> controlPointGroups;
private readonly IBindableList<ControlPointGroup> controlPointGroups = new BindableList<ControlPointGroup>();
protected override void LoadBeatmap(WorkingBeatmap beatmap)
{
base.LoadBeatmap(beatmap);
controlPointGroups = beatmap.Beatmap.ControlPointInfo.Groups.GetBoundCopy();
controlPointGroups.BindTo(beatmap.Beatmap.ControlPointInfo.Groups);
controlPointGroups.BindCollectionChanged((sender, args) =>
{
switch (args.Action)

View File

@ -15,7 +15,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
{
public readonly ControlPointGroup Group;
private BindableList<ControlPoint> controlPoints;
private readonly IBindableList<ControlPoint> controlPoints = new BindableList<ControlPoint>();
[Resolved]
private OsuColour colours { get; set; }
@ -30,7 +30,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
{
base.LoadComplete();
controlPoints = (BindableList<ControlPoint>)Group.ControlPoints.GetBoundCopy();
controlPoints.BindTo(Group.ControlPoints);
controlPoints.BindCollectionChanged((_, __) =>
{
if (controlPoints.Count == 0)

View File

@ -16,7 +16,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
/// </summary>
public class TimelineControlPointDisplay : TimelinePart<TimelineControlPointGroup>
{
private IBindableList<ControlPointGroup> controlPointGroups;
private readonly IBindableList<ControlPointGroup> controlPointGroups = new BindableList<ControlPointGroup>();
public TimelineControlPointDisplay()
{
@ -27,7 +27,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
{
base.LoadBeatmap(beatmap);
controlPointGroups = beatmap.Beatmap.ControlPointInfo.Groups.GetBoundCopy();
controlPointGroups.BindTo(beatmap.Beatmap.ControlPointInfo.Groups);
controlPointGroups.BindCollectionChanged((sender, args) =>
{
switch (args.Action)

View File

@ -14,7 +14,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
{
public readonly ControlPointGroup Group;
private BindableList<ControlPoint> controlPoints;
private readonly IBindableList<ControlPoint> controlPoints = new BindableList<ControlPoint>();
[Resolved]
private OsuColour colours { get; set; }
@ -34,7 +34,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
{
base.LoadComplete();
controlPoints = (BindableList<ControlPoint>)Group.ControlPoints.GetBoundCopy();
controlPoints.BindTo(Group.ControlPoints);
controlPoints.BindCollectionChanged((_, __) =>
{
ClearInternal();

View File

@ -98,7 +98,7 @@ namespace osu.Game.Screens.Edit.Timing
private class ControlGroupAttributes : CompositeDrawable
{
private readonly IBindableList<ControlPoint> controlPoints;
private readonly IBindableList<ControlPoint> controlPoints = new BindableList<ControlPoint>();
private readonly FillFlowContainer fill;
@ -112,7 +112,7 @@ namespace osu.Game.Screens.Edit.Timing
Spacing = new Vector2(2)
};
controlPoints = group.ControlPoints.GetBoundCopy();
controlPoints.BindTo(group.ControlPoints);
}
[Resolved]

View File

@ -56,7 +56,7 @@ namespace osu.Game.Screens.Edit.Timing
private OsuButton deleteButton;
private ControlPointTable table;
private IBindableList<ControlPointGroup> controlGroups;
private readonly IBindableList<ControlPointGroup> controlPointGroups = new BindableList<ControlPointGroup>();
[Resolved]
private EditorClock clock { get; set; }
@ -124,11 +124,10 @@ namespace osu.Game.Screens.Edit.Timing
selectedGroup.BindValueChanged(selected => { deleteButton.Enabled.Value = selected.NewValue != null; }, true);
controlGroups = Beatmap.Value.Beatmap.ControlPointInfo.Groups.GetBoundCopy();
controlGroups.BindCollectionChanged((sender, args) =>
controlPointGroups.BindTo(Beatmap.Value.Beatmap.ControlPointInfo.Groups);
controlPointGroups.BindCollectionChanged((sender, args) =>
{
table.ControlGroups = controlGroups;
table.ControlGroups = controlPointGroups;
changeHandler.SaveState();
}, true);
}