Add star counter to difficulty select

This commit is contained in:
Drew DeVault 2016-10-20 15:33:46 -04:00
parent 910a079bda
commit 8d6431b35e
2 changed files with 22 additions and 10 deletions

View File

@ -77,6 +77,8 @@ public void ImportBeatmap(string path)
// TODO: Diff beatmap metadata with set metadata and leave it here if necessary
beatmap.BeatmapInfo.Metadata = null;
beatmapSet.Beatmaps.Add(beatmap.BeatmapInfo);
connection.Insert(beatmap.BeatmapInfo.BaseDifficulty);
beatmap.BeatmapInfo.BaseDifficultyID = beatmap.BeatmapInfo.BaseDifficulty.ID;
connection.Insert(beatmap.BeatmapInfo);
}
}

View File

@ -17,6 +17,7 @@
using OpenTK;
using osu.Game.Graphics;
using osu.Framework.Graphics.Transformations;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.GameModes.Play
{
@ -73,6 +74,11 @@ public BeatmapButton(BeatmapSetInfo set, BeatmapInfo beatmap)
new FlowContainer
{
Padding = new MarginPadding { Left = 10 },
Direction = FlowDirection.VerticalOnly,
Children = new Drawable[]
{
new FlowContainer
{
Direction = FlowDirection.HorizontalOnly,
Children = new[]
{
@ -83,10 +89,14 @@ public BeatmapButton(BeatmapSetInfo set, BeatmapInfo beatmap)
},
new SpriteText
{
Text = string.Format(" mapped by {0}", (beatmap.Metadata ?? set.Metadata).Author),
Text = string.Format(" mapped by {0}",
(beatmap.Metadata ?? set.Metadata).Author),
TextSize = 16,
},
}
},
new StarCounter { Count = beatmap.BaseDifficulty?.OverallDifficulty ?? 5, StarSize = 8 }
}
}
}
}