Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use spinnerbonus as the break sample #575

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ protected override void InitialiseDefaults()
SetDefault(SentakkiRulesetSettings.LaneInputMode, LaneInputMode.Button);
SetDefault(SentakkiRulesetSettings.SnakingSlideBody, true);
SetDefault(SentakkiRulesetSettings.DetailedJudgements, false);
SetDefault(SentakkiRulesetSettings.BreakSampleVolume, 1.0, 0.0, 1.0, 0.01);
}

public override TrackedSettings CreateTrackedSettings() => new TrackedSettings
Expand All @@ -50,6 +49,5 @@ public enum SentakkiRulesetSettings
LaneInputMode,
SnakingSlideBody,
DetailedJudgements,
BreakSampleVolume
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@ public static class SentakkiSettingsSubsectionStrings
public static LocalisableString LaneInputModeButton => new TranslatableString(getKey(@"lane_input_mode_button"), @"Button");
public static LocalisableString LaneInputModeSensor => new TranslatableString(getKey(@"lane_input_mode_sensor"), @"Sensor");

/// <summary>
/// "Break sample volume"
/// </summary>
public static LocalisableString BreakSampleVolume => new TranslatableString(getKey(@"break_sample_volume"), @"Break sample volume");

public static LocalisableString EntrySpeedTooltip(float speed, double time)
=> new TranslatableString(getKey(@"entry_speed_tooltip"), @"{0} ({1}ms)", speed > 10 ? Sonic : $"{speed:N2}", $"{time:N0}");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
using System;
using osu.Framework.Allocation;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.Sentakki.Configuration;
using osu.Game.Rulesets.Sentakki.UI;
using osu.Game.Skinning;

Expand All @@ -31,7 +28,7 @@ public DrawableSentakkiLanedHitObject(SentakkiLanedHitObject? hitObject)
}

[BackgroundDependencyLoader]
private void load(SentakkiRulesetConfigManager? sentakkiConfig)
private void load()
{
AddRangeInternal(new Drawable[]
{
Expand All @@ -42,8 +39,6 @@ private void load(SentakkiRulesetConfigManager? sentakkiConfig)

if (DrawableSentakkiRuleset is not null)
AnimationDuration.BindTo(DrawableSentakkiRuleset?.AdjustedAnimDuration);

sentakkiConfig?.BindWith(SentakkiRulesetSettings.BreakSampleVolume, breakSample.Volume);
}

protected override void LoadSamples()
Expand Down
25 changes: 23 additions & 2 deletions osu.Game.Rulesets.Sentakki/Objects/SentakkiLanedHitObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected override void CreateNestedHitObjects(CancellationToken cancellationTok
});
}

public override IList<HitSampleInfo> AuxiliarySamples => CreateBreakSample();
public override IList<HitSampleInfo> AuxiliarySamples => new HitSampleInfo[] { new BreakSample(CreateHitSampleInfo()) };

public HitSampleInfo[] CreateBreakSample()
{
Expand All @@ -53,8 +53,29 @@ public HitSampleInfo[] CreateBreakSample()

return new[]
{
new SentakkiHitSampleInfo("Break", CreateHitSampleInfo().Volume)
new BreakSample( CreateHitSampleInfo())
};
}

public class BreakSample : HitSampleInfo
{
public override IEnumerable<string> LookupNames
{
get
{
foreach (string name in base.LookupNames)
yield return name;

foreach (string name in base.LookupNames)
yield return name.Replace("-max", string.Empty);
}
}

public BreakSample(HitSampleInfo sampleInfo)
: base("spinnerbonus-max", sampleInfo.Bank, sampleInfo.Suffix, sampleInfo.Volume)

{
}
}
}
}
2 changes: 0 additions & 2 deletions osu.Game.Rulesets.Sentakki/Objects/Slide.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ private void createSlideBodies()
{
Lane = slideInfo.SlidePath.EndLane + Lane,
StartTime = StartTime,
// Lets remove samples from slide completions
//Samples = NodeSamples.Any() ? NodeSamples.Last() : new List<HitSampleInfo>()
});

SlideBodies.Add(body);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,6 @@
<data name="lane_input_mode_sensor" xml:space="preserve">
<value>Sensor</value>
</data>
<data name="break_sample_volume" xml:space="preserve">
<value>Break sample volume</value>
<comment>Break is a proper noun, referring to a property on laned notes.</comment>
</data>
<data name="note_entry_speed" xml:space="preserve">
<value>Note entry speed</value>
</data>
Expand Down
Binary file not shown.
Binary file not shown.
7 changes: 0 additions & 7 deletions osu.Game.Rulesets.Sentakki/UI/SentakkiSettingsSubsection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,6 @@ private void load()
LabelText = SentakkiSettingsSubsectionStrings.LaneInputMode,
Current = config.GetBindable<LaneInputMode>(SentakkiRulesetSettings.LaneInputMode)
},
new SettingsSlider<double, RoundedSliderBar<double>>
{
LabelText = SentakkiSettingsSubsectionStrings.BreakSampleVolume,
Current = config.GetBindable<double>(SentakkiRulesetSettings.BreakSampleVolume),
KeyboardStep = 0.01f,
DisplayAsPercentage = true,
}
};
}

Expand Down
Loading