Move scene graph init to ctors.

This commit is contained in:
Dean Herbert
2017-02-12 19:39:54 +09:00
parent 5d4be35c5e
commit e32ccb6153
3 changed files with 22 additions and 27 deletions

View File

@ -18,8 +18,7 @@ namespace osu.Game.Overlays.Notifications
set
{
text = value;
if (IsLoaded)
textDrawable.Text = text;
textDrawable.Text = text;
}
}
@ -30,17 +29,14 @@ namespace osu.Game.Overlays.Notifications
set
{
icon = value;
if (IsLoaded)
iconDrawable.Icon = icon;
iconDrawable.Icon = icon;
}
}
private SpriteText textDrawable;
private TextAwesome iconDrawable;
[BackgroundDependencyLoader]
private void load(OsuColour colours)
public SimpleNotification()
{
IconContent.Add(new Drawable[]
{
@ -64,7 +60,11 @@ namespace osu.Game.Overlays.Notifications
RelativeSizeAxes = Axes.X,
Text = text
});
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
Light.Colour = colours.Green;
}