1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 11:27:24 +08:00

Merge remote-tracking branch 'origin/master' into combocounter_bindable

Conflicts:
	osu.Game.Modes.Osu/OsuRuleset.cs
	osu.Game/Modes/Ruleset.cs
This commit is contained in:
smoogipooo 2017-03-10 14:15:06 +09:00
commit 7a68e46366
10 changed files with 16 additions and 16 deletions

View File

@ -2,19 +2,14 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK;
using OpenTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites;
using osu.Framework.MathUtils;
using osu.Framework.Screens.Testing;
using osu.Game.Graphics.UserInterface;
using osu.Game.Modes.Catch.UI;
using osu.Game.Modes.Mania.UI;
using osu.Game.Modes.Osu.UI;
using osu.Game.Modes.Taiko.UI;
using osu.Game.Modes.UI;
using System;
namespace osu.Desktop.VisualTests.Tests
{

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;
public override KeyCounter[] GameplayKeys => new KeyCounter[]

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[] GameplayKeys => 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[] GameplayKeys => 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[] GameplayKeys => 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,9 @@ 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 +46,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