1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 10:12:54 +08:00

Rename property and add xmldoc

This commit is contained in:
Dean Herbert 2022-10-10 15:42:08 +09:00
parent 2d4f390372
commit 5a5f3af27d
2 changed files with 25 additions and 9 deletions

View File

@ -20,7 +20,9 @@ namespace osu.Game.Rulesets.Osu.Mods
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 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>
/// How early before a hitobject's start time to trigger a hit.
@ -51,7 +53,7 @@ namespace osu.Game.Rulesets.Osu.Mods
return;
}
osuInputManager.AllowUserPresses = false;
osuInputManager.AllowGameplayInputs = false;
}
public void Update(Playfield playfield)

View File

@ -19,9 +19,16 @@ namespace osu.Game.Rulesets.Osu
{
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>
@ -60,14 +67,21 @@ namespace osu.Game.Rulesets.Osu
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
{
allowUserPresses = value;
allowGameplayInputs = value;
ReloadMappings();
}
}
@ -81,7 +95,7 @@ namespace osu.Game.Rulesets.Osu
{
base.ReloadMappings(realmKeyBindings);
if (!AllowUserPresses)
if (!AllowGameplayInputs)
KeyBindings = KeyBindings.Where(b => b.GetAction<OsuAction>() == OsuAction.Smoke).ToList();
}
}