Merge branch 'refs/heads/master' into dependency-injection

# Conflicts:
#	osu-framework
#	osu.Game/GameModes/OsuGameMode.cs
#	osu.Game/GameModes/Play/Player.cs
#	osu.Game/OsuGame.cs
#	osu.Game/Overlays/MusicController.cs
#	osu.Game/Overlays/Options/EditorSection.cs
#	osu.Game/Overlays/Options/Input/MouseOptions.cs
#	osu.Game/Overlays/Options/Online/InGameChatOptions.cs
#	osu.Game/Overlays/Options/SkinSection.cs
This commit is contained in:
Dean Herbert
2016-11-12 19:44:16 +09:00
82 changed files with 688 additions and 328 deletions

View File

@ -100,8 +100,8 @@ namespace osu.Game.Beatmaps.Drawable
};
}
[Initializer]
private void Load(BaseGame game)
[BackgroundDependencyLoader]
private void load(BaseGame game)
{
BeatmapPanels = beatmapSet.Beatmaps.Select(b => new BeatmapPanel(b)
{

View File

@ -2,20 +2,28 @@
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites;
using osu.Game.Database;
using osu.Game.Graphics;
using OpenTK;
using OpenTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites;
using osu.Game.Database;
using osu.Game.Graphics;
using OpenTK;
using OpenTK.Graphics;
using osu.Framework;
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Game.Configuration;
namespace osu.Game.Beatmaps.Drawable
{
class BeatmapSetHeader : Panel
{
public Action<BeatmapSetHeader> GainedSelection;
public Action<BeatmapSetHeader> GainedSelection;
private BeatmapSetInfo beatmapSet;
private SpriteText title, artist;
private OsuConfigManager config;
private Bindable<bool> preferUnicode;
protected override void Selected()
{
@ -29,10 +37,33 @@ namespace osu.Game.Beatmaps.Drawable
{
base.Deselected();
Width = 0.8f;
}
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
{
this.config = config;
preferUnicode = config.GetBindable<bool>(OsuConfig.ShowUnicode);
preferUnicode.ValueChanged += preferUnicode_changed;
preferUnicode_changed(preferUnicode, null);
}
private void preferUnicode_changed(object sender, EventArgs e)
{
title.Text = config.GetUnicodeString(beatmapSet.Metadata.Title, beatmapSet.Metadata.TitleUnicode);
artist.Text = config.GetUnicodeString(beatmapSet.Metadata.Artist, beatmapSet.Metadata.ArtistUnicode);
}
protected override void Dispose(bool isDisposing)
{
if (preferUnicode != null)
preferUnicode.ValueChanged -= preferUnicode_changed;
base.Dispose(isDisposing);
}
public BeatmapSetHeader(BeatmapSetInfo beatmapSet, WorkingBeatmap working)
{
this.beatmapSet = beatmapSet;
Children = new Framework.Graphics.Drawable[]
{
@ -51,16 +82,16 @@ namespace osu.Game.Beatmaps.Drawable
Padding = new MarginPadding { Top = 10, Left = 15, Right = 10, Bottom = 10 },
AutoSizeAxes = Axes.Both,
Children = new[]
new SpriteText
{
title = new SpriteText
{
Text = beatmapSet.Metadata.Title ?? beatmapSet.Metadata.TitleUnicode,
Font = @"Exo2.0-SemiBoldItalic",
Text = beatmapSet.Metadata.Title,
TextSize = 22
new SpriteText
},
artist = new SpriteText
{
Text = beatmapSet.Metadata.Artist ?? beatmapSet.Metadata.ArtistUnicode,
Font = @"Exo2.0-MediumItalic",
Text = beatmapSet.Metadata.Artist,
TextSize = 16
},