mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Rework notifications to be more flexible.
This commit is contained in:
@ -12,12 +12,33 @@ namespace osu.Game.Overlays.Notifications
|
||||
public class SimpleNotification : Notification
|
||||
{
|
||||
private string text;
|
||||
|
||||
public SimpleNotification(string text)
|
||||
public string Text
|
||||
{
|
||||
this.text = text;
|
||||
get { return text; }
|
||||
set
|
||||
{
|
||||
text = value;
|
||||
if (IsLoaded)
|
||||
textDrawable.Text = text;
|
||||
}
|
||||
}
|
||||
|
||||
private FontAwesome icon = FontAwesome.fa_info_circle;
|
||||
public FontAwesome Icon
|
||||
{
|
||||
get { return icon; }
|
||||
set
|
||||
{
|
||||
icon = value;
|
||||
if (IsLoaded)
|
||||
iconDrawable.Icon = icon;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private SpriteText textDrawable;
|
||||
private TextAwesome iconDrawable;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
@ -28,14 +49,14 @@ namespace osu.Game.Overlays.Notifications
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
ColourInfo = ColourInfo.GradientVertical(OsuColour.Gray(0.2f), OsuColour.Gray(0.5f))
|
||||
},
|
||||
new TextAwesome
|
||||
iconDrawable = new TextAwesome
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Icon = FontAwesome.fa_info_circle,
|
||||
Icon = icon ,
|
||||
}
|
||||
});
|
||||
|
||||
Content.Add(new SpriteText
|
||||
Content.Add(textDrawable = new SpriteText
|
||||
{
|
||||
TextSize = 16,
|
||||
Colour = OsuColour.Gray(128),
|
||||
|
Reference in New Issue
Block a user