mirror of
https://github.com/ppy/osu.git
synced 2025-01-27 11:12:59 +08:00
Merge branch 'master' into storyboards
# Conflicts: # osu.Game/Beatmaps/Beatmap.cs
This commit is contained in:
commit
12de737084
@ -1 +1 @@
|
|||||||
Subproject commit 5f2d5a57e5d506d7e5d87eeeb442adf10be061f6
|
Subproject commit 4e7ea6af4f59f21f6afc522fb063c05417e1a5fe
|
@ -1,13 +1,13 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using OpenTK;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.Osu.Mods;
|
using osu.Game.Rulesets.Osu.Mods;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
using osu.Game.Screens.Select.Leaderboards;
|
using osu.Game.Screens.Select.Leaderboards;
|
||||||
using osu.Game.Users;
|
using osu.Game.Users;
|
||||||
using OpenTK;
|
|
||||||
|
|
||||||
namespace osu.Desktop.Tests.Visual
|
namespace osu.Desktop.Tests.Visual
|
||||||
{
|
{
|
||||||
@ -24,7 +24,7 @@ namespace osu.Desktop.Tests.Visual
|
|||||||
new Score
|
new Score
|
||||||
{
|
{
|
||||||
Rank = ScoreRank.XH,
|
Rank = ScoreRank.XH,
|
||||||
Accuracy = 100,
|
Accuracy = 1,
|
||||||
MaxCombo = 244,
|
MaxCombo = 244,
|
||||||
TotalScore = 1707827,
|
TotalScore = 1707827,
|
||||||
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
||||||
@ -42,7 +42,7 @@ namespace osu.Desktop.Tests.Visual
|
|||||||
new Score
|
new Score
|
||||||
{
|
{
|
||||||
Rank = ScoreRank.X,
|
Rank = ScoreRank.X,
|
||||||
Accuracy = 100,
|
Accuracy = 1,
|
||||||
MaxCombo = 244,
|
MaxCombo = 244,
|
||||||
TotalScore = 1707827,
|
TotalScore = 1707827,
|
||||||
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
||||||
@ -60,7 +60,7 @@ namespace osu.Desktop.Tests.Visual
|
|||||||
new Score
|
new Score
|
||||||
{
|
{
|
||||||
Rank = ScoreRank.SH,
|
Rank = ScoreRank.SH,
|
||||||
Accuracy = 100,
|
Accuracy = 1,
|
||||||
MaxCombo = 244,
|
MaxCombo = 244,
|
||||||
TotalScore = 1707827,
|
TotalScore = 1707827,
|
||||||
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
||||||
@ -78,7 +78,7 @@ namespace osu.Desktop.Tests.Visual
|
|||||||
new Score
|
new Score
|
||||||
{
|
{
|
||||||
Rank = ScoreRank.S,
|
Rank = ScoreRank.S,
|
||||||
Accuracy = 100,
|
Accuracy = 1,
|
||||||
MaxCombo = 244,
|
MaxCombo = 244,
|
||||||
TotalScore = 1707827,
|
TotalScore = 1707827,
|
||||||
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
||||||
@ -96,7 +96,7 @@ namespace osu.Desktop.Tests.Visual
|
|||||||
new Score
|
new Score
|
||||||
{
|
{
|
||||||
Rank = ScoreRank.A,
|
Rank = ScoreRank.A,
|
||||||
Accuracy = 100,
|
Accuracy = 1,
|
||||||
MaxCombo = 244,
|
MaxCombo = 244,
|
||||||
TotalScore = 1707827,
|
TotalScore = 1707827,
|
||||||
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
||||||
@ -114,7 +114,7 @@ namespace osu.Desktop.Tests.Visual
|
|||||||
new Score
|
new Score
|
||||||
{
|
{
|
||||||
Rank = ScoreRank.B,
|
Rank = ScoreRank.B,
|
||||||
Accuracy = 98.26,
|
Accuracy = 0.9826,
|
||||||
MaxCombo = 244,
|
MaxCombo = 244,
|
||||||
TotalScore = 1707827,
|
TotalScore = 1707827,
|
||||||
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
||||||
@ -132,7 +132,7 @@ namespace osu.Desktop.Tests.Visual
|
|||||||
new Score
|
new Score
|
||||||
{
|
{
|
||||||
Rank = ScoreRank.C,
|
Rank = ScoreRank.C,
|
||||||
Accuracy = 96.54,
|
Accuracy = 0.9654,
|
||||||
MaxCombo = 244,
|
MaxCombo = 244,
|
||||||
TotalScore = 1707827,
|
TotalScore = 1707827,
|
||||||
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
||||||
@ -150,7 +150,7 @@ namespace osu.Desktop.Tests.Visual
|
|||||||
new Score
|
new Score
|
||||||
{
|
{
|
||||||
Rank = ScoreRank.F,
|
Rank = ScoreRank.F,
|
||||||
Accuracy = 60.25,
|
Accuracy = 0.6025,
|
||||||
MaxCombo = 244,
|
MaxCombo = 244,
|
||||||
TotalScore = 1707827,
|
TotalScore = 1707827,
|
||||||
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
||||||
@ -168,7 +168,7 @@ namespace osu.Desktop.Tests.Visual
|
|||||||
new Score
|
new Score
|
||||||
{
|
{
|
||||||
Rank = ScoreRank.F,
|
Rank = ScoreRank.F,
|
||||||
Accuracy = 51.40,
|
Accuracy = 0.5140,
|
||||||
MaxCombo = 244,
|
MaxCombo = 244,
|
||||||
TotalScore = 1707827,
|
TotalScore = 1707827,
|
||||||
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
||||||
@ -186,7 +186,7 @@ namespace osu.Desktop.Tests.Visual
|
|||||||
new Score
|
new Score
|
||||||
{
|
{
|
||||||
Rank = ScoreRank.F,
|
Rank = ScoreRank.F,
|
||||||
Accuracy = 42.22,
|
Accuracy = 0.4222,
|
||||||
MaxCombo = 244,
|
MaxCombo = 244,
|
||||||
TotalScore = 1707827,
|
TotalScore = 1707827,
|
||||||
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
||||||
|
@ -93,8 +93,6 @@ namespace osu.Game.Rulesets.Catch
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Mod GetAutoplayMod() => new ModAutoplay();
|
|
||||||
|
|
||||||
public override string Description => "osu!catch";
|
public override string Description => "osu!catch";
|
||||||
|
|
||||||
public override Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.fa_osu_fruits_o };
|
public override Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.fa_osu_fruits_o };
|
||||||
|
@ -105,8 +105,6 @@ namespace osu.Game.Rulesets.Mania
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Mod GetAutoplayMod() => new ModAutoplay();
|
|
||||||
|
|
||||||
public override string Description => "osu!mania";
|
public override string Description => "osu!mania";
|
||||||
|
|
||||||
public override Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.fa_osu_mania_o };
|
public override Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.fa_osu_mania_o };
|
||||||
|
@ -68,6 +68,7 @@ namespace osu.Game.Rulesets.Mania.Mods
|
|||||||
public class ManiaModFadeIn : Mod
|
public class ManiaModFadeIn : Mod
|
||||||
{
|
{
|
||||||
public override string Name => "FadeIn";
|
public override string Name => "FadeIn";
|
||||||
|
public override string ShortenedName => "FI";
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_hidden;
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_hidden;
|
||||||
public override ModType Type => ModType.DifficultyIncrease;
|
public override ModType Type => ModType.DifficultyIncrease;
|
||||||
public override double ScoreMultiplier => 1;
|
public override double ScoreMultiplier => 1;
|
||||||
@ -78,12 +79,14 @@ namespace osu.Game.Rulesets.Mania.Mods
|
|||||||
public class ManiaModRandom : Mod
|
public class ManiaModRandom : Mod
|
||||||
{
|
{
|
||||||
public override string Name => "Random";
|
public override string Name => "Random";
|
||||||
|
public override string ShortenedName => "RD";
|
||||||
public override string Description => @"Shuffle around the notes!";
|
public override string Description => @"Shuffle around the notes!";
|
||||||
public override double ScoreMultiplier => 1;
|
public override double ScoreMultiplier => 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract class ManiaKeyMod : Mod
|
public abstract class ManiaKeyMod : Mod
|
||||||
{
|
{
|
||||||
|
public override string ShortenedName => Name;
|
||||||
public abstract int KeyCount { get; }
|
public abstract int KeyCount { get; }
|
||||||
public override double ScoreMultiplier => 1; // TODO: Implement the mania key mod score multiplier
|
public override double ScoreMultiplier => 1; // TODO: Implement the mania key mod score multiplier
|
||||||
public override bool Ranked => true;
|
public override bool Ranked => true;
|
||||||
@ -146,6 +149,7 @@ namespace osu.Game.Rulesets.Mania.Mods
|
|||||||
public class ManiaModKeyCoop : Mod
|
public class ManiaModKeyCoop : Mod
|
||||||
{
|
{
|
||||||
public override string Name => "KeyCoop";
|
public override string Name => "KeyCoop";
|
||||||
|
public override string ShortenedName => "2P";
|
||||||
public override string Description => @"Double the key amount, double the fun!";
|
public override string Description => @"Double the key amount, double the fun!";
|
||||||
public override double ScoreMultiplier => 1;
|
public override double ScoreMultiplier => 1;
|
||||||
public override bool Ranked => true;
|
public override bool Ranked => true;
|
||||||
|
@ -15,6 +15,7 @@ namespace osu.Game.Rulesets.Mania.Mods
|
|||||||
public class ManiaModGravity : Mod, IGenerateSpeedAdjustments
|
public class ManiaModGravity : Mod, IGenerateSpeedAdjustments
|
||||||
{
|
{
|
||||||
public override string Name => "Gravity";
|
public override string Name => "Gravity";
|
||||||
|
public override string ShortenedName => "GR";
|
||||||
|
|
||||||
public override double ScoreMultiplier => 0;
|
public override double ScoreMultiplier => 0;
|
||||||
|
|
||||||
|
@ -96,6 +96,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
public class OsuModSpunOut : Mod
|
public class OsuModSpunOut : Mod
|
||||||
{
|
{
|
||||||
public override string Name => "Spun Out";
|
public override string Name => "Spun Out";
|
||||||
|
public override string ShortenedName => "SO";
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_spunout;
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_spunout;
|
||||||
public override string Description => @"Spinners will be automatically completed";
|
public override string Description => @"Spinners will be automatically completed";
|
||||||
public override double ScoreMultiplier => 0.9;
|
public override double ScoreMultiplier => 0.9;
|
||||||
@ -106,6 +107,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
public class OsuModAutopilot : Mod
|
public class OsuModAutopilot : Mod
|
||||||
{
|
{
|
||||||
public override string Name => "Autopilot";
|
public override string Name => "Autopilot";
|
||||||
|
public override string ShortenedName => "AP";
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_autopilot;
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_autopilot;
|
||||||
public override string Description => @"Automatic cursor movement - just follow the rhythm.";
|
public override string Description => @"Automatic cursor movement - just follow the rhythm.";
|
||||||
public override double ScoreMultiplier => 0;
|
public override double ScoreMultiplier => 0;
|
||||||
@ -126,6 +128,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
public class OsuModTarget : Mod
|
public class OsuModTarget : Mod
|
||||||
{
|
{
|
||||||
public override string Name => "Target";
|
public override string Name => "Target";
|
||||||
|
public override string ShortenedName => "TP";
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_target;
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_target;
|
||||||
public override string Description => @"";
|
public override string Description => @"";
|
||||||
public override double ScoreMultiplier => 1;
|
public override double ScoreMultiplier => 1;
|
||||||
|
@ -112,8 +112,6 @@ namespace osu.Game.Rulesets.Osu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Mod GetAutoplayMod() => new OsuModAutoplay();
|
|
||||||
|
|
||||||
public override Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.fa_osu_osu_o };
|
public override Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.fa_osu_osu_o };
|
||||||
|
|
||||||
public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap) => new OsuDifficultyCalculator(beatmap);
|
public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap) => new OsuDifficultyCalculator(beatmap);
|
||||||
|
@ -95,8 +95,6 @@ namespace osu.Game.Rulesets.Taiko
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Mod GetAutoplayMod() => new TaikoModAutoplay();
|
|
||||||
|
|
||||||
public override string Description => "osu!taiko";
|
public override string Description => "osu!taiko";
|
||||||
|
|
||||||
public override Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.fa_osu_taiko_o };
|
public override Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.fa_osu_taiko_o };
|
||||||
|
@ -18,7 +18,7 @@ namespace osu.Game.Beatmaps
|
|||||||
public class Beatmap<T>
|
public class Beatmap<T>
|
||||||
where T : HitObject
|
where T : HitObject
|
||||||
{
|
{
|
||||||
public BeatmapInfo BeatmapInfo;
|
public BeatmapInfo BeatmapInfo = new BeatmapInfo();
|
||||||
public ControlPointInfo ControlPointInfo = new ControlPointInfo();
|
public ControlPointInfo ControlPointInfo = new ControlPointInfo();
|
||||||
public List<BreakPeriod> Breaks = new List<BreakPeriod>();
|
public List<BreakPeriod> Breaks = new List<BreakPeriod>();
|
||||||
public readonly List<Color4> ComboColors = new List<Color4>
|
public readonly List<Color4> ComboColors = new List<Color4>
|
||||||
@ -34,7 +34,7 @@ namespace osu.Game.Beatmaps
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The HitObjects this Beatmap contains.
|
/// The HitObjects this Beatmap contains.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<T> HitObjects;
|
public List<T> HitObjects = new List<T>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Total amount of break time in the beatmap.
|
/// Total amount of break time in the beatmap.
|
||||||
@ -50,12 +50,13 @@ namespace osu.Game.Beatmaps
|
|||||||
/// Constructs a new beatmap.
|
/// Constructs a new beatmap.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="original">The original beatmap to use the parameters of.</param>
|
/// <param name="original">The original beatmap to use the parameters of.</param>
|
||||||
public Beatmap(Beatmap original = null)
|
public Beatmap(Beatmap<T> original = null)
|
||||||
{
|
{
|
||||||
BeatmapInfo = original?.BeatmapInfo.DeepClone() ?? BeatmapInfo;
|
BeatmapInfo = original?.BeatmapInfo.DeepClone() ?? BeatmapInfo;
|
||||||
ControlPointInfo = original?.ControlPointInfo ?? ControlPointInfo;
|
ControlPointInfo = original?.ControlPointInfo ?? ControlPointInfo;
|
||||||
Breaks = original?.Breaks ?? Breaks;
|
Breaks = original?.Breaks ?? Breaks;
|
||||||
ComboColors = original?.ComboColors ?? ComboColors;
|
ComboColors = original?.ComboColors ?? ComboColors;
|
||||||
|
HitObjects = original?.HitObjects ?? HitObjects;
|
||||||
Storyboard = original?.Storyboard ?? Storyboard;
|
Storyboard = original?.Storyboard ?? Storyboard;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -72,7 +73,6 @@ namespace osu.Game.Beatmaps
|
|||||||
public Beatmap(Beatmap original = null)
|
public Beatmap(Beatmap original = null)
|
||||||
: base(original)
|
: base(original)
|
||||||
{
|
{
|
||||||
HitObjects = original?.HitObjects;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,6 @@ using osu.Framework.Audio.Track;
|
|||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.Objects;
|
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
|
|
||||||
@ -42,10 +41,7 @@ namespace osu.Game.Beatmaps
|
|||||||
this.game = game;
|
this.game = game;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override Beatmap GetBeatmap() => new Beatmap
|
protected override Beatmap GetBeatmap() => new Beatmap();
|
||||||
{
|
|
||||||
HitObjects = new List<HitObject>(),
|
|
||||||
};
|
|
||||||
|
|
||||||
protected override Texture GetBackground() => game.Textures.Get(@"Backgrounds/bg4");
|
protected override Texture GetBackground() => game.Textures.Get(@"Backgrounds/bg4");
|
||||||
|
|
||||||
@ -59,8 +55,6 @@ namespace osu.Game.Beatmaps
|
|||||||
{
|
{
|
||||||
public override IEnumerable<Mod> GetModsFor(ModType type) => new Mod[] { };
|
public override IEnumerable<Mod> GetModsFor(ModType type) => new Mod[] { };
|
||||||
|
|
||||||
public override Mod GetAutoplayMod() => new ModAutoplay();
|
|
||||||
|
|
||||||
public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap, bool isForCurrentRuleset)
|
public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap, bool isForCurrentRuleset)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using osu.Game.Rulesets.Objects;
|
|
||||||
|
|
||||||
namespace osu.Game.Beatmaps.Formats
|
namespace osu.Game.Beatmaps.Formats
|
||||||
{
|
{
|
||||||
@ -21,7 +20,7 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
{
|
{
|
||||||
string line;
|
string line;
|
||||||
do { line = stream.ReadLine()?.Trim(); }
|
do { line = stream.ReadLine()?.Trim(); }
|
||||||
while (line != null && line.Length == 0);
|
while (line != null && line.Length == 0);
|
||||||
|
|
||||||
if (line == null || !decoders.ContainsKey(line))
|
if (line == null || !decoders.ContainsKey(line))
|
||||||
throw new IOException(@"Unknown file format");
|
throw new IOException(@"Unknown file format");
|
||||||
@ -47,7 +46,6 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
{
|
{
|
||||||
var beatmap = new Beatmap
|
var beatmap = new Beatmap
|
||||||
{
|
{
|
||||||
HitObjects = new List<HitObject>(),
|
|
||||||
BeatmapInfo = new BeatmapInfo
|
BeatmapInfo = new BeatmapInfo
|
||||||
{
|
{
|
||||||
Metadata = new BeatmapMetadata(),
|
Metadata = new BeatmapMetadata(),
|
||||||
|
@ -54,7 +54,7 @@ namespace osu.Game.Beatmaps
|
|||||||
{
|
{
|
||||||
if (beatmap != null) return beatmap;
|
if (beatmap != null) return beatmap;
|
||||||
|
|
||||||
beatmap = GetBeatmap();
|
beatmap = GetBeatmap() ?? new Beatmap();
|
||||||
|
|
||||||
// use the database-backed info.
|
// use the database-backed info.
|
||||||
beatmap.BeatmapInfo = BeatmapInfo;
|
beatmap.BeatmapInfo = BeatmapInfo;
|
||||||
|
@ -1,10 +1,14 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using osu.Framework.IO.Network;
|
using osu.Framework.IO.Network;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Game.Users;
|
||||||
|
using osu.Game.Rulesets.Replays;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
|
|
||||||
namespace osu.Game.Online.API.Requests
|
namespace osu.Game.Online.API.Requests
|
||||||
@ -16,6 +20,14 @@ namespace osu.Game.Online.API.Requests
|
|||||||
public GetScoresRequest(BeatmapInfo beatmap)
|
public GetScoresRequest(BeatmapInfo beatmap)
|
||||||
{
|
{
|
||||||
this.beatmap = beatmap;
|
this.beatmap = beatmap;
|
||||||
|
|
||||||
|
Success += onSuccess;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onSuccess(GetScoresResponse r)
|
||||||
|
{
|
||||||
|
foreach (OnlineScore score in r.Scores)
|
||||||
|
score.ApplyBeatmap(beatmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override WebRequest CreateWebRequest()
|
protected override WebRequest CreateWebRequest()
|
||||||
@ -32,6 +44,88 @@ namespace osu.Game.Online.API.Requests
|
|||||||
public class GetScoresResponse
|
public class GetScoresResponse
|
||||||
{
|
{
|
||||||
[JsonProperty(@"scores")]
|
[JsonProperty(@"scores")]
|
||||||
public IEnumerable<Score> Scores;
|
public IEnumerable<OnlineScore> Scores;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
public class OnlineScore : Score
|
||||||
|
{
|
||||||
|
[JsonProperty(@"score")]
|
||||||
|
private double totalScore
|
||||||
|
{
|
||||||
|
set { TotalScore = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
[JsonProperty(@"max_combo")]
|
||||||
|
private int maxCombo
|
||||||
|
{
|
||||||
|
set { MaxCombo = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
[JsonProperty(@"user")]
|
||||||
|
private User user
|
||||||
|
{
|
||||||
|
set { User = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
[JsonProperty(@"replay_data")]
|
||||||
|
private Replay replay
|
||||||
|
{
|
||||||
|
set { Replay = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
[JsonProperty(@"score_id")]
|
||||||
|
private long onlineScoreID
|
||||||
|
{
|
||||||
|
set { OnlineScoreID = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
[JsonProperty(@"created_at")]
|
||||||
|
private DateTimeOffset date
|
||||||
|
{
|
||||||
|
set { Date = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
[JsonProperty(@"statistics")]
|
||||||
|
private Dictionary<string, dynamic> jsonStats
|
||||||
|
{
|
||||||
|
set
|
||||||
|
{
|
||||||
|
foreach (var kvp in value)
|
||||||
|
{
|
||||||
|
string key = kvp.Key;
|
||||||
|
switch (key)
|
||||||
|
{
|
||||||
|
case @"count_300":
|
||||||
|
key = @"300";
|
||||||
|
break;
|
||||||
|
case @"count_100":
|
||||||
|
key = @"100";
|
||||||
|
break;
|
||||||
|
case @"count_50":
|
||||||
|
key = @"50";
|
||||||
|
break;
|
||||||
|
case @"count_miss":
|
||||||
|
key = @"x";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
Statistics.Add(key, kvp.Value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[JsonProperty(@"mods")]
|
||||||
|
private string[] modStrings { get; set; }
|
||||||
|
|
||||||
|
public void ApplyBeatmap(BeatmapInfo beatmap)
|
||||||
|
{
|
||||||
|
Beatmap = beatmap;
|
||||||
|
Ruleset = beatmap.Ruleset;
|
||||||
|
|
||||||
|
// Evaluate the mod string
|
||||||
|
Mods = Ruleset.CreateInstance().GetAllMods().Where(mod => modStrings.Contains(mod.ShortenedName)).ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -245,7 +245,11 @@ namespace osu.Game
|
|||||||
LoadComponentAsync(Toolbar = new Toolbar
|
LoadComponentAsync(Toolbar = new Toolbar
|
||||||
{
|
{
|
||||||
Depth = -4,
|
Depth = -4,
|
||||||
OnHome = delegate { intro?.ChildScreen?.MakeCurrent(); },
|
OnHome = delegate
|
||||||
|
{
|
||||||
|
hideAllOverlays();
|
||||||
|
intro?.ChildScreen?.MakeCurrent();
|
||||||
|
},
|
||||||
}, overlayContent.Add);
|
}, overlayContent.Add);
|
||||||
|
|
||||||
settings.StateChanged += delegate
|
settings.StateChanged += delegate
|
||||||
@ -310,6 +314,16 @@ namespace osu.Game
|
|||||||
private OsuScreen currentScreen;
|
private OsuScreen currentScreen;
|
||||||
private FrameworkConfigManager frameworkConfig;
|
private FrameworkConfigManager frameworkConfig;
|
||||||
|
|
||||||
|
private void hideAllOverlays()
|
||||||
|
{
|
||||||
|
settings.State = Visibility.Hidden;
|
||||||
|
chat.State = Visibility.Hidden;
|
||||||
|
direct.State = Visibility.Hidden;
|
||||||
|
social.State = Visibility.Hidden;
|
||||||
|
userProfile.State = Visibility.Hidden;
|
||||||
|
notificationOverlay.State = Visibility.Hidden;
|
||||||
|
}
|
||||||
|
|
||||||
private void screenChanged(Screen newScreen)
|
private void screenChanged(Screen newScreen)
|
||||||
{
|
{
|
||||||
currentScreen = newScreen as OsuScreen;
|
currentScreen = newScreen as OsuScreen;
|
||||||
@ -323,19 +337,12 @@ namespace osu.Game
|
|||||||
//central game screen change logic.
|
//central game screen change logic.
|
||||||
if (!currentScreen.ShowOverlays)
|
if (!currentScreen.ShowOverlays)
|
||||||
{
|
{
|
||||||
settings.State = Visibility.Hidden;
|
hideAllOverlays();
|
||||||
Toolbar.State = Visibility.Hidden;
|
|
||||||
musicController.State = Visibility.Hidden;
|
musicController.State = Visibility.Hidden;
|
||||||
chat.State = Visibility.Hidden;
|
Toolbar.State = Visibility.Hidden;
|
||||||
direct.State = Visibility.Hidden;
|
|
||||||
social.State = Visibility.Hidden;
|
|
||||||
userProfile.State = Visibility.Hidden;
|
|
||||||
notificationOverlay.State = Visibility.Hidden;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
Toolbar.State = Visibility.Visible;
|
Toolbar.State = Visibility.Visible;
|
||||||
}
|
|
||||||
|
|
||||||
ScreenChanged?.Invoke(newScreen);
|
ScreenChanged?.Invoke(newScreen);
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,6 @@ namespace osu.Game.Overlays.Chat
|
|||||||
Size = new Vector2(text_size),
|
Size = new Vector2(text_size),
|
||||||
Shadow = false,
|
Shadow = false,
|
||||||
Margin = new MarginPadding { Right = 10f },
|
Margin = new MarginPadding { Right = 10f },
|
||||||
Alpha = 0f,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -109,7 +108,6 @@ namespace osu.Game.Overlays.Chat
|
|||||||
TextSize = text_size,
|
TextSize = text_size,
|
||||||
Font = @"Exo2.0-SemiBold",
|
Font = @"Exo2.0-SemiBold",
|
||||||
Shadow = false,
|
Shadow = false,
|
||||||
Alpha = 0.8f,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -151,6 +149,9 @@ namespace osu.Game.Overlays.Chat
|
|||||||
|
|
||||||
joinedBind.ValueChanged += updateColour;
|
joinedBind.ValueChanged += updateColour;
|
||||||
joinedBind.BindTo(channel.Joined);
|
joinedBind.BindTo(channel.Joined);
|
||||||
|
|
||||||
|
joinedBind.TriggerChange();
|
||||||
|
FinishTransforms(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnHover(InputState state)
|
protected override bool OnHover(InputState state)
|
||||||
|
@ -16,6 +16,11 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract string Name { get; }
|
public abstract string Name { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The shortened name of this mod.
|
||||||
|
/// </summary>
|
||||||
|
public abstract string ShortenedName { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The icon of this mod.
|
/// The icon of this mod.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -24,6 +24,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public class ModAutoplay : Mod
|
public class ModAutoplay : Mod
|
||||||
{
|
{
|
||||||
public override string Name => "Autoplay";
|
public override string Name => "Autoplay";
|
||||||
|
public override string ShortenedName => "AT";
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_auto;
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_auto;
|
||||||
public override string Description => "Watch a perfect automated play through the song";
|
public override string Description => "Watch a perfect automated play through the song";
|
||||||
public override double ScoreMultiplier => 0;
|
public override double ScoreMultiplier => 0;
|
||||||
|
@ -8,6 +8,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public class ModCinema : ModAutoplay
|
public class ModCinema : ModAutoplay
|
||||||
{
|
{
|
||||||
public override string Name => "Cinema";
|
public override string Name => "Cinema";
|
||||||
|
public override string ShortenedName => "CN";
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_cinema;
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_cinema;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -10,6 +10,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public abstract class ModDaycore : ModHalfTime
|
public abstract class ModDaycore : ModHalfTime
|
||||||
{
|
{
|
||||||
public override string Name => "Daycore";
|
public override string Name => "Daycore";
|
||||||
|
public override string ShortenedName => "DC";
|
||||||
public override FontAwesome Icon => FontAwesome.fa_question;
|
public override FontAwesome Icon => FontAwesome.fa_question;
|
||||||
public override string Description => "whoaaaaa";
|
public override string Description => "whoaaaaa";
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public class ModDoubleTime : Mod, IApplicableToClock
|
public class ModDoubleTime : Mod, IApplicableToClock
|
||||||
{
|
{
|
||||||
public override string Name => "Double Time";
|
public override string Name => "Double Time";
|
||||||
|
public override string ShortenedName => "DT";
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_doubletime;
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_doubletime;
|
||||||
public override ModType Type => ModType.DifficultyIncrease;
|
public override ModType Type => ModType.DifficultyIncrease;
|
||||||
public override string Description => "Zoooooooooom";
|
public override string Description => "Zoooooooooom";
|
||||||
|
@ -10,6 +10,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public abstract class ModEasy : Mod, IApplicableToDifficulty
|
public abstract class ModEasy : Mod, IApplicableToDifficulty
|
||||||
{
|
{
|
||||||
public override string Name => "Easy";
|
public override string Name => "Easy";
|
||||||
|
public override string ShortenedName => "EZ";
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_easy;
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_easy;
|
||||||
public override ModType Type => ModType.DifficultyReduction;
|
public override ModType Type => ModType.DifficultyReduction;
|
||||||
public override string Description => "Reduces overall difficulty - larger circles, more forgiving HP drain, less accuracy required.";
|
public override string Description => "Reduces overall difficulty - larger circles, more forgiving HP drain, less accuracy required.";
|
||||||
|
@ -8,6 +8,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public abstract class ModFlashlight : Mod
|
public abstract class ModFlashlight : Mod
|
||||||
{
|
{
|
||||||
public override string Name => "Flashlight";
|
public override string Name => "Flashlight";
|
||||||
|
public override string ShortenedName => "FL";
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_flashlight;
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_flashlight;
|
||||||
public override ModType Type => ModType.DifficultyIncrease;
|
public override ModType Type => ModType.DifficultyIncrease;
|
||||||
public override string Description => "Restricted view area.";
|
public override string Description => "Restricted view area.";
|
||||||
|
@ -10,6 +10,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public abstract class ModHalfTime : Mod, IApplicableToClock
|
public abstract class ModHalfTime : Mod, IApplicableToClock
|
||||||
{
|
{
|
||||||
public override string Name => "Half Time";
|
public override string Name => "Half Time";
|
||||||
|
public override string ShortenedName => "HT";
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_halftime;
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_halftime;
|
||||||
public override ModType Type => ModType.DifficultyReduction;
|
public override ModType Type => ModType.DifficultyReduction;
|
||||||
public override string Description => "Less zoom";
|
public override string Description => "Less zoom";
|
||||||
|
@ -10,6 +10,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public abstract class ModHardRock : Mod, IApplicableToDifficulty
|
public abstract class ModHardRock : Mod, IApplicableToDifficulty
|
||||||
{
|
{
|
||||||
public override string Name => "Hard Rock";
|
public override string Name => "Hard Rock";
|
||||||
|
public override string ShortenedName => "HR";
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_hardrock;
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_hardrock;
|
||||||
public override ModType Type => ModType.DifficultyIncrease;
|
public override ModType Type => ModType.DifficultyIncrease;
|
||||||
public override string Description => "Everything just got a bit harder...";
|
public override string Description => "Everything just got a bit harder...";
|
||||||
|
@ -8,6 +8,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public abstract class ModHidden : Mod
|
public abstract class ModHidden : Mod
|
||||||
{
|
{
|
||||||
public override string Name => "Hidden";
|
public override string Name => "Hidden";
|
||||||
|
public override string ShortenedName => "HD";
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_hidden;
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_hidden;
|
||||||
public override ModType Type => ModType.DifficultyIncrease;
|
public override ModType Type => ModType.DifficultyIncrease;
|
||||||
public override bool Ranked => true;
|
public override bool Ranked => true;
|
||||||
|
@ -10,6 +10,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public abstract class ModNightcore : ModDoubleTime
|
public abstract class ModNightcore : ModDoubleTime
|
||||||
{
|
{
|
||||||
public override string Name => "Nightcore";
|
public override string Name => "Nightcore";
|
||||||
|
public override string ShortenedName => "NC";
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_nightcore;
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_nightcore;
|
||||||
public override string Description => "uguuuuuuuu";
|
public override string Description => "uguuuuuuuu";
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public abstract class ModNoFail : Mod
|
public abstract class ModNoFail : Mod
|
||||||
{
|
{
|
||||||
public override string Name => "NoFail";
|
public override string Name => "NoFail";
|
||||||
|
public override string ShortenedName => "NF";
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_nofail;
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_nofail;
|
||||||
public override ModType Type => ModType.DifficultyReduction;
|
public override ModType Type => ModType.DifficultyReduction;
|
||||||
public override string Description => "You can't fail, no matter what.";
|
public override string Description => "You can't fail, no matter what.";
|
||||||
|
@ -6,6 +6,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public abstract class ModPerfect : ModSuddenDeath
|
public abstract class ModPerfect : ModSuddenDeath
|
||||||
{
|
{
|
||||||
public override string Name => "Perfect";
|
public override string Name => "Perfect";
|
||||||
|
public override string ShortenedName => "PF";
|
||||||
public override string Description => "SS or quit.";
|
public override string Description => "SS or quit.";
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -9,6 +9,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public abstract class ModRelax : Mod
|
public abstract class ModRelax : Mod
|
||||||
{
|
{
|
||||||
public override string Name => "Relax";
|
public override string Name => "Relax";
|
||||||
|
public override string ShortenedName => "RX";
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_relax;
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_relax;
|
||||||
public override double ScoreMultiplier => 0;
|
public override double ScoreMultiplier => 0;
|
||||||
public override Type[] IncompatibleMods => new[] { typeof(ModAutoplay), typeof(ModNoFail), typeof(ModSuddenDeath) };
|
public override Type[] IncompatibleMods => new[] { typeof(ModAutoplay), typeof(ModNoFail), typeof(ModSuddenDeath) };
|
||||||
|
@ -9,6 +9,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public abstract class ModSuddenDeath : Mod
|
public abstract class ModSuddenDeath : Mod
|
||||||
{
|
{
|
||||||
public override string Name => "Sudden Death";
|
public override string Name => "Sudden Death";
|
||||||
|
public override string ShortenedName => "SD";
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_mod_suddendeath;
|
public override FontAwesome Icon => FontAwesome.fa_osu_mod_suddendeath;
|
||||||
public override ModType Type => ModType.DifficultyIncrease;
|
public override ModType Type => ModType.DifficultyIncrease;
|
||||||
public override string Description => "Miss a note and fail.";
|
public override string Description => "Miss a note and fail.";
|
||||||
|
@ -6,6 +6,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public class MultiMod : Mod
|
public class MultiMod : Mod
|
||||||
{
|
{
|
||||||
public override string Name => string.Empty;
|
public override string Name => string.Empty;
|
||||||
|
public override string ShortenedName => string.Empty;
|
||||||
public override string Description => string.Empty;
|
public override string Description => string.Empty;
|
||||||
public override double ScoreMultiplier => 0.0;
|
public override double ScoreMultiplier => 0.0;
|
||||||
|
|
||||||
|
@ -1,15 +1,17 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using osu.Game.Beatmaps;
|
using System;
|
||||||
using osu.Game.Graphics;
|
|
||||||
using osu.Game.Rulesets.Mods;
|
|
||||||
using osu.Game.Rulesets.UI;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Input.Bindings;
|
using osu.Framework.Input.Bindings;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Overlays.Settings;
|
using osu.Game.Overlays.Settings;
|
||||||
|
using osu.Game.Rulesets.Mods;
|
||||||
|
using osu.Game.Rulesets.Scoring;
|
||||||
|
using osu.Game.Rulesets.UI;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets
|
namespace osu.Game.Rulesets
|
||||||
{
|
{
|
||||||
@ -19,9 +21,18 @@ namespace osu.Game.Rulesets
|
|||||||
|
|
||||||
public virtual IEnumerable<BeatmapStatistic> GetBeatmapStatistics(WorkingBeatmap beatmap) => new BeatmapStatistic[] { };
|
public virtual IEnumerable<BeatmapStatistic> GetBeatmapStatistics(WorkingBeatmap beatmap) => new BeatmapStatistic[] { };
|
||||||
|
|
||||||
|
public IEnumerable<Mod> GetAllMods() => Enum.GetValues(typeof(ModType)).Cast<ModType>()
|
||||||
|
// Get all mod types as an IEnumerable<ModType>
|
||||||
|
.SelectMany(GetModsFor)
|
||||||
|
// Confine all mods of each mod type into a single IEnumerable<Mod>
|
||||||
|
.Where(mod => mod != null)
|
||||||
|
// Filter out all null mods
|
||||||
|
.SelectMany(mod => (mod as MultiMod)?.Mods ?? new[] { mod });
|
||||||
|
// Resolve MultiMods as their .Mods property
|
||||||
|
|
||||||
public abstract IEnumerable<Mod> GetModsFor(ModType type);
|
public abstract IEnumerable<Mod> GetModsFor(ModType type);
|
||||||
|
|
||||||
public abstract Mod GetAutoplayMod();
|
public Mod GetAutoplayMod() => GetAllMods().First(mod => mod is ModAutoplay);
|
||||||
|
|
||||||
protected Ruleset(RulesetInfo rulesetInfo)
|
protected Ruleset(RulesetInfo rulesetInfo)
|
||||||
{
|
{
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Newtonsoft.Json;
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Users;
|
using osu.Game.Users;
|
||||||
@ -15,70 +14,30 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
{
|
{
|
||||||
public ScoreRank Rank { get; set; }
|
public ScoreRank Rank { get; set; }
|
||||||
|
|
||||||
[JsonProperty(@"score")]
|
|
||||||
public double TotalScore { get; set; }
|
public double TotalScore { get; set; }
|
||||||
|
|
||||||
public double Accuracy { get; set; }
|
public double Accuracy { get; set; }
|
||||||
|
|
||||||
public double Health { get; set; } = 1;
|
public double Health { get; set; } = 1;
|
||||||
|
|
||||||
[JsonProperty(@"max_combo")]
|
|
||||||
public int MaxCombo { get; set; }
|
public int MaxCombo { get; set; }
|
||||||
|
|
||||||
public int Combo { get; set; }
|
public int Combo { get; set; }
|
||||||
|
|
||||||
[JsonProperty(@"mods")]
|
|
||||||
protected string[] ModStrings { get; set; } //todo: parse to Mod objects
|
|
||||||
|
|
||||||
public RulesetInfo Ruleset { get; set; }
|
public RulesetInfo Ruleset { get; set; }
|
||||||
|
|
||||||
public Mod[] Mods { get; set; }
|
public Mod[] Mods { get; set; }
|
||||||
|
|
||||||
[JsonProperty(@"user")]
|
|
||||||
public User User;
|
public User User;
|
||||||
|
|
||||||
[JsonProperty(@"replay_data")]
|
|
||||||
public Replay Replay;
|
public Replay Replay;
|
||||||
|
|
||||||
public BeatmapInfo Beatmap;
|
public BeatmapInfo Beatmap;
|
||||||
|
|
||||||
[JsonProperty(@"score_id")]
|
|
||||||
public long OnlineScoreID;
|
public long OnlineScoreID;
|
||||||
|
|
||||||
[JsonProperty(@"created_at")]
|
|
||||||
public DateTimeOffset Date;
|
public DateTimeOffset Date;
|
||||||
|
|
||||||
[JsonProperty(@"statistics")]
|
|
||||||
private Dictionary<string, dynamic> jsonStats
|
|
||||||
{
|
|
||||||
set
|
|
||||||
{
|
|
||||||
foreach (var kvp in value)
|
|
||||||
{
|
|
||||||
string key = kvp.Key;
|
|
||||||
switch (key)
|
|
||||||
{
|
|
||||||
case @"count_300":
|
|
||||||
key = @"300";
|
|
||||||
break;
|
|
||||||
case @"count_100":
|
|
||||||
key = @"100";
|
|
||||||
break;
|
|
||||||
case @"count_50":
|
|
||||||
key = @"50";
|
|
||||||
break;
|
|
||||||
case @"count_miss":
|
|
||||||
key = @"x";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
Statistics.Add(key, kvp.Value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Dictionary<string, dynamic> Statistics = new Dictionary<string, dynamic>();
|
public Dictionary<string, dynamic> Statistics = new Dictionary<string, dynamic>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ namespace osu.Game.Rulesets.UI
|
|||||||
private readonly SpriteIcon modIcon;
|
private readonly SpriteIcon modIcon;
|
||||||
private readonly SpriteIcon background;
|
private readonly SpriteIcon background;
|
||||||
|
|
||||||
private const float icon_size = 80;
|
private const float background_size = 80;
|
||||||
|
|
||||||
public FontAwesome Icon
|
public FontAwesome Icon
|
||||||
{
|
{
|
||||||
@ -39,7 +39,7 @@ namespace osu.Game.Rulesets.UI
|
|||||||
{
|
{
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Size = new Vector2(icon_size),
|
Size = new Vector2(background_size),
|
||||||
Icon = FontAwesome.fa_osu_mod_bg,
|
Icon = FontAwesome.fa_osu_mod_bg,
|
||||||
Shadow = true,
|
Shadow = true,
|
||||||
},
|
},
|
||||||
@ -48,7 +48,7 @@ namespace osu.Game.Rulesets.UI
|
|||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
Colour = OsuColour.Gray(84),
|
Colour = OsuColour.Gray(84),
|
||||||
Size = new Vector2(icon_size - 35),
|
Size = new Vector2(background_size - 35),
|
||||||
Y = 25,
|
Y = 25,
|
||||||
Icon = mod.Icon
|
Icon = mod.Icon
|
||||||
},
|
},
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Colour;
|
using osu.Framework.Graphics.Colour;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using System;
|
|
||||||
using osu.Framework.Allocation;
|
|
||||||
using osu.Framework.Threading;
|
using osu.Framework.Threading;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
|
@ -4,17 +4,19 @@
|
|||||||
using System;
|
using System;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
|
using osu.Framework;
|
||||||
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Framework.Input;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
|
||||||
using osu.Game.Rulesets.Mods;
|
|
||||||
using osu.Game.Users;
|
|
||||||
using osu.Framework;
|
|
||||||
using osu.Game.Rulesets.Scoring;
|
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
|
using osu.Game.Graphics.Sprites;
|
||||||
|
using osu.Game.Rulesets.Mods;
|
||||||
|
using osu.Game.Rulesets.Scoring;
|
||||||
|
using osu.Game.Rulesets.UI;
|
||||||
|
using osu.Game.Users;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Select.Leaderboards
|
namespace osu.Game.Screens.Select.Leaderboards
|
||||||
{
|
{
|
||||||
@ -41,7 +43,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
private readonly ScoreComponentLabel maxCombo;
|
private readonly ScoreComponentLabel maxCombo;
|
||||||
private readonly ScoreComponentLabel accuracy;
|
private readonly ScoreComponentLabel accuracy;
|
||||||
private readonly Container flagBadgeContainer;
|
private readonly Container flagBadgeContainer;
|
||||||
private readonly FillFlowContainer<ScoreModIcon> modsContainer;
|
private readonly FillFlowContainer<ModIcon> modsContainer;
|
||||||
|
|
||||||
private Visibility state;
|
private Visibility state;
|
||||||
|
|
||||||
@ -247,7 +249,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
modsContainer = new FillFlowContainer<ScoreModIcon>
|
modsContainer = new FillFlowContainer<ModIcon>
|
||||||
{
|
{
|
||||||
Anchor = Anchor.BottomRight,
|
Anchor = Anchor.BottomRight,
|
||||||
Origin = Anchor.BottomRight,
|
Origin = Anchor.BottomRight,
|
||||||
@ -260,13 +262,13 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (Score.Mods != null)
|
foreach (Mod mod in Score.Mods)
|
||||||
{
|
{
|
||||||
foreach (Mod mod in Score.Mods)
|
modsContainer.Add(new ModIcon(mod)
|
||||||
{
|
{
|
||||||
// TODO: Get actual mod colours
|
AutoSizeAxes = Axes.Both,
|
||||||
modsContainer.Add(new ScoreModIcon(mod.Icon, OsuColour.FromHex(@"ffcc22")));
|
Scale = new Vector2(0.375f)
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -275,13 +277,13 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
public override void Hide() => State = Visibility.Hidden;
|
public override void Hide() => State = Visibility.Hidden;
|
||||||
public override void Show() => State = Visibility.Visible;
|
public override void Show() => State = Visibility.Visible;
|
||||||
|
|
||||||
protected override bool OnHover(Framework.Input.InputState state)
|
protected override bool OnHover(InputState state)
|
||||||
{
|
{
|
||||||
background.FadeTo(0.5f, 300, Easing.OutQuint);
|
background.FadeTo(0.5f, 300, Easing.OutQuint);
|
||||||
return base.OnHover(state);
|
return base.OnHover(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnHoverLost(Framework.Input.InputState state)
|
protected override void OnHoverLost(InputState state)
|
||||||
{
|
{
|
||||||
background.FadeTo(background_alpha, 200, Easing.OutQuint);
|
background.FadeTo(background_alpha, 200, Easing.OutQuint);
|
||||||
base.OnHoverLost(state);
|
base.OnHoverLost(state);
|
||||||
@ -311,8 +313,8 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Font = font,
|
Font = font,
|
||||||
TextSize = textSize,
|
|
||||||
FixedWidth = true,
|
FixedWidth = true,
|
||||||
|
TextSize = textSize,
|
||||||
Text = text,
|
Text = text,
|
||||||
Colour = glowColour,
|
Colour = glowColour,
|
||||||
Shadow = false,
|
Shadow = false,
|
||||||
@ -334,36 +336,6 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class ScoreModIcon : Container
|
|
||||||
{
|
|
||||||
public ScoreModIcon(FontAwesome icon, Color4 colour)
|
|
||||||
{
|
|
||||||
AutoSizeAxes = Axes.Both;
|
|
||||||
|
|
||||||
Children = new[]
|
|
||||||
{
|
|
||||||
new SpriteIcon
|
|
||||||
{
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Icon = FontAwesome.fa_osu_mod_bg,
|
|
||||||
Colour = colour,
|
|
||||||
Shadow = true,
|
|
||||||
Size = new Vector2(30),
|
|
||||||
},
|
|
||||||
new SpriteIcon
|
|
||||||
{
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Icon = icon,
|
|
||||||
Colour = OsuColour.Gray(84),
|
|
||||||
Size = new Vector2(18),
|
|
||||||
Position = new Vector2(0f, 2f),
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private class ScoreComponentLabel : Container
|
private class ScoreComponentLabel : Container
|
||||||
{
|
{
|
||||||
public ScoreComponentLabel(FontAwesome icon, string value)
|
public ScoreComponentLabel(FontAwesome icon, string value)
|
||||||
|
Loading…
Reference in New Issue
Block a user