1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 11:20:04 +08:00

Taiko judgement snapping is now configurable by the user

It was previously controlled by Classic mod
This commit is contained in:
OpenSauce04 2024-02-01 14:20:26 +00:00 committed by OpenSauce
parent 82b2edd4b7
commit a29de846c7
5 changed files with 20 additions and 18 deletions

View File

@ -18,11 +18,13 @@ namespace osu.Game.Rulesets.Taiko.Configuration
base.InitialiseDefaults();
SetDefault(TaikoRulesetSetting.TouchControlScheme, TaikoTouchControlScheme.KDDK);
SetDefault(TaikoRulesetSetting.SnapJudgementLocation, false);
}
}
public enum TaikoRulesetSetting
{
TouchControlScheme
TouchControlScheme,
SnapJudgementLocation
}
}

View File

@ -10,18 +10,12 @@ using osu.Game.Rulesets.UI;
namespace osu.Game.Rulesets.Taiko.Mods
{
public class TaikoModClassic : ModClassic, IApplicableToDrawableRuleset<TaikoHitObject>, IApplicableToDrawableHitObject
public class TaikoModClassic : ModClassic, IApplicableToDrawableRuleset<TaikoHitObject>
{
public void ApplyToDrawableRuleset(DrawableRuleset<TaikoHitObject> drawableRuleset)
{
var drawableTaikoRuleset = (DrawableTaikoRuleset)drawableRuleset;
drawableTaikoRuleset.LockPlayfieldAspectRange.Value = false;
}
public void ApplyToDrawableHitObject(DrawableHitObject drawable)
{
if (drawable is DrawableTaikoHitObject hit)
hit.SnapJudgementLocation = true;
}
}
}

View File

@ -7,12 +7,14 @@ using System;
using System.Diagnostics;
using System.Linq;
using JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Input.Events;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.Taiko.Skinning.Default;
using osu.Game.Rulesets.Taiko.Configuration;
using osu.Game.Skinning;
namespace osu.Game.Rulesets.Taiko.Objects.Drawables
@ -39,6 +41,8 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
private readonly Bindable<HitType> type = new Bindable<HitType>();
private readonly Bindable<bool> snapJudgementLocation = new Bindable<bool>();
public DrawableHit()
: this(null)
{
@ -50,6 +54,12 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
FillMode = FillMode.Fit;
}
[BackgroundDependencyLoader(true)]
private void load(TaikoRulesetConfigManager rulesetConfig)
{
rulesetConfig?.BindWith(TaikoRulesetSetting.SnapJudgementLocation, snapJudgementLocation);
}
protected override void OnApply()
{
type.BindTo(HitObject.TypeBindable);
@ -163,7 +173,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
const float gravity_time = 300;
const float gravity_travel_height = 200;
if (SnapJudgementLocation)
if (snapJudgementLocation.Value)
MainPiece.MoveToX(-X);
this.ScaleTo(0.8f, gravity_time * 2, Easing.OutQuad);

View File

@ -25,15 +25,6 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
private readonly Container nonProxiedContent;
/// <summary>
/// Whether the location of the hit should be snapped to the hit target before animating.
/// </summary>
/// <remarks>
/// This is how osu-stable worked, but notably is not how TnT works.
/// Not snapping results in less visual feedback on hit accuracy.
/// </remarks>
public bool SnapJudgementLocation { get; set; }
protected DrawableTaikoHitObject([CanBeNull] TaikoHitObject hitObject)
: base(hitObject)
{

View File

@ -30,6 +30,11 @@ namespace osu.Game.Rulesets.Taiko
{
LabelText = RulesetSettingsStrings.TouchControlScheme,
Current = config.GetBindable<TaikoTouchControlScheme>(TaikoRulesetSetting.TouchControlScheme)
},
new SettingsCheckbox
{
LabelText = "Snap notes to judgement location",
Current = config.GetBindable<bool>(TaikoRulesetSetting.SnapJudgementLocation),
}
};
}