1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-20 06:12:55 +08:00

Fix bookmarks not working

We should be dealing with the array in every situation, with the exception of the database.
This commit is contained in:
smoogipoo 2017-09-25 17:46:51 +09:00
parent 7fb8008e44
commit d787c740fa
2 changed files with 8 additions and 7 deletions

View File

@ -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; }

View File

@ -96,6 +96,7 @@ namespace osu.Game.Screens.Edit.Components
new BookmarkTimeline
{
Anchor = Anchor.Centre,
Origin = Anchor.TopCentre,
RelativeSizeAxes = Axes.Both,
Height = 0.35f
},