diff --git a/osu.Game.Rulesets.Catch/CatchRuleset.cs b/osu.Game.Rulesets.Catch/CatchRuleset.cs index 8d45ea8fa2..69f22f7121 100644 --- a/osu.Game.Rulesets.Catch/CatchRuleset.cs +++ b/osu.Game.Rulesets.Catch/CatchRuleset.cs @@ -20,6 +20,24 @@ namespace osu.Game.Rulesets.Catch { public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap, bool isForCurrentRuleset) => new CatchRulesetContainer(this, beatmap, isForCurrentRuleset); + public override IEnumerable GetAllMods() => new Mod[] + { + new CatchModEasy(), + new CatchModNoFail(), + new CatchModHalfTime(), + new CatchModDaycore(), + new CatchModHardRock(), + new CatchModSuddenDeath(), + new CatchModPerfect(), + new CatchModDoubleTime(), + new CatchModNightcore(), + new CatchModHidden(), + new CatchModFlashlight(), + new CatchModRelax(), + new ModAutoplay(), + new ModCinema() + }; + public override IEnumerable GetModsFor(ModType type) { switch (type) diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index 50ad6960ae..3a7c072604 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -19,6 +19,36 @@ namespace osu.Game.Rulesets.Mania { public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap, bool isForCurrentRuleset) => new ManiaRulesetContainer(this, beatmap, isForCurrentRuleset); + public override IEnumerable GetAllMods() => new Mod[] + { + new ManiaModEasy(), + new ManiaModNoFail(), + new ManiaModHalfTime(), + new ManiaModDaycore(), + new ManiaModHardRock(), + new ManiaModSuddenDeath(), + new ManiaModPerfect(), + new ManiaModDoubleTime(), + new ManiaModNightcore(), + new ManiaModFadeIn(), + new ManiaModHidden(), + new ManiaModFlashlight(), + new ManiaModKey4(), + new ManiaModKey5(), + new ManiaModKey6(), + new ManiaModKey7(), + new ManiaModKey8(), + new ManiaModKey9(), + new ManiaModKey1(), + new ManiaModKey2(), + new ManiaModKey3(), + new ManiaModRandom(), + new ManiaModKeyCoop(), + new ModAutoplay(), + new ModCinema(), + new ManiaModGravity() + }; + public override IEnumerable GetModsFor(ModType type) { switch (type) diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs b/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs index f44ad6fd60..12aa9b0886 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs @@ -68,6 +68,7 @@ namespace osu.Game.Rulesets.Mania.Mods public class ManiaModFadeIn : Mod { public override string Name => "FadeIn"; + public override string ShortenedName => "FI"; public override FontAwesome Icon => FontAwesome.fa_osu_mod_hidden; public override ModType Type => ModType.DifficultyIncrease; public override double ScoreMultiplier => 1; @@ -78,12 +79,14 @@ namespace osu.Game.Rulesets.Mania.Mods public class ManiaModRandom : Mod { public override string Name => "Random"; + public override string ShortenedName => "RD"; public override string Description => @"Shuffle around the notes!"; public override double ScoreMultiplier => 1; } public abstract class ManiaKeyMod : Mod { + public override string ShortenedName => Name; public abstract int KeyCount { get; } public override double ScoreMultiplier => 1; // TODO: Implement the mania key mod score multiplier public override bool Ranked => true; @@ -146,6 +149,7 @@ namespace osu.Game.Rulesets.Mania.Mods public class ManiaModKeyCoop : Mod { public override string Name => "KeyCoop"; + public override string ShortenedName => "CO"; public override string Description => @"Double the key amount, double the fun!"; public override double ScoreMultiplier => 1; public override bool Ranked => true; diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModGravity.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModGravity.cs index a054e0db56..132c49ab31 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModGravity.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModGravity.cs @@ -15,6 +15,7 @@ namespace osu.Game.Rulesets.Mania.Mods public class ManiaModGravity : Mod, IGenerateSpeedAdjustments { public override string Name => "Gravity"; + public override string ShortenedName => "GR"; public override double ScoreMultiplier => 0; diff --git a/osu.Game.Rulesets.Osu/Mods/OsuMod.cs b/osu.Game.Rulesets.Osu/Mods/OsuMod.cs index 3b0cfc1ef1..649e6cfb3c 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuMod.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuMod.cs @@ -78,6 +78,7 @@ namespace osu.Game.Rulesets.Osu.Mods public class OsuModSpunOut : Mod { public override string Name => "Spun Out"; + public override string ShortenedName => "SO"; public override FontAwesome Icon => FontAwesome.fa_osu_mod_spunout; public override string Description => @"Spinners will be automatically completed"; public override double ScoreMultiplier => 0.9; @@ -88,6 +89,7 @@ namespace osu.Game.Rulesets.Osu.Mods public class OsuModAutopilot : Mod { public override string Name => "Autopilot"; + public override string ShortenedName => "AP"; public override FontAwesome Icon => FontAwesome.fa_osu_mod_autopilot; public override string Description => @"Automatic cursor movement - just follow the rhythm."; public override double ScoreMultiplier => 0; @@ -108,6 +110,7 @@ namespace osu.Game.Rulesets.Osu.Mods public class OsuModTarget : Mod { public override string Name => "Target"; + public override string ShortenedName => "TP"; public override FontAwesome Icon => FontAwesome.fa_osu_mod_target; public override string Description => @""; public override double ScoreMultiplier => 1; diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index 212c634aaf..fbcb5e3abf 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -24,6 +24,27 @@ namespace osu.Game.Rulesets.Osu { public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap, bool isForCurrentRuleset) => new OsuRulesetContainer(this, beatmap, isForCurrentRuleset); + public override IEnumerable GetAllMods() => new Mod[] + { + new OsuModEasy(), + new OsuModNoFail(), + new OsuModHalfTime(), + new OsuModDaycore(), + new OsuModHardRock(), + new OsuModSuddenDeath(), + new OsuModPerfect(), + new OsuModDoubleTime(), + new OsuModNightcore(), + new OsuModHidden(), + new OsuModFlashlight(), + new OsuModRelax(), + new OsuModAutopilot(), + new OsuModSpunOut(), + new OsuModAutoplay(), + new ModCinema(), + new OsuModTarget(), + }; + public override IEnumerable GetBeatmapStatistics(WorkingBeatmap beatmap) => new[] { new BeatmapStatistic diff --git a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs index 4d4bbb7bc5..3e126cec4e 100644 --- a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs +++ b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs @@ -20,6 +20,24 @@ namespace osu.Game.Rulesets.Taiko { public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap, bool isForCurrentRuleset) => new TaikoRulesetContainer(this, beatmap, isForCurrentRuleset); + public override IEnumerable GetAllMods() => new Mod[] + { + new TaikoModEasy(), + new TaikoModNoFail(), + new TaikoModHalfTime(), + new TaikoModDaycore(), + new TaikoModHardRock(), + new TaikoModSuddenDeath(), + new TaikoModPerfect(), + new TaikoModDoubleTime(), + new TaikoModNightcore(), + new TaikoModHidden(), + new TaikoModFlashlight(), + new TaikoModRelax(), + new TaikoModAutoplay(), + new ModCinema() + }; + public override IEnumerable GetModsFor(ModType type) { switch (type) diff --git a/osu.Game/Beatmaps/DummyWorkingBeatmap.cs b/osu.Game/Beatmaps/DummyWorkingBeatmap.cs index 2fb9a568f8..f807b5828f 100644 --- a/osu.Game/Beatmaps/DummyWorkingBeatmap.cs +++ b/osu.Game/Beatmaps/DummyWorkingBeatmap.cs @@ -58,6 +58,8 @@ namespace osu.Game.Beatmaps private class DummyRuleset : Ruleset { + public override IEnumerable GetAllMods() => new Mod[] { }; + public override IEnumerable GetModsFor(ModType type) => new Mod[] { }; public override Mod GetAutoplayMod() => new ModAutoplay(); diff --git a/osu.Game/Rulesets/Mods/Mod.cs b/osu.Game/Rulesets/Mods/Mod.cs index f54267af29..7b0034863e 100644 --- a/osu.Game/Rulesets/Mods/Mod.cs +++ b/osu.Game/Rulesets/Mods/Mod.cs @@ -16,6 +16,11 @@ namespace osu.Game.Rulesets.Mods /// public abstract string Name { get; } + /// + /// The shortened name of this mod. + /// + public abstract string ShortenedName { get; } + /// /// The icon of this mod. /// diff --git a/osu.Game/Rulesets/Mods/ModAutoplay.cs b/osu.Game/Rulesets/Mods/ModAutoplay.cs index ca120e446e..2b10d098f3 100644 --- a/osu.Game/Rulesets/Mods/ModAutoplay.cs +++ b/osu.Game/Rulesets/Mods/ModAutoplay.cs @@ -24,6 +24,7 @@ namespace osu.Game.Rulesets.Mods public class ModAutoplay : Mod { public override string Name => "Autoplay"; + public override string ShortenedName => "AT"; public override FontAwesome Icon => FontAwesome.fa_osu_mod_auto; public override string Description => "Watch a perfect automated play through the song"; public override double ScoreMultiplier => 0; diff --git a/osu.Game/Rulesets/Mods/ModCinema.cs b/osu.Game/Rulesets/Mods/ModCinema.cs index 332bd2c5ac..581fbc5e3a 100644 --- a/osu.Game/Rulesets/Mods/ModCinema.cs +++ b/osu.Game/Rulesets/Mods/ModCinema.cs @@ -8,6 +8,7 @@ namespace osu.Game.Rulesets.Mods public class ModCinema : ModAutoplay { public override string Name => "Cinema"; + public override string ShortenedName => "CN"; public override FontAwesome Icon => FontAwesome.fa_osu_mod_cinema; } } \ No newline at end of file diff --git a/osu.Game/Rulesets/Mods/ModDaycore.cs b/osu.Game/Rulesets/Mods/ModDaycore.cs index 3e878d7104..cbad224316 100644 --- a/osu.Game/Rulesets/Mods/ModDaycore.cs +++ b/osu.Game/Rulesets/Mods/ModDaycore.cs @@ -10,6 +10,7 @@ namespace osu.Game.Rulesets.Mods public abstract class ModDaycore : ModHalfTime { public override string Name => "Daycore"; + public override string ShortenedName => "DC"; public override FontAwesome Icon => FontAwesome.fa_question; public override string Description => "whoaaaaa"; diff --git a/osu.Game/Rulesets/Mods/ModDoubleTime.cs b/osu.Game/Rulesets/Mods/ModDoubleTime.cs index 1aab56a9fc..d8aa5ea1d2 100644 --- a/osu.Game/Rulesets/Mods/ModDoubleTime.cs +++ b/osu.Game/Rulesets/Mods/ModDoubleTime.cs @@ -10,6 +10,7 @@ namespace osu.Game.Rulesets.Mods public class ModDoubleTime : Mod, IApplicableToClock { public override string Name => "Double Time"; + public override string ShortenedName => "DT"; public override FontAwesome Icon => FontAwesome.fa_osu_mod_doubletime; public override ModType Type => ModType.DifficultyIncrease; public override string Description => "Zoooooooooom"; diff --git a/osu.Game/Rulesets/Mods/ModEasy.cs b/osu.Game/Rulesets/Mods/ModEasy.cs index 075a62b0d7..aaf083fd9e 100644 --- a/osu.Game/Rulesets/Mods/ModEasy.cs +++ b/osu.Game/Rulesets/Mods/ModEasy.cs @@ -10,6 +10,7 @@ namespace osu.Game.Rulesets.Mods public abstract class ModEasy : Mod, IApplicableToDifficulty { public override string Name => "Easy"; + public override string ShortenedName => "EZ"; public override FontAwesome Icon => FontAwesome.fa_osu_mod_easy; public override ModType Type => ModType.DifficultyReduction; public override string Description => "Reduces overall difficulty - larger circles, more forgiving HP drain, less accuracy required."; diff --git a/osu.Game/Rulesets/Mods/ModFlashlight.cs b/osu.Game/Rulesets/Mods/ModFlashlight.cs index b5ad859172..b7499e624a 100644 --- a/osu.Game/Rulesets/Mods/ModFlashlight.cs +++ b/osu.Game/Rulesets/Mods/ModFlashlight.cs @@ -8,6 +8,7 @@ namespace osu.Game.Rulesets.Mods public abstract class ModFlashlight : Mod { public override string Name => "Flashlight"; + public override string ShortenedName => "FL"; public override FontAwesome Icon => FontAwesome.fa_osu_mod_flashlight; public override ModType Type => ModType.DifficultyIncrease; public override string Description => "Restricted view area."; diff --git a/osu.Game/Rulesets/Mods/ModHalfTime.cs b/osu.Game/Rulesets/Mods/ModHalfTime.cs index 14aede0809..a9e49bb4b0 100644 --- a/osu.Game/Rulesets/Mods/ModHalfTime.cs +++ b/osu.Game/Rulesets/Mods/ModHalfTime.cs @@ -10,6 +10,7 @@ namespace osu.Game.Rulesets.Mods public abstract class ModHalfTime : Mod, IApplicableToClock { public override string Name => "Half Time"; + public override string ShortenedName => "HT"; public override FontAwesome Icon => FontAwesome.fa_osu_mod_halftime; public override ModType Type => ModType.DifficultyReduction; public override string Description => "Less zoom"; diff --git a/osu.Game/Rulesets/Mods/ModHardRock.cs b/osu.Game/Rulesets/Mods/ModHardRock.cs index f33f46a207..36d82362e3 100644 --- a/osu.Game/Rulesets/Mods/ModHardRock.cs +++ b/osu.Game/Rulesets/Mods/ModHardRock.cs @@ -10,6 +10,7 @@ namespace osu.Game.Rulesets.Mods public abstract class ModHardRock : Mod, IApplicableToDifficulty { public override string Name => "Hard Rock"; + public override string ShortenedName => "HR"; public override FontAwesome Icon => FontAwesome.fa_osu_mod_hardrock; public override ModType Type => ModType.DifficultyIncrease; public override string Description => "Everything just got a bit harder..."; diff --git a/osu.Game/Rulesets/Mods/ModHidden.cs b/osu.Game/Rulesets/Mods/ModHidden.cs index 89b9b3b62d..25f6ad024d 100644 --- a/osu.Game/Rulesets/Mods/ModHidden.cs +++ b/osu.Game/Rulesets/Mods/ModHidden.cs @@ -8,6 +8,7 @@ namespace osu.Game.Rulesets.Mods public abstract class ModHidden : Mod { public override string Name => "Hidden"; + public override string ShortenedName => "HD"; public override FontAwesome Icon => FontAwesome.fa_osu_mod_hidden; public override ModType Type => ModType.DifficultyIncrease; public override bool Ranked => true; diff --git a/osu.Game/Rulesets/Mods/ModNightcore.cs b/osu.Game/Rulesets/Mods/ModNightcore.cs index d04643fb8b..5cefd89023 100644 --- a/osu.Game/Rulesets/Mods/ModNightcore.cs +++ b/osu.Game/Rulesets/Mods/ModNightcore.cs @@ -10,6 +10,7 @@ namespace osu.Game.Rulesets.Mods public abstract class ModNightcore : ModDoubleTime { public override string Name => "Nightcore"; + public override string ShortenedName => "NC"; public override FontAwesome Icon => FontAwesome.fa_osu_mod_nightcore; public override string Description => "uguuuuuuuu"; diff --git a/osu.Game/Rulesets/Mods/ModNoFail.cs b/osu.Game/Rulesets/Mods/ModNoFail.cs index d41c4e3956..3a3878d77e 100644 --- a/osu.Game/Rulesets/Mods/ModNoFail.cs +++ b/osu.Game/Rulesets/Mods/ModNoFail.cs @@ -9,6 +9,7 @@ namespace osu.Game.Rulesets.Mods public abstract class ModNoFail : Mod { public override string Name => "NoFail"; + public override string ShortenedName => "NF"; public override FontAwesome Icon => FontAwesome.fa_osu_mod_nofail; public override ModType Type => ModType.DifficultyReduction; public override string Description => "You can't fail, no matter what."; diff --git a/osu.Game/Rulesets/Mods/ModPerfect.cs b/osu.Game/Rulesets/Mods/ModPerfect.cs index 35217c8305..082370ea5d 100644 --- a/osu.Game/Rulesets/Mods/ModPerfect.cs +++ b/osu.Game/Rulesets/Mods/ModPerfect.cs @@ -6,6 +6,7 @@ namespace osu.Game.Rulesets.Mods public abstract class ModPerfect : ModSuddenDeath { public override string Name => "Perfect"; + public override string ShortenedName => "PF"; public override string Description => "SS or quit."; } } \ No newline at end of file diff --git a/osu.Game/Rulesets/Mods/ModRelax.cs b/osu.Game/Rulesets/Mods/ModRelax.cs index 5491f8fc58..a3f38e4ff6 100644 --- a/osu.Game/Rulesets/Mods/ModRelax.cs +++ b/osu.Game/Rulesets/Mods/ModRelax.cs @@ -9,6 +9,7 @@ namespace osu.Game.Rulesets.Mods public abstract class ModRelax : Mod { public override string Name => "Relax"; + public override string ShortenedName => "RX"; public override FontAwesome Icon => FontAwesome.fa_osu_mod_relax; public override double ScoreMultiplier => 0; public override Type[] IncompatibleMods => new[] { typeof(ModAutoplay), typeof(ModNoFail), typeof(ModSuddenDeath) }; diff --git a/osu.Game/Rulesets/Mods/ModSuddenDeath.cs b/osu.Game/Rulesets/Mods/ModSuddenDeath.cs index 2bf0278046..999cb40f89 100644 --- a/osu.Game/Rulesets/Mods/ModSuddenDeath.cs +++ b/osu.Game/Rulesets/Mods/ModSuddenDeath.cs @@ -9,6 +9,7 @@ namespace osu.Game.Rulesets.Mods public abstract class ModSuddenDeath : Mod { public override string Name => "Sudden Death"; + public override string ShortenedName => "SD"; public override FontAwesome Icon => FontAwesome.fa_osu_mod_suddendeath; public override ModType Type => ModType.DifficultyIncrease; public override string Description => "Miss a note and fail."; diff --git a/osu.Game/Rulesets/Mods/MultiMod.cs b/osu.Game/Rulesets/Mods/MultiMod.cs index c5fac250d0..c40d107bda 100644 --- a/osu.Game/Rulesets/Mods/MultiMod.cs +++ b/osu.Game/Rulesets/Mods/MultiMod.cs @@ -6,6 +6,7 @@ namespace osu.Game.Rulesets.Mods public class MultiMod : Mod { public override string Name => string.Empty; + public override string ShortenedName => string.Empty; public override string Description => string.Empty; public override double ScoreMultiplier => 0.0; diff --git a/osu.Game/Rulesets/Ruleset.cs b/osu.Game/Rulesets/Ruleset.cs index ba040403ba..b6bcd48562 100644 --- a/osu.Game/Rulesets/Ruleset.cs +++ b/osu.Game/Rulesets/Ruleset.cs @@ -1,12 +1,12 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.Collections.Generic; using osu.Game.Beatmaps; using osu.Game.Graphics; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.UI; using osu.Game.Screens.Play; -using System.Collections.Generic; using osu.Framework.Graphics; using osu.Game.Rulesets.Scoring; using osu.Game.Overlays.Settings; @@ -19,8 +19,21 @@ namespace osu.Game.Rulesets public virtual IEnumerable GetBeatmapStatistics(WorkingBeatmap beatmap) => new BeatmapStatistic[] { }; + public abstract IEnumerable GetAllMods(); + public abstract IEnumerable GetModsFor(ModType type); + public Mod GetModByShortenedName(string shortenedName) + { + foreach(Mod mod in GetAllMods()) + { + if (string.Equals(mod.ShortenedName, shortenedName)) + return mod; + } + + return null; + } + public abstract Mod GetAutoplayMod(); protected Ruleset(RulesetInfo rulesetInfo) diff --git a/osu.Game/Rulesets/Scoring/Score.cs b/osu.Game/Rulesets/Scoring/Score.cs index 6169bb7380..8377b95cb2 100644 --- a/osu.Game/Rulesets/Scoring/Score.cs +++ b/osu.Game/Rulesets/Scoring/Score.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Reflection; using Newtonsoft.Json; using osu.Game.Beatmaps; using osu.Game.Rulesets.Mods; @@ -27,10 +28,31 @@ namespace osu.Game.Rulesets.Scoring public int Combo { get; set; } + private string[] modStrings; [JsonProperty(@"mods")] - protected string[] ModStrings { get; set; } //todo: parse to Mod objects + protected string[] ModStrings { + get { return modStrings; } + set + { + modStrings = value; - public RulesetInfo Ruleset { get; set; } + if (ruleset != null) + handleModString(); + } + } + + private RulesetInfo ruleset; + public RulesetInfo Ruleset + { + get { return ruleset; } + set + { + ruleset = value; + + if (modStrings != null) + handleModString(); + } + } public Mod[] Mods { get; set; } @@ -80,5 +102,17 @@ namespace osu.Game.Rulesets.Scoring } public Dictionary Statistics = new Dictionary(); + + private void handleModString() + { + List modList = new List(); + + Ruleset rulesetInstance = Ruleset.CreateInstance(); + + foreach (string modShortenedName in modStrings) + modList.Add(rulesetInstance.GetModByShortenedName(modShortenedName)); + + Mods = modList.ToArray(); + } } } diff --git a/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs b/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs index 5a375e55d4..341e24baf0 100644 --- a/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs +++ b/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs @@ -1,15 +1,15 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using System.Collections.Generic; using OpenTK; using OpenTK.Graphics; +using osu.Framework.Allocation; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; -using System; -using osu.Framework.Allocation; using osu.Framework.Threading; using osu.Game.Beatmaps; using osu.Game.Graphics.Containers; @@ -55,6 +55,8 @@ namespace osu.Game.Screens.Select.Leaderboards i = 0; foreach (var s in scores) { + s.Ruleset = beatmap.Ruleset; + var ls = new LeaderboardScore(s, 1 + i) { AlwaysPresent = true, diff --git a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs index ac3b0b5c3b..993186ffdf 100644 --- a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs +++ b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs @@ -256,8 +256,23 @@ namespace osu.Game.Screens.Select.Leaderboards { foreach (Mod mod in Score.Mods) { - // TODO: Get actual mod colours - modsContainer.Add(new ScoreModIcon(mod.Icon, OsuColour.FromHex(@"ffcc22"))); + Color4 modColor; + + switch (mod.Type) + { + default: + case ModType.DifficultyIncrease: + modColor = OsuColour.FromHex(@"ffcc22"); + break; + case ModType.DifficultyReduction: + modColor = OsuColour.FromHex(@"88b300"); + break; + case ModType.Special: + modColor = OsuColour.FromHex(@"66ccff"); + break; + } + + modsContainer.Add(new ScoreModIcon(mod.Icon, modColor)); } } }