Merge pull request #459 from Jorolf/rulesetAndPlayModeRemake

Added Descriptions to Rulesets + PlayModes list
This commit is contained in:
Dean Herbert 2017-03-10 13:18:43 +09:00 committed by GitHub
commit 9e223bd77b
8 changed files with 15 additions and 10 deletions

View File

@ -79,6 +79,8 @@ namespace osu.Game.Modes.Catch
protected override PlayMode PlayMode => PlayMode.Catch;
public override string Description => "osu!catch";
public override FontAwesome Icon => FontAwesome.fa_osu_fruits_o;
public override ScoreProcessor CreateScoreProcessor(int hitObjectCount = 0) => null;

View File

@ -100,6 +100,8 @@ namespace osu.Game.Modes.Mania
protected override PlayMode PlayMode => PlayMode.Mania;
public override string Description => "osu!mania";
public override FontAwesome Icon => FontAwesome.fa_osu_mania_o;
public override ScoreProcessor CreateScoreProcessor(int hitObjectCount = 0) => null;

View File

@ -111,5 +111,7 @@ namespace osu.Game.Modes.Osu
}
protected override PlayMode PlayMode => PlayMode.Osu;
public override string Description => "osu!";
}
}

View File

@ -79,6 +79,8 @@ namespace osu.Game.Modes.Taiko
protected override PlayMode PlayMode => PlayMode.Taiko;
public override string Description => "osu!taiko";
public override FontAwesome Icon => FontAwesome.fa_osu_taiko_o;
public override ScoreProcessor CreateScoreProcessor(int hitObjectCount = 0) => null;

View File

@ -1,19 +1,13 @@
// 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.ComponentModel;
namespace osu.Game.Modes
{
public enum PlayMode
{
[Description(@"osu!")]
Osu = 0,
[Description(@"osu!taiko")]
Taiko = 1,
[Description(@"osu!catch")]
Catch = 2,
[Description(@"osu!mania")]
Mania = 3
}
}

View File

@ -22,6 +22,8 @@ namespace osu.Game.Modes
{
private static ConcurrentDictionary<PlayMode, Type> availableRulesets = new ConcurrentDictionary<PlayMode, Type>();
public static IEnumerable<PlayMode> PlayModes => availableRulesets.Keys;
public abstract ScoreOverlay CreateScoreOverlay();
public virtual IEnumerable<BeatmapStatistic> GetBeatmapStatistics(WorkingBeatmap beatmap) => new BeatmapStatistic[] { };
@ -42,6 +44,8 @@ namespace osu.Game.Modes
public virtual FontAwesome Icon => FontAwesome.fa_question_circle;
public abstract string Description { get; }
public virtual Score CreateAutoplayScore(Beatmap beatmap) => null;
public static Ruleset GetRuleset(PlayMode mode)

View File

@ -1,7 +1,6 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Extensions;
using osu.Framework.Graphics.Containers;
using osu.Game.Modes;
using OpenTK.Graphics;
@ -17,8 +16,8 @@ namespace osu.Game.Overlays.Toolbar
set
{
mode = value;
TooltipMain = mode.GetDescription();
TooltipSub = $"Play some {mode.GetDescription()}";
TooltipMain = Ruleset.GetRuleset(mode).Description;
TooltipSub = $"Play some {Ruleset.GetRuleset(mode).Description}";
Icon = Ruleset.GetRuleset(mode).Icon;
}
}

View File

@ -64,7 +64,7 @@ namespace osu.Game.Overlays.Toolbar
}
};
foreach (PlayMode m in Enum.GetValues(typeof(PlayMode)))
foreach (PlayMode m in Ruleset.PlayModes)
{
var localMode = m;
modeButtons.Add(new ToolbarModeButton