mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 20:22:55 +08:00
Merge pull request #23434 from peppy/tick-rate-adjust
Add the ability to change the beatmap tick rate in the editor
This commit is contained in:
commit
6604b9f1e7
@ -384,11 +384,11 @@ namespace osu.Game.Beatmaps.Formats
|
||||
break;
|
||||
|
||||
case @"SliderMultiplier":
|
||||
difficulty.SliderMultiplier = Parsing.ParseDouble(pair.Value);
|
||||
difficulty.SliderMultiplier = Math.Clamp(Parsing.ParseDouble(pair.Value), 0.4, 3.6);
|
||||
break;
|
||||
|
||||
case @"SliderTickRate":
|
||||
difficulty.SliderTickRate = Parsing.ParseDouble(pair.Value);
|
||||
difficulty.SliderTickRate = Math.Clamp(Parsing.ParseDouble(pair.Value), 0.5, 8);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -42,8 +42,7 @@ namespace osu.Game.Localisation
|
||||
/// <summary>
|
||||
/// "If enabled, an "Are you ready? 3, 2, 1, GO!" countdown will be inserted at the beginning of the beatmap, assuming there is enough time to do so."
|
||||
/// </summary>
|
||||
public static LocalisableString CountdownDescription => new TranslatableString(getKey(@"countdown_description"),
|
||||
@"If enabled, an ""Are you ready? 3, 2, 1, GO!"" countdown will be inserted at the beginning of the beatmap, assuming there is enough time to do so.");
|
||||
public static LocalisableString CountdownDescription => new TranslatableString(getKey(@"countdown_description"), @"If enabled, an ""Are you ready? 3, 2, 1, GO!"" countdown will be inserted at the beginning of the beatmap, assuming there is enough time to do so.");
|
||||
|
||||
/// <summary>
|
||||
/// "Countdown speed"
|
||||
@ -53,8 +52,7 @@ namespace osu.Game.Localisation
|
||||
/// <summary>
|
||||
/// "If the countdown sounds off-time, use this to make it appear one or more beats early."
|
||||
/// </summary>
|
||||
public static LocalisableString CountdownOffsetDescription =>
|
||||
new TranslatableString(getKey(@"countdown_offset_description"), @"If the countdown sounds off-time, use this to make it appear one or more beats early.");
|
||||
public static LocalisableString CountdownOffsetDescription => new TranslatableString(getKey(@"countdown_offset_description"), @"If the countdown sounds off-time, use this to make it appear one or more beats early.");
|
||||
|
||||
/// <summary>
|
||||
/// "Countdown offset"
|
||||
@ -69,8 +67,7 @@ namespace osu.Game.Localisation
|
||||
/// <summary>
|
||||
/// "Allows storyboards to use the full screen space, rather than be confined to a 4:3 area."
|
||||
/// </summary>
|
||||
public static LocalisableString WidescreenSupportDescription =>
|
||||
new TranslatableString(getKey(@"widescreen_support_description"), @"Allows storyboards to use the full screen space, rather than be confined to a 4:3 area.");
|
||||
public static LocalisableString WidescreenSupportDescription => new TranslatableString(getKey(@"widescreen_support_description"), @"Allows storyboards to use the full screen space, rather than be confined to a 4:3 area.");
|
||||
|
||||
/// <summary>
|
||||
/// "Epilepsy warning"
|
||||
@ -80,8 +77,7 @@ namespace osu.Game.Localisation
|
||||
/// <summary>
|
||||
/// "Recommended if the storyboard or video contain scenes with rapidly flashing colours."
|
||||
/// </summary>
|
||||
public static LocalisableString EpilepsyWarningDescription =>
|
||||
new TranslatableString(getKey(@"epilepsy_warning_description"), @"Recommended if the storyboard or video contain scenes with rapidly flashing colours.");
|
||||
public static LocalisableString EpilepsyWarningDescription => new TranslatableString(getKey(@"epilepsy_warning_description"), @"Recommended if the storyboard or video contain scenes with rapidly flashing colours.");
|
||||
|
||||
/// <summary>
|
||||
/// "Letterbox during breaks"
|
||||
@ -91,8 +87,7 @@ namespace osu.Game.Localisation
|
||||
/// <summary>
|
||||
/// "Adds horizontal letterboxing to give a cinematic look during breaks."
|
||||
/// </summary>
|
||||
public static LocalisableString LetterboxDuringBreaksDescription =>
|
||||
new TranslatableString(getKey(@"letterbox_during_breaks_description"), @"Adds horizontal letterboxing to give a cinematic look during breaks.");
|
||||
public static LocalisableString LetterboxDuringBreaksDescription => new TranslatableString(getKey(@"letterbox_during_breaks_description"), @"Adds horizontal letterboxing to give a cinematic look during breaks.");
|
||||
|
||||
/// <summary>
|
||||
/// "Samples match playback rate"
|
||||
@ -102,8 +97,7 @@ namespace osu.Game.Localisation
|
||||
/// <summary>
|
||||
/// "When enabled, all samples will speed up or slow down when rate-changing mods are enabled."
|
||||
/// </summary>
|
||||
public static LocalisableString SamplesMatchPlaybackRateDescription => new TranslatableString(getKey(@"samples_match_playback_rate_description"),
|
||||
@"When enabled, all samples will speed up or slow down when rate-changing mods are enabled.");
|
||||
public static LocalisableString SamplesMatchPlaybackRateDescription => new TranslatableString(getKey(@"samples_match_playback_rate_description"), @"When enabled, all samples will speed up or slow down when rate-changing mods are enabled.");
|
||||
|
||||
/// <summary>
|
||||
/// "The size of all hit objects"
|
||||
@ -123,8 +117,17 @@ namespace osu.Game.Localisation
|
||||
/// <summary>
|
||||
/// "The harshness of hit windows and difficulty of special objects (ie. spinners)"
|
||||
/// </summary>
|
||||
public static LocalisableString OverallDifficultyDescription =>
|
||||
new TranslatableString(getKey(@"overall_difficulty_description"), @"The harshness of hit windows and difficulty of special objects (ie. spinners)");
|
||||
public static LocalisableString OverallDifficultyDescription => new TranslatableString(getKey(@"overall_difficulty_description"), @"The harshness of hit windows and difficulty of special objects (ie. spinners)");
|
||||
|
||||
/// <summary>
|
||||
/// "Tick Rate"
|
||||
/// </summary>
|
||||
public static LocalisableString TickRate => new TranslatableString(getKey(@"tick_rate"), @"Tick Rate");
|
||||
|
||||
/// <summary>
|
||||
/// "Determines how many "ticks" are generated within long hit objects. A tick rate of 1 will generate ticks on each beat, 2 would be twice per beat, etc."
|
||||
/// </summary>
|
||||
public static LocalisableString TickRateDescription => new TranslatableString(getKey(@"tick_rate_description"), @"Determines how many ""ticks"" are generated within long hit objects. A tick rate of 1 will generate ticks on each beat, 2 would be twice per beat, etc.");
|
||||
|
||||
/// <summary>
|
||||
/// "Base Velocity"
|
||||
|
@ -20,6 +20,7 @@ namespace osu.Game.Screens.Edit.Setup
|
||||
private LabelledSliderBar<float> approachRateSlider = null!;
|
||||
private LabelledSliderBar<float> overallDifficultySlider = null!;
|
||||
private LabelledSliderBar<double> baseVelocitySlider = null!;
|
||||
private LabelledSliderBar<double> tickRateSlider = null!;
|
||||
|
||||
public override LocalisableString Title => EditorSetupStrings.DifficultyHeader;
|
||||
|
||||
@ -93,6 +94,19 @@ namespace osu.Game.Screens.Edit.Setup
|
||||
Precision = 0.01f,
|
||||
}
|
||||
},
|
||||
tickRateSlider = new LabelledSliderBar<double>
|
||||
{
|
||||
Label = EditorSetupStrings.TickRate,
|
||||
FixedLabelWidth = LABEL_WIDTH,
|
||||
Description = EditorSetupStrings.TickRateDescription,
|
||||
Current = new BindableDouble(Beatmap.Difficulty.SliderTickRate)
|
||||
{
|
||||
Default = 1,
|
||||
MinValue = 1,
|
||||
MaxValue = 4,
|
||||
Precision = 1,
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
foreach (var item in Children.OfType<LabelledSliderBar<float>>())
|
||||
@ -111,6 +125,7 @@ namespace osu.Game.Screens.Edit.Setup
|
||||
Beatmap.Difficulty.ApproachRate = approachRateSlider.Current.Value;
|
||||
Beatmap.Difficulty.OverallDifficulty = overallDifficultySlider.Current.Value;
|
||||
Beatmap.Difficulty.SliderMultiplier = baseVelocitySlider.Current.Value;
|
||||
Beatmap.Difficulty.SliderTickRate = tickRateSlider.Current.Value;
|
||||
|
||||
Beatmap.UpdateAllHitObjects();
|
||||
Beatmap.SaveState();
|
||||
|
Loading…
Reference in New Issue
Block a user