mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 08:49:59 +09:00
Simplify colour assigning logic and remove system mod colour for now
This commit is contained in:
@ -15,6 +15,7 @@ using osu.Game.Graphics.Sprites;
|
|||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.UI
|
namespace osu.Game.Rulesets.UI
|
||||||
@ -53,7 +54,6 @@ namespace osu.Game.Rulesets.UI
|
|||||||
private OsuColour colours { get; set; }
|
private OsuColour colours { get; set; }
|
||||||
|
|
||||||
private Color4 backgroundColour;
|
private Color4 backgroundColour;
|
||||||
private Color4 highlightedColour;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Construct a new instance.
|
/// Construct a new instance.
|
||||||
@ -123,19 +123,13 @@ namespace osu.Game.Rulesets.UI
|
|||||||
modAcronym.FadeOut();
|
modAcronym.FadeOut();
|
||||||
}
|
}
|
||||||
|
|
||||||
Color4 typeColour = colours.ForModType(value.Type);
|
backgroundColour = colours.ForModType(value.Type);
|
||||||
backgroundColour = typeColour;
|
|
||||||
highlightedColour = ((Colour4)typeColour).Lighten(.2f);
|
|
||||||
|
|
||||||
if (value.Type == ModType.System)
|
|
||||||
modIcon.Colour = colours.Yellow;
|
|
||||||
|
|
||||||
updateColour();
|
updateColour();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateColour()
|
private void updateColour()
|
||||||
{
|
{
|
||||||
background.Colour = Selected.Value ? highlightedColour : backgroundColour;
|
background.Colour = Selected.Value ? backgroundColour.Lighten(0.2f) : backgroundColour;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user