mirror of
https://github.com/ppy/osu.git
synced 2025-02-19 07:04:15 +08:00
Add spacing in code.
This commit is contained in:
parent
3e30935d10
commit
9c2d3990ce
@ -30,19 +30,23 @@ namespace osu.Game.Overlays
|
|||||||
private List<BeatmapSetInfo> playList;
|
private List<BeatmapSetInfo> playList;
|
||||||
private BeatmapDatabase database;
|
private BeatmapDatabase database;
|
||||||
private BeatmapSetInfo currentPlay;
|
private BeatmapSetInfo currentPlay;
|
||||||
|
|
||||||
public AudioTrack CurrentTrack { get; set; }//TODO:gets exterally
|
public AudioTrack CurrentTrack { get; set; }//TODO:gets exterally
|
||||||
|
|
||||||
public MusicController(BeatmapDatabase db = null)
|
public MusicController(BeatmapDatabase db = null)
|
||||||
{
|
{
|
||||||
database = db;
|
database = db;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Load(BaseGame game)
|
public override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load(game);
|
base.Load(game);
|
||||||
osuGame = game as OsuGameBase;
|
osuGame = game as OsuGameBase;
|
||||||
|
|
||||||
if (database == null) database = osuGame.Beatmaps;
|
if (database == null) database = osuGame.Beatmaps;
|
||||||
playList = database.Query<BeatmapSetInfo>().ToList();
|
playList = database.Query<BeatmapSetInfo>().ToList();
|
||||||
currentPlay = playList.FirstOrDefault();
|
currentPlay = playList.FirstOrDefault();
|
||||||
|
|
||||||
Width = 400;
|
Width = 400;
|
||||||
Height = 130;
|
Height = 130;
|
||||||
CornerRadius = 5;
|
CornerRadius = 5;
|
||||||
@ -176,9 +180,10 @@ namespace osu.Game.Overlays
|
|||||||
Colour = Color4.Orange
|
Colour = Color4.Orange
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (currentPlay != null)
|
if (currentPlay != null)
|
||||||
{
|
{
|
||||||
playButton.Icon=FontAwesome.pause;
|
playButton.Icon = FontAwesome.pause;
|
||||||
play(currentPlay, null);
|
play(currentPlay, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -214,7 +219,9 @@ namespace osu.Game.Overlays
|
|||||||
BeatmapMetadata metadata = osuGame.Beatmaps.Query<BeatmapMetadata>().Where(x => x.ID == beatmap.BeatmapMetadataID).First();
|
BeatmapMetadata metadata = osuGame.Beatmaps.Query<BeatmapMetadata>().Where(x => x.ID == beatmap.BeatmapMetadataID).First();
|
||||||
title.Text = metadata.TitleUnicode ?? metadata.Title;
|
title.Text = metadata.TitleUnicode ?? metadata.Title;
|
||||||
artist.Text = metadata.ArtistUnicode ?? metadata.Artist;
|
artist.Text = metadata.ArtistUnicode ?? metadata.Artist;
|
||||||
|
|
||||||
Sprite newBackground;
|
Sprite newBackground;
|
||||||
|
|
||||||
using (ArchiveReader reader = osuGame.Beatmaps.GetReader(currentPlay))
|
using (ArchiveReader reader = osuGame.Beatmaps.GetReader(currentPlay))
|
||||||
{
|
{
|
||||||
CurrentTrack?.Stop();
|
CurrentTrack?.Stop();
|
||||||
@ -222,7 +229,9 @@ namespace osu.Game.Overlays
|
|||||||
CurrentTrack.Start();
|
CurrentTrack.Start();
|
||||||
newBackground = getScaledSprite(TextureLoader.FromStream(reader.ReadFile(metadata.BackgroundFile)));
|
newBackground = getScaledSprite(TextureLoader.FromStream(reader.ReadFile(metadata.BackgroundFile)));
|
||||||
}
|
}
|
||||||
|
|
||||||
Add(newBackground);
|
Add(newBackground);
|
||||||
|
|
||||||
if (isNext == true)
|
if (isNext == true)
|
||||||
{
|
{
|
||||||
newBackground.Position = new Vector2(400, 0);
|
newBackground.Position = new Vector2(400, 0);
|
||||||
@ -241,6 +250,7 @@ namespace osu.Game.Overlays
|
|||||||
{
|
{
|
||||||
Remove(backgroundSprite);
|
Remove(backgroundSprite);
|
||||||
}
|
}
|
||||||
|
|
||||||
backgroundSprite = newBackground;
|
backgroundSprite = newBackground;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user