mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
Parse the mods of a leaderboard's score
This commit is contained in:
@ -1,15 +1,15 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// 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,
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user