1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-22 23:13:21 +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 public new Color4 Colour
{ {
get { return background?.Colour ?? Color4.Transparent; } get { return background.Colour; }
set { background.Colour = value; } set { background.Colour = value; }
} }
@ -41,8 +41,6 @@ namespace osu.Game.Rulesets.UI
} }
public ModIcon(Mod m) public ModIcon(Mod m)
{
if(m!= null)
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
@ -51,7 +49,7 @@ namespace osu.Game.Rulesets.UI
Origin = Anchor.Centre, Origin = Anchor.Centre,
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Icon = FontAwesome.fa_osu_mod_bg, Icon = FontAwesome.fa_osu_mod_bg,
Colour = selectColour(m), Colour = pickColour(m),
Shadow = true, Shadow = true,
TextSize = 20 TextSize = 20
}, },
@ -61,13 +59,12 @@ namespace osu.Game.Rulesets.UI
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Colour = OsuColour.Gray(84), Colour = OsuColour.Gray(84),
TextSize = 20, TextSize = 20,
Icon = m.Icon, Icon = m?.Icon ?? FontAwesome.fa_question,
}, },
}; };
reapplySize(); reapplySize();
} }
}
private void reapplySize() private void reapplySize()
{ {
@ -75,9 +72,9 @@ namespace osu.Game.Rulesets.UI
modIcon.TextSize = iconSize - 35; modIcon.TextSize = iconSize - 35;
} }
private Color4 selectColour(Mod mod) private Color4 pickColour(Mod mod)
{ {
switch (mod.Type) switch (mod?.Type)
{ {
case ModType.DifficultyIncrease: case ModType.DifficultyIncrease:
return OsuColour.FromHex(@"ffcc22"); return OsuColour.FromHex(@"ffcc22");

View File

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