mirror of
https://github.com/ppy/osu
synced 2025-01-11 08:39:31 +00:00
Move scene graph init to ctors.
This commit is contained in:
parent
5d4be35c5e
commit
e32ccb6153
@ -53,8 +53,7 @@ namespace osu.Game.Overlays.Notifications
|
||||
}
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
public Notification()
|
||||
{
|
||||
RelativeSizeAxes = Axes.X;
|
||||
AutoSizeAxes = Axes.Y;
|
||||
|
@ -16,27 +16,21 @@ namespace osu.Game.Overlays.Notifications
|
||||
{
|
||||
public class ProgressNotification : Notification, IHasCompletionTarget
|
||||
{
|
||||
private string text;
|
||||
public string Text
|
||||
{
|
||||
get { return text; }
|
||||
get { return textDrawable.Text; }
|
||||
set
|
||||
{
|
||||
text = value;
|
||||
if (IsLoaded)
|
||||
textDrawable.Text = text;
|
||||
textDrawable.Text = value;
|
||||
}
|
||||
}
|
||||
|
||||
private float progress;
|
||||
public float Progress
|
||||
{
|
||||
get { return progress; }
|
||||
get { return progressBar.Progress; }
|
||||
set
|
||||
{
|
||||
progress = value;
|
||||
if (IsLoaded)
|
||||
progressBar.Progress = progress;
|
||||
progressBar.Progress = value;
|
||||
}
|
||||
}
|
||||
|
||||
@ -46,7 +40,6 @@ namespace osu.Game.Overlays.Notifications
|
||||
|
||||
//we may have received changes before we were displayed.
|
||||
State = state;
|
||||
Progress = progress;
|
||||
}
|
||||
|
||||
public virtual ProgressNotificationState State
|
||||
@ -105,6 +98,7 @@ namespace osu.Game.Overlays.Notifications
|
||||
|
||||
protected virtual void Completed()
|
||||
{
|
||||
Expire();
|
||||
CompletionTarget?.Invoke(CreateCompletionNotification());
|
||||
}
|
||||
|
||||
@ -117,13 +111,8 @@ namespace osu.Game.Overlays.Notifications
|
||||
|
||||
private SpriteText textDrawable;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
public ProgressNotification()
|
||||
{
|
||||
colourQueued = colours.YellowDark;
|
||||
colourActive = colours.Blue;
|
||||
colourCancelled = colours.Red;
|
||||
|
||||
IconContent.Add(new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
@ -135,7 +124,6 @@ namespace osu.Game.Overlays.Notifications
|
||||
Colour = OsuColour.Gray(128),
|
||||
AutoSizeAxes = Axes.Y,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Text = text
|
||||
});
|
||||
|
||||
NotificationContent.Add(progressBar = new ProgressBar
|
||||
@ -148,6 +136,14 @@ namespace osu.Game.Overlays.Notifications
|
||||
State = ProgressNotificationState.Queued;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
colourQueued = colours.YellowDark;
|
||||
colourActive = colours.Blue;
|
||||
colourCancelled = colours.Red;
|
||||
}
|
||||
|
||||
public override void Close()
|
||||
{
|
||||
switch (State)
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user