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

Made requested changes

This commit is contained in:
DrabWeb 2017-02-23 07:57:58 -04:00
parent e1c4abd8c5
commit a67bfacb19
5 changed files with 48 additions and 117 deletions

View File

@ -9,11 +9,34 @@ namespace osu.Game.Modes
{ {
public abstract class Mod public abstract class Mod
{ {
/// <summary>
/// The name of this mod.
/// </summary>
public abstract Mods Name { get; } public abstract Mods Name { get; }
/// <summary>
/// The icon of this mod.
/// </summary>
public abstract FontAwesome Icon { get; } public abstract FontAwesome Icon { get; }
/// <summary>
/// The user readable description of this mod for the given <see cref="PlayMode"/>.
/// </summary>
public virtual string Description(PlayMode mode) => @""; public virtual string Description(PlayMode mode) => @"";
/// <summary>
/// The score multiplier of this mod for the given <see cref="PlayMode"/>
/// </summary>
public abstract double ScoreMultiplier(PlayMode mode); public abstract double ScoreMultiplier(PlayMode mode);
/// <summary>
/// Returns if this mod is ranked in the given <see cref="PlayMode">
/// </summary>
public abstract bool Ranked(PlayMode mode); public abstract bool Ranked(PlayMode mode);
/// <summary>
/// The mods this mod cannot be enabled with
/// </summary>
public abstract Mods[] DisablesMods(PlayMode mode); public abstract Mods[] DisablesMods(PlayMode mode);
} }

View File

@ -12,77 +12,15 @@ namespace osu.Game
{ {
public class AssistedSection : ModSection public class AssistedSection : ModSection
{ {
private ModButton relaxButton; public ModButton RelaxButton { get; private set; }
public ModButton RelaxButton public ModButton AutopilotButton { get; private set; }
{ public ModButton TargetPracticeButton { get; private set; }
get public ModButton SpunOutButton { get; private set; }
{ public ModButton AutoplayCinemaButton { get; private set; }
return relaxButton;
}
}
private ModButton autopilotButton; public ModButton KeyButton { get; private set; }
public ModButton AutopilotButton public ModButton CoopButton { get; private set; }
{ public ModButton RandomButton { get; private set; }
get
{
return autopilotButton;
}
}
private ModButton targetPracticeButton;
public ModButton TargetPracticeButton
{
get
{
return targetPracticeButton;
}
}
private ModButton spunOutButton;
public ModButton SpunOutButton
{
get
{
return spunOutButton;
}
}
private ModButton autoplayCinemaButton;
public ModButton AutoplayCinemaButton
{
get
{
return autoplayCinemaButton;
}
}
private ModButton keyButton;
public ModButton KeyButton
{
get
{
return keyButton;
}
}
private ModButton coopButton;
public ModButton CoopButton
{
get
{
return coopButton;
}
}
private ModButton randomButton;
public ModButton RandomButton
{
get
{
return randomButton;
}
}
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OsuColour colours)
@ -100,7 +38,7 @@ namespace osu.Game
case PlayMode.Osu: case PlayMode.Osu:
Buttons = new ModButton[] Buttons = new ModButton[]
{ {
relaxButton = new ModButton RelaxButton = new ModButton
{ {
ToggleKey = Key.Z, ToggleKey = Key.Z,
Mods = new Mod[] Mods = new Mod[]
@ -108,7 +46,7 @@ namespace osu.Game
new ModRelax(), new ModRelax(),
}, },
}, },
autopilotButton = new ModButton AutopilotButton = new ModButton
{ {
ToggleKey = Key.X, ToggleKey = Key.X,
Mods = new Mod[] Mods = new Mod[]
@ -116,7 +54,7 @@ namespace osu.Game
new ModAutopilot(), new ModAutopilot(),
}, },
}, },
targetPracticeButton = new ModButton TargetPracticeButton = new ModButton
{ {
ToggleKey = Key.C, ToggleKey = Key.C,
Mods = new Mod[] Mods = new Mod[]
@ -124,7 +62,7 @@ namespace osu.Game
new ModTarget(), new ModTarget(),
}, },
}, },
spunOutButton = new ModButton SpunOutButton = new ModButton
{ {
ToggleKey = Key.V, ToggleKey = Key.V,
Mods = new Mod[] Mods = new Mod[]
@ -132,7 +70,7 @@ namespace osu.Game
new ModSpunOut(), new ModSpunOut(),
}, },
}, },
autoplayCinemaButton = new ModButton AutoplayCinemaButton = new ModButton
{ {
ToggleKey = Key.B, ToggleKey = Key.B,
Mods = new Mod[] Mods = new Mod[]
@ -148,7 +86,7 @@ namespace osu.Game
case PlayMode.Catch: case PlayMode.Catch:
Buttons = new ModButton[] Buttons = new ModButton[]
{ {
relaxButton = new ModButton RelaxButton = new ModButton
{ {
ToggleKey = Key.Z, ToggleKey = Key.Z,
Mods = new Mod[] Mods = new Mod[]
@ -156,7 +94,7 @@ namespace osu.Game
new ModRelax(), new ModRelax(),
}, },
}, },
autoplayCinemaButton = new ModButton AutoplayCinemaButton = new ModButton
{ {
ToggleKey = Key.X, ToggleKey = Key.X,
Mods = new Mod[] Mods = new Mod[]
@ -171,7 +109,7 @@ namespace osu.Game
case PlayMode.Mania: case PlayMode.Mania:
Buttons = new ModButton[] Buttons = new ModButton[]
{ {
keyButton = new ModButton KeyButton = new ModButton
{ {
ToggleKey = Key.Z, ToggleKey = Key.Z,
Mods = new Mod[] Mods = new Mod[]
@ -187,7 +125,7 @@ namespace osu.Game
new ModKey3(), new ModKey3(),
}, },
}, },
coopButton = new ModButton CoopButton = new ModButton
{ {
ToggleKey = Key.X, ToggleKey = Key.X,
Mods = new Mod[] Mods = new Mod[]
@ -195,7 +133,7 @@ namespace osu.Game
new ModKeyCoop(), new ModKeyCoop(),
}, },
}, },
randomButton = new ModButton RandomButton = new ModButton
{ {
ToggleKey = Key.C, ToggleKey = Key.C,
Mods = new Mod[] Mods = new Mod[]
@ -203,7 +141,7 @@ namespace osu.Game
new ModRandom(), new ModRandom(),
}, },
}, },
autoplayCinemaButton = new ModButton AutoplayCinemaButton = new ModButton
{ {
ToggleKey = Key.V, ToggleKey = Key.V,
Mods = new Mod[] Mods = new Mod[]

View File

@ -2,6 +2,7 @@
// 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.Linq;
using OpenTK; using OpenTK;
using OpenTK.Graphics; using OpenTK.Graphics;
using OpenTK.Input; using OpenTK.Input;
@ -22,13 +23,7 @@ namespace osu.Game.Overlays.Mods
public class ModButton : FlowContainer public class ModButton : FlowContainer
{ {
private ModIcon[] icons; private ModIcon[] icons;
private ModIcon displayIcon private ModIcon displayIcon => icons[icons.Length - 1];
{
get
{
return icons[icons.Length - 1];
}
}
private SpriteText text; private SpriteText text;
private Container iconsContainer; private Container iconsContainer;
private SampleChannel sampleOn, sampleOff; private SampleChannel sampleOn, sampleOff;
@ -69,13 +64,7 @@ namespace osu.Game.Overlays.Mods
} }
} }
public bool Selected public bool Selected => selectedMod != -1;
{
get
{
return selectedMod != -1;
}
}
private Color4 backgroundColour; private Color4 backgroundColour;
public new Color4 Colour public new Color4 Colour
@ -129,20 +118,7 @@ namespace osu.Game.Overlays.Mods
} }
} }
public Mod SelectedMod public Mod SelectedMod => Mods.ElementAtOrDefault(selectedMod);
{
get
{
if (selectedMod >= 0)
{
return Mods[selectedMod];
}
else
{
return null;
}
}
}
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(AudioManager audio) private void load(AudioManager audio)

View File

@ -23,13 +23,7 @@ namespace osu.Game.Overlays.Mods
private OsuSpriteText headerLabel; private OsuSpriteText headerLabel;
private AlwaysPresentFlowContainer buttonsContainer; private AlwaysPresentFlowContainer buttonsContainer;
public FlowContainer ButtonsContainer public FlowContainer ButtonsContainer => buttonsContainer;
{
get
{
return buttonsContainer;
}
}
public Action<Mod> Action; public Action<Mod> Action;

View File

@ -21,7 +21,7 @@ namespace osu.Game.Overlays.Options.Sections.Graphics
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Fullscreen mode", LabelText = "Fullscreen mode",
//Bindable = config.GetBindable<bool>(FrameworkConfig.Fullscreen), Bindable = config.GetBindable<bool>(FrameworkConfig.Fullscreen),
}, },
new OsuCheckbox new OsuCheckbox
{ {