mirror of
https://github.com/ppy/osu.git
synced 2025-01-19 12:22:57 +08:00
Rename property and add xmldoc
This commit is contained in:
parent
2d4f390372
commit
5a5f3af27d
@ -20,7 +20,9 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
public class OsuModRelax : ModRelax, IUpdatableByPlayfield, IApplicableToDrawableRuleset<OsuHitObject>, IApplicableToPlayer
|
public class OsuModRelax : ModRelax, IUpdatableByPlayfield, IApplicableToDrawableRuleset<OsuHitObject>, IApplicableToPlayer
|
||||||
{
|
{
|
||||||
public override LocalisableString Description => @"You don't need to click. Give your clicking/tapping fingers a break from the heat of things.";
|
public override LocalisableString Description => @"You don't need to click. Give your clicking/tapping fingers a break from the heat of things.";
|
||||||
public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModAutopilot), typeof(OsuModMagnetised), typeof(OsuModAlternate), typeof(OsuModSingleTap) }).ToArray();
|
|
||||||
|
public override Type[] IncompatibleMods =>
|
||||||
|
base.IncompatibleMods.Concat(new[] { typeof(OsuModAutopilot), typeof(OsuModMagnetised), typeof(OsuModAlternate), typeof(OsuModSingleTap) }).ToArray();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// How early before a hitobject's start time to trigger a hit.
|
/// How early before a hitobject's start time to trigger a hit.
|
||||||
@ -51,7 +53,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
osuInputManager.AllowUserPresses = false;
|
osuInputManager.AllowGameplayInputs = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Update(Playfield playfield)
|
public void Update(Playfield playfield)
|
||||||
|
@ -19,9 +19,16 @@ namespace osu.Game.Rulesets.Osu
|
|||||||
{
|
{
|
||||||
public IEnumerable<OsuAction> PressedActions => KeyBindingContainer.PressedActions;
|
public IEnumerable<OsuAction> PressedActions => KeyBindingContainer.PressedActions;
|
||||||
|
|
||||||
public bool AllowUserPresses
|
/// <summary>
|
||||||
|
/// Whether gameplay input buttons should be allowed.
|
||||||
|
/// Defaults to <c>true</c>, generally used for mods like Relax which turn off main inputs.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Of note, auxiliary inputs like the "smoke" key are left usable.
|
||||||
|
/// </remarks>
|
||||||
|
public bool AllowGameplayInputs
|
||||||
{
|
{
|
||||||
set => ((OsuKeyBindingContainer)KeyBindingContainer).AllowUserPresses = value;
|
set => ((OsuKeyBindingContainer)KeyBindingContainer).AllowGameplayInputs = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -60,14 +67,21 @@ namespace osu.Game.Rulesets.Osu
|
|||||||
|
|
||||||
private class OsuKeyBindingContainer : RulesetKeyBindingContainer
|
private class OsuKeyBindingContainer : RulesetKeyBindingContainer
|
||||||
{
|
{
|
||||||
private bool allowUserPresses = true;
|
private bool allowGameplayInputs = true;
|
||||||
|
|
||||||
public bool AllowUserPresses
|
/// <summary>
|
||||||
|
/// Whether gameplay input buttons should be allowed.
|
||||||
|
/// Defaults to <c>true</c>, generally used for mods like Relax which turn off main inputs.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Of note, auxiliary inputs like the "smoke" key are left usable.
|
||||||
|
/// </remarks>
|
||||||
|
public bool AllowGameplayInputs
|
||||||
{
|
{
|
||||||
get => allowUserPresses;
|
get => allowGameplayInputs;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
allowUserPresses = value;
|
allowGameplayInputs = value;
|
||||||
ReloadMappings();
|
ReloadMappings();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -81,7 +95,7 @@ namespace osu.Game.Rulesets.Osu
|
|||||||
{
|
{
|
||||||
base.ReloadMappings(realmKeyBindings);
|
base.ReloadMappings(realmKeyBindings);
|
||||||
|
|
||||||
if (!AllowUserPresses)
|
if (!AllowGameplayInputs)
|
||||||
KeyBindings = KeyBindings.Where(b => b.GetAction<OsuAction>() == OsuAction.Smoke).ToList();
|
KeyBindings = KeyBindings.Where(b => b.GetAction<OsuAction>() == OsuAction.Smoke).ToList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user