From d787c740fa22e83be06b4022814d8bb362084836 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 25 Sep 2017 17:46:51 +0900 Subject: [PATCH] Fix bookmarks not working We should be dealing with the array in every situation, with the exception of the database. --- osu.Game/Beatmaps/BeatmapInfo.cs | 14 +++++++------- .../Screens/Edit/Components/SummaryTimeline.cs | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/osu.Game/Beatmaps/BeatmapInfo.cs b/osu.Game/Beatmaps/BeatmapInfo.cs index e031f25fa2..3cd6294b4a 100644 --- a/osu.Game/Beatmaps/BeatmapInfo.cs +++ b/osu.Game/Beatmaps/BeatmapInfo.cs @@ -78,15 +78,15 @@ namespace osu.Game.Beatmaps // Editor // This bookmarks stuff is necessary because DB doesn't know how to store int[] - public string StoredBookmarks { get; set; } + [JsonIgnore] + public string StoredBookmarks + { + get { return string.Join(",", Bookmarks); } + set { Bookmarks = value?.Split(',').Select(v => int.Parse(v.Trim())).ToArray() ?? new int[0]; } + } [Ignore] - [JsonIgnore] - public int[] Bookmarks - { - get { return StoredBookmarks?.Split(',').Select(int.Parse).ToArray() ?? new int[0]; } - set { StoredBookmarks = string.Join(",", value); } - } + public int[] Bookmarks { get; set; } = new int[0]; public double DistanceSpacing { get; set; } public int BeatDivisor { get; set; } diff --git a/osu.Game/Screens/Edit/Components/SummaryTimeline.cs b/osu.Game/Screens/Edit/Components/SummaryTimeline.cs index ffb54ba7b1..80250eebc3 100644 --- a/osu.Game/Screens/Edit/Components/SummaryTimeline.cs +++ b/osu.Game/Screens/Edit/Components/SummaryTimeline.cs @@ -96,6 +96,7 @@ namespace osu.Game.Screens.Edit.Components new BookmarkTimeline { Anchor = Anchor.Centre, + Origin = Anchor.TopCentre, RelativeSizeAxes = Axes.Both, Height = 0.35f },