1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 03:27: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
{
/// <summary>
/// The name of this mod.
/// </summary>
public abstract Mods Name { get; }
/// <summary>
/// The icon of this mod.
/// </summary>
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) => @"";
/// <summary>
/// The score multiplier of this mod for the given <see cref="PlayMode"/>
/// </summary>
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);
/// <summary>
/// The mods this mod cannot be enabled with
/// </summary>
public abstract Mods[] DisablesMods(PlayMode mode);
}

View File

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

View File

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

View File

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

View File

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