1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 21:02:55 +08:00

Merge branch 'general_hud' of https://github.com/smoogipooo/osu into general_hud

Conflicts:
	osu.Game.Modes.Osu/OsuRuleset.cs
This commit is contained in:
smoogipooo 2017-03-10 13:42:50 +09:00
commit f44fa56646
9 changed files with 15 additions and 11 deletions

View File

@ -78,6 +78,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;

View File

@ -98,6 +98,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 KeyCounter[] CreateGameplayKeys => new KeyCounter[] { /* Todo: Should be keymod specific */ };

View File

@ -112,6 +112,7 @@ namespace osu.Game.Modes.Osu
protected override PlayMode PlayMode => PlayMode.Osu;
public override string Description => "osu!";
public override KeyCounter[] CreateGameplayKeys => new KeyCounter[]
{
new KeyCounterKeyboard(Key.Z),

View File

@ -78,6 +78,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 KeyCounter[] CreateGameplayKeys => new KeyCounter[]

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

@ -25,6 +25,8 @@ namespace osu.Game.Modes
private static ConcurrentDictionary<PlayMode, Type> availableRulesets = new ConcurrentDictionary<PlayMode, Type>();
public static IEnumerable<PlayMode> PlayModes => availableRulesets.Keys;
public virtual IEnumerable<BeatmapStatistic> GetBeatmapStatistics(WorkingBeatmap beatmap) => new BeatmapStatistic[] { };
public abstract IEnumerable<Mod> GetModsFor(ModType type);
@ -43,6 +45,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

@ -147,8 +147,8 @@ namespace osu.Game.Overlays
var previous = sidebarButtons.SingleOrDefault(sb => sb.Selected);
var next = sidebarButtons.SingleOrDefault(sb => sb.Section == bestCandidate);
if (next != null) next.Selected = true;
if (previous != null) previous.Selected = false;
if (next != null) next.Selected = true;
}
}

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