Move drawable assignment to load, remove depth overrides

This commit is contained in:
Dean Herbert 2017-12-07 20:44:55 +09:00
parent 8c89354b36
commit 24b3b10942

View File

@ -1,6 +1,7 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Framework.Configuration; using osu.Framework.Configuration;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
@ -15,16 +16,15 @@ namespace osu.Game.Overlays.BeatmapSet
{ {
public readonly Bindable<bool> Favourited = new Bindable<bool>(); public readonly Bindable<bool> Favourited = new Bindable<bool>();
public FavouriteButton() [BackgroundDependencyLoader]
private void load()
{ {
Container pink; Container pink;
SpriteIcon icon; SpriteIcon icon;
AddRange(new Drawable[] AddRange(new Drawable[]
{ {
pink = new Container pink = new Container
{ {
Depth = -1,
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Alpha = 0f, Alpha = 0f,
Children = new Drawable[] Children = new Drawable[]
@ -45,7 +45,6 @@ namespace osu.Game.Overlays.BeatmapSet
}, },
icon = new SpriteIcon icon = new SpriteIcon
{ {
Depth = -1,
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
Icon = FontAwesome.fa_heart_o, Icon = FontAwesome.fa_heart_o,