1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-21 00:53:31 +08:00
This commit is contained in:
EVAST9919 2017-05-03 13:53:45 +03:00
parent e7a8619f01
commit 9e35eb8d97
2 changed files with 22 additions and 27 deletions

View File

@ -30,7 +30,7 @@ namespace osu.Game.Rulesets.UI
public new Color4 Colour
{
get { return background?.Colour ?? Color4.Transparent; }
get { return background.Colour; }
set { background.Colour = value; }
}
@ -42,31 +42,28 @@ namespace osu.Game.Rulesets.UI
public ModIcon(Mod m)
{
if(m!= null)
Children = new Drawable[]
{
Children = new Drawable[]
background = new TextAwesome
{
background = new TextAwesome
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
Icon = FontAwesome.fa_osu_mod_bg,
Colour = selectColour(m),
Shadow = true,
TextSize = 20
},
modIcon = new TextAwesome
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
Colour = OsuColour.Gray(84),
TextSize = 20,
Icon = m.Icon,
},
};
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
Icon = FontAwesome.fa_osu_mod_bg,
Colour = pickColour(m),
Shadow = true,
TextSize = 20
},
modIcon = new TextAwesome
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
Colour = OsuColour.Gray(84),
TextSize = 20,
Icon = m?.Icon ?? FontAwesome.fa_question,
},
};
reapplySize();
}
reapplySize();
}
private void reapplySize()
@ -75,9 +72,9 @@ namespace osu.Game.Rulesets.UI
modIcon.TextSize = iconSize - 35;
}
private Color4 selectColour(Mod mod)
private Color4 pickColour(Mod mod)
{
switch (mod.Type)
switch (mod?.Type)
{
case ModType.DifficultyIncrease:
return OsuColour.FromHex(@"ffcc22");

View File

@ -5,8 +5,6 @@ using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.UI;
using osu.Framework.Graphics;
using OpenTK.Graphics;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using OpenTK;