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; }
} }
@ -42,31 +42,28 @@ namespace osu.Game.Rulesets.UI
public ModIcon(Mod m) 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,
Origin = Anchor.Centre, Icon = FontAwesome.fa_osu_mod_bg,
Anchor = Anchor.Centre, Colour = pickColour(m),
Icon = FontAwesome.fa_osu_mod_bg, Shadow = true,
Colour = selectColour(m), TextSize = 20
Shadow = true, },
TextSize = 20 modIcon = new TextAwesome
}, {
modIcon = new TextAwesome Origin = Anchor.Centre,
{ Anchor = Anchor.Centre,
Origin = Anchor.Centre, Colour = OsuColour.Gray(84),
Anchor = Anchor.Centre, TextSize = 20,
Colour = OsuColour.Gray(84), Icon = m?.Icon ?? FontAwesome.fa_question,
TextSize = 20, },
Icon = m.Icon, };
},
};
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;