Skip to content

Commit

Permalink
Merge pull request #234 from taulazer/increase-slider-count
Browse files Browse the repository at this point in the history
  • Loading branch information
naoei authored Nov 15, 2021
2 parents 7b9cc74 + 498f11a commit 7f9e3b3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion osu.Game.Rulesets.Tau/Beatmaps/TauBeatmapConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class TauBeatmapConverter : BeatmapConverter<TauHitObject>

public bool CanConvertToSliders = true;
public bool CanConvertToHardBeats = true;
public int SliderDivisionLevel = 4;

public TauBeatmapConverter(IBeatmap beatmap, Ruleset ruleset)
: base(beatmap, ruleset)
Expand All @@ -38,7 +39,7 @@ protected override IEnumerable<TauHitObject> ConvertHitObject(HitObject original
if (!CanConvertToSliders)
goto default;

if (pathData.Duration < IBeatmapDifficultyInfo.DifficultyRange(Beatmap.BeatmapInfo.BaseDifficulty.ApproachRate, 1800, 1200, 450) / 2)
if (pathData.Duration < IBeatmapDifficultyInfo.DifficultyRange(Beatmap.BeatmapInfo.BaseDifficulty.ApproachRate, 1800, 1200, 450) / SliderDivisionLevel)
goto default;

var nodes = new List<SliderNode>();
Expand Down
8 changes: 8 additions & 0 deletions osu.Game.Rulesets.Tau/Mods/TauModLite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using osu.Game.Configuration;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Tau.Beatmaps;
using osu.Game.Screens.Edit;

namespace osu.Game.Rulesets.Tau.Mods
{
Expand All @@ -22,12 +23,19 @@ public class TauModLite : Mod, IApplicableToBeatmapConverter
[SettingSource("No hard beats conversion", "Completely disables hard beats altogether.")]
public Bindable<bool> ToggleHardBeats { get; } = new Bindable<bool>(true);

[SettingSource("Slider division level", "The minimum slider length divisor.")]
public BindableBeatDivisor SlidersDivisionLevel { get; } = new BindableBeatDivisor
{
Default = 2
};

public void ApplyToBeatmapConverter(IBeatmapConverter beatmapConverter)
{
var converter = (TauBeatmapConverter)beatmapConverter;

converter.CanConvertToSliders = !ToggleSliders.Value;
converter.CanConvertToHardBeats = !ToggleHardBeats.Value;
converter.SliderDivisionLevel = SlidersDivisionLevel.Value;
}
}
}

0 comments on commit 7f9e3b3

Please sign in to comment.