1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 18:53:21 +08:00

Merge branch 'master' into replay

# Conflicts:
#	osu.Game/Modes/Mod.cs
This commit is contained in:
Dean Herbert 2017-03-07 14:32:14 +09:00
commit bff1179624
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49
8 changed files with 77 additions and 201 deletions

View File

@ -17,7 +17,6 @@ namespace osu.Game.Modes.Catch
{ {
public override string Description => @"Play with no approach circles and fading notes for a slight score advantage."; public override string Description => @"Play with no approach circles and fading notes for a slight score advantage.";
public override double ScoreMultiplier => 1.06; public override double ScoreMultiplier => 1.06;
public override Mods[] DisablesMods => new Mods[] { };
} }
public class CatchModHardRock : ModHardRock public class CatchModHardRock : ModHardRock
@ -54,7 +53,6 @@ namespace osu.Game.Modes.Catch
public class CatchModFlashlight : ModFlashlight public class CatchModFlashlight : ModFlashlight
{ {
public override double ScoreMultiplier => 1.12; public override double ScoreMultiplier => 1.12;
public override Mods[] DisablesMods => new Mods[] { };
} }
public class CatchModPerfect : ModPerfect public class CatchModPerfect : ModPerfect

View File

@ -1,6 +1,7 @@
// 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 osu.Game.Graphics; using osu.Game.Graphics;
namespace osu.Game.Modes.Mania namespace osu.Game.Modes.Mania
@ -19,13 +20,12 @@ namespace osu.Game.Modes.Mania
{ {
public override string Description => @"The notes fade out before you hit them!"; public override string Description => @"The notes fade out before you hit them!";
public override double ScoreMultiplier => 1.0; public override double ScoreMultiplier => 1.0;
public override Mods[] DisablesMods => new[] { Mods.Flashlight }; public override Type[] IncompatibleMods => new[] { typeof(ModFlashlight) };
} }
public class ManiaModHardRock : ModHardRock public class ManiaModHardRock : ModHardRock
{ {
public override double ScoreMultiplier => 1.0; public override double ScoreMultiplier => 1.0;
public override bool Ranked => false;
} }
public class ManiaModSuddenDeath : ModSuddenDeath public class ManiaModSuddenDeath : ModSuddenDeath
@ -51,7 +51,7 @@ namespace osu.Game.Modes.Mania
public class ManiaModFlashlight : ModFlashlight public class ManiaModFlashlight : ModFlashlight
{ {
public override double ScoreMultiplier => 1.0; public override double ScoreMultiplier => 1.0;
public override Mods[] DisablesMods => new[] { Mods.Hidden }; public override Type[] IncompatibleMods => new[] { typeof(ModHidden) };
} }
public class ManiaModPerfect : ModPerfect public class ManiaModPerfect : ModPerfect
@ -61,95 +61,86 @@ namespace osu.Game.Modes.Mania
public class ManiaModFadeIn : Mod public class ManiaModFadeIn : Mod
{ {
public override Mods Name => Mods.FadeIn; public override string Name => "FadeIn";
public override FontAwesome Icon => FontAwesome.fa_osu_mod_hidden; public override FontAwesome Icon => FontAwesome.fa_osu_mod_hidden;
public override string Description => @"";
public override double ScoreMultiplier => 1; public override double ScoreMultiplier => 1;
public override bool Ranked => true; public override bool Ranked => true;
public override Mods[] DisablesMods => new[] { Mods.Flashlight }; public override Type[] IncompatibleMods => new[] { typeof(ModFlashlight) };
} }
public class ManiaModRandom : Mod public class ManiaModRandom : Mod
{ {
public override Mods Name => Mods.Random; public override string Name => "Random";
public override FontAwesome Icon => FontAwesome.fa_close;
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 override bool Ranked => false;
public override Mods[] DisablesMods => new Mods[] { };
} }
public abstract class ManiaKeyMod : Mod public abstract class ManiaKeyMod : Mod
{ {
public abstract int KeyCount { get; } public abstract int KeyCount { get; }
public override FontAwesome Icon => FontAwesome.fa_close; // TODO: Add proper key icons
public override string Description => @"";
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;
public override Mods[] DisablesMods => new Mods[] { };
} }
public class ManiaModKey1 : ManiaKeyMod public class ManiaModKey1 : ManiaKeyMod
{ {
public override int KeyCount => 1; public override int KeyCount => 1;
public override Mods Name => Mods.Key1; public override string Name => "1K";
} }
public class ManiaModKey2 : ManiaKeyMod public class ManiaModKey2 : ManiaKeyMod
{ {
public override int KeyCount => 2; public override int KeyCount => 2;
public override Mods Name => Mods.Key2; public override string Name => "2K";
} }
public class ManiaModKey3 : ManiaKeyMod public class ManiaModKey3 : ManiaKeyMod
{ {
public override int KeyCount => 3; public override int KeyCount => 3;
public override Mods Name => Mods.Key3; public override string Name => "3K";
} }
public class ManiaModKey4 : ManiaKeyMod public class ManiaModKey4 : ManiaKeyMod
{ {
public override int KeyCount => 4; public override int KeyCount => 4;
public override Mods Name => Mods.Key4; public override string Name => "4K";
} }
public class ManiaModKey5 : ManiaKeyMod public class ManiaModKey5 : ManiaKeyMod
{ {
public override int KeyCount => 5; public override int KeyCount => 5;
public override Mods Name => Mods.Key5; public override string Name => "5K";
} }
public class ManiaModKey6 : ManiaKeyMod public class ManiaModKey6 : ManiaKeyMod
{ {
public override int KeyCount => 6; public override int KeyCount => 6;
public override Mods Name => Mods.Key6; public override string Name => "6K";
} }
public class ManiaModKey7 : ManiaKeyMod public class ManiaModKey7 : ManiaKeyMod
{ {
public override int KeyCount => 7; public override int KeyCount => 7;
public override Mods Name => Mods.Key7; public override string Name => "7K";
} }
public class ManiaModKey8 : ManiaKeyMod public class ManiaModKey8 : ManiaKeyMod
{ {
public override int KeyCount => 8; public override int KeyCount => 8;
public override Mods Name => Mods.Key8; public override string Name => "8K";
} }
public class ManiaModKey9 : ManiaKeyMod public class ManiaModKey9 : ManiaKeyMod
{ {
public override int KeyCount => 9; public override int KeyCount => 9;
public override Mods Name => Mods.Key9; public override string Name => "9K";
} }
public class ManiaModKeyCoop : Mod public class ManiaModKeyCoop : Mod
{ {
public override Mods Name => Mods.KeyCoop; public override string Name => "KeyCoop";
public override FontAwesome Icon => FontAwesome.fa_close;
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;
public override Mods[] DisablesMods => new Mods[] { };
} }
} }

View File

@ -1,13 +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.Linq;
using osu.Game.Graphics; using osu.Game.Graphics;
namespace osu.Game.Modes.Osu namespace osu.Game.Modes.Osu
{ {
public class OsuModNoFail : ModNoFail public class OsuModNoFail : ModNoFail
{ {
public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModAutopilot) }).ToArray();
} }
public class OsuModEasy : ModEasy public class OsuModEasy : ModEasy
@ -19,7 +21,6 @@ namespace osu.Game.Modes.Osu
{ {
public override string Description => @"Play with no approach circles and fading notes for a slight score advantage."; public override string Description => @"Play with no approach circles and fading notes for a slight score advantage.";
public override double ScoreMultiplier => 1.06; public override double ScoreMultiplier => 1.06;
public override Mods[] DisablesMods => new Mods[] { };
} }
public class OsuModHardRock : ModHardRock public class OsuModHardRock : ModHardRock
@ -30,7 +31,7 @@ namespace osu.Game.Modes.Osu
public class OsuModSuddenDeath : ModSuddenDeath public class OsuModSuddenDeath : ModSuddenDeath
{ {
public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModAutopilot) }).ToArray();
} }
public class OsuModDoubleTime : ModDoubleTime public class OsuModDoubleTime : ModDoubleTime
@ -41,6 +42,7 @@ namespace osu.Game.Modes.Osu
public class OsuModRelax : ModRelax public class OsuModRelax : ModRelax
{ {
public override string Description => "You don't need to click.\nGive your clicking/tapping finger a break from the heat of things."; public override string Description => "You don't need to click.\nGive your clicking/tapping finger a break from the heat of things.";
public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModAutopilot) }).ToArray();
} }
public class OsuModHalfTime : ModHalfTime public class OsuModHalfTime : ModHalfTime
@ -56,41 +58,43 @@ namespace osu.Game.Modes.Osu
public class OsuModFlashlight : ModFlashlight public class OsuModFlashlight : ModFlashlight
{ {
public override double ScoreMultiplier => 1.12; public override double ScoreMultiplier => 1.12;
public override Mods[] DisablesMods => new Mods[] { };
} }
public class OsuModPerfect : ModPerfect public class OsuModPerfect : ModPerfect
{ {
} }
public class OsuModSpunOut : Mod public class OsuModSpunOut : Mod
{ {
public override Mods Name => Mods.SpunOut; public override string Name => "Spun Out";
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;
public override bool Ranked => true; public override bool Ranked => true;
public override Mods[] DisablesMods => new[] { Mods.Autoplay, Mods.Cinema, Mods.Autopilot }; public override Type[] IncompatibleMods => new[] { typeof(ModAutoplay), typeof(ModCinema), typeof(OsuModAutopilot) };
} }
public class OsuModAutopilot : Mod public class OsuModAutopilot : Mod
{ {
public override Mods Name => Mods.Autopilot; public override string Name => "Autopilot";
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;
public override bool Ranked => false; public override bool Ranked => false;
public override Mods[] DisablesMods => new[] { Mods.SpunOut, Mods.Relax, Mods.SuddenDeath, Mods.Perfect, Mods.NoFail, Mods.Autoplay, Mods.Cinema }; public override Type[] IncompatibleMods => new[] { typeof(OsuModSpunOut), typeof(ModRelax), typeof(ModSuddenDeath), typeof(ModPerfect), typeof(ModNoFail), typeof(ModAutoplay), typeof(ModCinema) };
}
public class OsuModAutoplay : ModAutoplay
{
public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModAutopilot) }).ToArray();
} }
public class OsuModTarget : Mod public class OsuModTarget : Mod
{ {
public override Mods Name => Mods.Target; public override string Name => "Target";
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;
public override bool Ranked => false;
public override Mods[] DisablesMods => new Mods[] { };
} }
} }

View File

@ -86,7 +86,7 @@ namespace osu.Game.Modes.Osu
{ {
Mods = new Mod[] Mods = new Mod[]
{ {
new ModAutoplay(), new OsuModAutoplay(),
new ModCinema(), new ModCinema(),
}, },
}, },

View File

@ -17,7 +17,6 @@ namespace osu.Game.Modes.Taiko
{ {
public override string Description => @"The notes fade out before you hit them!"; public override string Description => @"The notes fade out before you hit them!";
public override double ScoreMultiplier => 1.06; public override double ScoreMultiplier => 1.06;
public override Mods[] DisablesMods => new Mods[] { };
} }
public class TaikoModHardRock : ModHardRock public class TaikoModHardRock : ModHardRock
@ -54,7 +53,6 @@ namespace osu.Game.Modes.Taiko
public class TaikoModFlashlight : ModFlashlight public class TaikoModFlashlight : ModFlashlight
{ {
public override double ScoreMultiplier => 1.12; public override double ScoreMultiplier => 1.12;
public override Mods[] DisablesMods => new Mods[] { };
} }
public class TaikoModPerfect : ModPerfect public class TaikoModPerfect : ModPerfect

View File

@ -2,7 +2,6 @@
// 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;
using System.ComponentModel;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Screens.Play; using osu.Game.Screens.Play;
@ -16,17 +15,17 @@ namespace osu.Game.Modes
/// <summary> /// <summary>
/// The name of this mod. /// The name of this mod.
/// </summary> /// </summary>
public abstract Mods Name { get; } public abstract string Name { get; }
/// <summary> /// <summary>
/// The icon of this mod. /// The icon of this mod.
/// </summary> /// </summary>
public abstract FontAwesome Icon { get; } public virtual FontAwesome Icon => FontAwesome.fa_question;
/// <summary> /// <summary>
/// The user readable description of this mod. /// The user readable description of this mod.
/// </summary> /// </summary>
public abstract string Description { get; } public virtual string Description => string.Empty;
/// <summary> /// <summary>
/// The score multiplier of this mod. /// The score multiplier of this mod.
@ -36,12 +35,12 @@ namespace osu.Game.Modes
/// <summary> /// <summary>
/// Returns if this mod is ranked. /// Returns if this mod is ranked.
/// </summary> /// </summary>
public abstract bool Ranked { get; } public virtual bool Ranked => false;
/// <summary> /// <summary>
/// The mods this mod cannot be enabled with. /// The mods this mod cannot be enabled with.
/// </summary> /// </summary>
public abstract Mods[] DisablesMods { get; } public virtual Type[] IncompatibleMods => new Type[] { };
/// <summary> /// <summary>
/// Direct access to the Player before load has run. /// Direct access to the Player before load has run.
@ -52,111 +51,106 @@ namespace osu.Game.Modes
public class MultiMod : Mod public class MultiMod : Mod
{ {
public override Mods Name => Modes.Mods.None; public override string Name => string.Empty;
public override FontAwesome Icon => FontAwesome.fa_close; public override string Description => string.Empty;
public override string Description => @"";
public override double ScoreMultiplier => 0.0; public override double ScoreMultiplier => 0.0;
public override bool Ranked => false;
public override Mods[] DisablesMods => new Mods[] { };
public Mod[] Mods; public Mod[] Mods;
} }
public abstract class ModNoFail : Mod public abstract class ModNoFail : Mod
{ {
public override Mods Name => Mods.NoFail; public override string Name => "NoFail";
public override FontAwesome Icon => FontAwesome.fa_osu_mod_nofail; public override FontAwesome Icon => FontAwesome.fa_osu_mod_nofail;
public override string Description => @"You can't fail, no matter what."; public override string Description => "You can't fail, no matter what.";
public override double ScoreMultiplier => 0.5; public override double ScoreMultiplier => 0.5;
public override bool Ranked => true; public override bool Ranked => true;
public override Mods[] DisablesMods => new[] { Mods.Relax, Mods.Autopilot, Mods.SuddenDeath, Mods.Perfect }; public override Type[] IncompatibleMods => new[] { typeof(ModRelax), typeof(ModSuddenDeath), typeof(ModPerfect) };
} }
public abstract class ModEasy : Mod public abstract class ModEasy : Mod
{ {
public override Mods Name => Mods.Easy; public override string Name => "Easy";
public override FontAwesome Icon => FontAwesome.fa_osu_mod_easy; public override FontAwesome Icon => FontAwesome.fa_osu_mod_easy;
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.";
public override double ScoreMultiplier => 0.5; public override double ScoreMultiplier => 0.5;
public override bool Ranked => true; public override bool Ranked => true;
public override Mods[] DisablesMods => new[] { Mods.HardRock }; public override Type[] IncompatibleMods => new[] { typeof(ModHardRock) };
} }
public abstract class ModHidden : Mod public abstract class ModHidden : Mod
{ {
public override Mods Name => Mods.Hidden; public override string Name => "Hidden";
public override FontAwesome Icon => FontAwesome.fa_osu_mod_hidden; public override FontAwesome Icon => FontAwesome.fa_osu_mod_hidden;
public override bool Ranked => true; public override bool Ranked => true;
} }
public abstract class ModHardRock : Mod public abstract class ModHardRock : Mod
{ {
public override Mods Name => Mods.HardRock; public override string Name => "Hard Rock";
public override FontAwesome Icon => FontAwesome.fa_osu_mod_hardrock; public override FontAwesome Icon => FontAwesome.fa_osu_mod_hardrock;
public override string Description => @"Everything just got a bit harder..."; public override string Description => "Everything just got a bit harder...";
public override Mods[] DisablesMods => new[] { Mods.Easy }; public override Type[] IncompatibleMods => new[] { typeof(ModEasy) };
} }
public abstract class ModSuddenDeath : Mod public abstract class ModSuddenDeath : Mod
{ {
public override Mods Name => Mods.SuddenDeath; public override string Name => "Sudden Death";
public override FontAwesome Icon => FontAwesome.fa_osu_mod_suddendeath; public override FontAwesome Icon => FontAwesome.fa_osu_mod_suddendeath;
public override string Description => @"Miss a note and fail."; public override string Description => "Miss a note and fail.";
public override double ScoreMultiplier => 1; public override double ScoreMultiplier => 1;
public override bool Ranked => true; public override bool Ranked => true;
public override Mods[] DisablesMods => new[] { Mods.NoFail, Mods.Relax, Mods.Autopilot, Mods.Autoplay, Mods.Cinema }; public override Type[] IncompatibleMods => new[] { typeof(ModNoFail), typeof(ModRelax), typeof(ModAutoplay), typeof(ModCinema) };
} }
public abstract class ModDoubleTime : Mod public abstract class ModDoubleTime : Mod
{ {
public override Mods Name => Mods.DoubleTime; public override string Name => "Double Time";
public override FontAwesome Icon => FontAwesome.fa_osu_mod_doubletime; public override FontAwesome Icon => FontAwesome.fa_osu_mod_doubletime;
public override string Description => @"Zoooooooooom"; public override string Description => "Zoooooooooom";
public override bool Ranked => true; public override bool Ranked => true;
public override Mods[] DisablesMods => new[] { Mods.HalfTime }; public override Type[] IncompatibleMods => new[] { typeof(ModHalfTime) };
} }
public abstract class ModRelax : Mod public abstract class ModRelax : Mod
{ {
public override Mods Name => Mods.Relax; public override string Name => "Relax";
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 bool Ranked => false; public override Type[] IncompatibleMods => new[] { typeof(ModAutoplay), typeof(ModCinema), typeof(ModNoFail), typeof(ModSuddenDeath), typeof(ModPerfect) };
public override Mods[] DisablesMods => new[] { Mods.Autopilot, Mods.Autoplay, Mods.Cinema, Mods.NoFail, Mods.SuddenDeath, Mods.Perfect };
} }
public abstract class ModHalfTime : Mod public abstract class ModHalfTime : Mod
{ {
public override Mods Name => Mods.HalfTime; public override string Name => "Half Time";
public override FontAwesome Icon => FontAwesome.fa_osu_mod_halftime; public override FontAwesome Icon => FontAwesome.fa_osu_mod_halftime;
public override string Description => @"Less zoom"; public override string Description => "Less zoom";
public override bool Ranked => true; public override bool Ranked => true;
public override Mods[] DisablesMods => new[] { Mods.DoubleTime, Mods.Nightcore }; public override Type[] IncompatibleMods => new[] { typeof(ModDoubleTime), typeof(ModNightcore) };
} }
public abstract class ModNightcore : ModDoubleTime public abstract class ModNightcore : ModDoubleTime
{ {
public override Mods Name => Mods.Nightcore; public override string Name => "Nightcore";
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";
} }
public abstract class ModFlashlight : Mod public abstract class ModFlashlight : Mod
{ {
public override Mods Name => Mods.Flashlight; public override string Name => "Flashlight";
public override FontAwesome Icon => FontAwesome.fa_osu_mod_flashlight; public override FontAwesome Icon => FontAwesome.fa_osu_mod_flashlight;
public override string Description => @"Restricted view area."; public override string Description => "Restricted view area.";
public override bool Ranked => true; public override bool Ranked => true;
} }
public class ModAutoplay : Mod public class ModAutoplay : Mod
{ {
public override Mods Name => Mods.Autoplay; public override string Name => "Autoplay";
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;
public override bool Ranked => false; public override Type[] IncompatibleMods => new[] { typeof(ModRelax), typeof(ModSuddenDeath), typeof(ModPerfect) };
public override Mods[] DisablesMods => new[] { Mods.Relax, Mods.Autopilot, Mods.SpunOut, Mods.SuddenDeath, Mods.Perfect };
public override void PlayerLoading(Player player) public override void PlayerLoading(Player player)
{ {
@ -167,115 +161,16 @@ namespace osu.Game.Modes
public abstract class ModPerfect : ModSuddenDeath public abstract class ModPerfect : ModSuddenDeath
{ {
public override Mods Name => Mods.Perfect; public override string Name => "Perfect";
public override FontAwesome Icon => FontAwesome.fa_close; public override string Description => "SS or quit.";
public override string Description => @"SS or quit.";
} }
public class ModCinema : ModAutoplay public class ModCinema : ModAutoplay
{ {
public override Mods Name => Mods.Cinema; public override string Name => "Cinema";
public override FontAwesome Icon => FontAwesome.fa_osu_mod_cinema; public override FontAwesome Icon => FontAwesome.fa_osu_mod_cinema;
} }
[Flags]
public enum Mods
{
None = 0,
[Description(@"No Fail")]
NoFail = 1 << 0,
[Description(@"Easy")]
Easy = 1 << 1,
//NoVideo = 1 << 2,
[Description(@"Hidden")]
Hidden = 1 << 3,
[Description(@"Hard Rock")]
HardRock = 1 << 4,
[Description(@"Sudden Death")]
SuddenDeath = 1 << 5,
[Description(@"Double Time")]
DoubleTime = 1 << 6,
[Description(@"Relax")]
Relax = 1 << 7,
[Description(@"Halftime")]
HalfTime = 1 << 8,
[Description(@"Nightcore")]
Nightcore = 1 << 9,
[Description(@"Flashlight")]
Flashlight = 1 << 10,
[Description(@"Auto")]
Autoplay = 1 << 11,
[Description(@"Spun Out")]
SpunOut = 1 << 12,
[Description(@"Autopilot")]
Autopilot = 1 << 13,
[Description(@"Perfect")]
Perfect = 1 << 14,
[Description(@"4K")]
Key4 = 1 << 15,
[Description(@"5K")]
Key5 = 1 << 16,
[Description(@"6K")]
Key6 = 1 << 17,
[Description(@"7K")]
Key7 = 1 << 18,
[Description(@"8K")]
Key8 = 1 << 19,
[Description(@"Fade In")]
FadeIn = 1 << 20,
[Description(@"Random")]
Random = 1 << 21,
[Description(@"Cinema")]
Cinema = 1 << 22,
[Description(@"Target Practice")]
Target = 1 << 23,
[Description(@"9K")]
Key9 = 1 << 24,
[Description(@"Co-Op")]
KeyCoop = 1 << 25,
[Description(@"1K")]
Key1 = 1 << 26,
[Description(@"3K")]
Key3 = 1 << 27,
[Description(@"2K")]
Key2 = 1 << 28,
LastMod = 1 << 29,
KeyMod = Key1 | Key2 | Key3 | Key4 | Key5 | Key6 | Key7 | Key8 | Key9 | KeyCoop,
FreeModAllowed = NoFail | Easy | Hidden | HardRock | SuddenDeath | Flashlight | FadeIn | Relax | Autopilot | SpunOut | KeyMod,
ScoreIncreaseMods = Hidden | HardRock | DoubleTime | Flashlight | FadeIn
}
public enum ModType public enum ModType
{ {
DifficultyReduction, DifficultyReduction,

View File

@ -9,7 +9,6 @@ using OpenTK.Input;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Audio; using osu.Framework.Audio;
using osu.Framework.Audio.Sample; using osu.Framework.Audio.Sample;
using osu.Framework.Extensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
@ -111,14 +110,7 @@ namespace osu.Game.Overlays.Mods
if (mod == value) return; if (mod == value) return;
mod = value; mod = value;
if (mod is MultiMod) Mods = (mod as MultiMod)?.Mods ?? new[] { mod };
{
Mods = ((MultiMod)mod).Mods;
}
else
{
Mods = new[] { mod };
}
createIcons(); createIcons();
if (Mods.Length > 0) if (Mods.Length > 0)
@ -185,7 +177,7 @@ namespace osu.Game.Overlays.Mods
private void displayMod(Mod mod) private void displayMod(Mod mod)
{ {
displayIcon.Icon = mod.Icon; displayIcon.Icon = mod.Icon;
text.Text = mod.Name.GetDescription(); text.Text = mod.Name;
} }
private void displaySelectedMod() private void displaySelectedMod()

View File

@ -124,7 +124,7 @@ namespace osu.Game.Overlays.Mods
} }
} }
public void DeselectMod(Modes.Mods modName) public void DeselectType(Type modType)
{ {
foreach (ModSection section in modSectionsContainer.Children) foreach (ModSection section in modSectionsContainer.Children)
{ {
@ -132,7 +132,7 @@ namespace osu.Game.Overlays.Mods
{ {
foreach (Mod mod in button.Mods) foreach (Mod mod in button.Mods)
{ {
if (mod.Name == modName) if (modType.IsInstanceOfType(mod))
{ {
button.Deselect(); button.Deselect();
return; return;
@ -146,10 +146,8 @@ namespace osu.Game.Overlays.Mods
{ {
if (selectedMod != null) if (selectedMod != null)
{ {
foreach (Modes.Mods disableMod in selectedMod.DisablesMods) foreach (Type t in selectedMod.IncompatibleMods)
{ DeselectType(t);
DeselectMod(disableMod);
}
} }
refreshSelectedMods(); refreshSelectedMods();