mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 10:33:30 +08:00
Fix "key count" setting showing as "circle size" in osu!mania editor
Closes https://github.com/ppy/osu/issues/12904.
This commit is contained in:
parent
c77d3cd6bd
commit
fd2bdc10c7
19
osu.Game.Rulesets.Mania/Edit/Setup/ManiaDifficultySection.cs
Normal file
19
osu.Game.Rulesets.Mania/Edit/Setup/ManiaDifficultySection.cs
Normal file
@ -0,0 +1,19 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Game.Resources.Localisation.Web;
|
||||
using osu.Game.Screens.Edit.Setup;
|
||||
|
||||
namespace osu.Game.Rulesets.Mania.Edit.Setup
|
||||
{
|
||||
public partial class ManiaDifficultySection : DifficultySection
|
||||
{
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
CircleSizeSlider.Label = BeatmapsetsStrings.ShowStatsCsMania;
|
||||
CircleSizeSlider.Description = "The number of columns in the beatmap";
|
||||
}
|
||||
}
|
||||
}
|
@ -425,6 +425,8 @@ namespace osu.Game.Rulesets.Mania
|
||||
}
|
||||
|
||||
public override RulesetSetupSection CreateEditorSetupSection() => new ManiaSetupSection();
|
||||
|
||||
public override DifficultySection CreateEditorDifficultySection() => new ManiaDifficultySection();
|
||||
}
|
||||
|
||||
public enum PlayfieldType
|
||||
|
@ -384,5 +384,10 @@ namespace osu.Game.Rulesets
|
||||
/// Can be overridden to add a ruleset-specific section to the editor beatmap setup screen.
|
||||
/// </summary>
|
||||
public virtual RulesetSetupSection? CreateEditorSetupSection() => null;
|
||||
|
||||
/// <summary>
|
||||
/// Can be overridden to alter the difficulty section to the editor beatmap setup screen.
|
||||
/// </summary>
|
||||
public virtual DifficultySection? CreateEditorDifficultySection() => null;
|
||||
}
|
||||
}
|
||||
|
@ -13,14 +13,14 @@ using osu.Game.Localisation;
|
||||
|
||||
namespace osu.Game.Screens.Edit.Setup
|
||||
{
|
||||
internal partial class DifficultySection : SetupSection
|
||||
public partial class DifficultySection : SetupSection
|
||||
{
|
||||
private LabelledSliderBar<float> circleSizeSlider = null!;
|
||||
private LabelledSliderBar<float> healthDrainSlider = null!;
|
||||
private LabelledSliderBar<float> approachRateSlider = null!;
|
||||
private LabelledSliderBar<float> overallDifficultySlider = null!;
|
||||
private LabelledSliderBar<double> baseVelocitySlider = null!;
|
||||
private LabelledSliderBar<double> tickRateSlider = null!;
|
||||
protected LabelledSliderBar<float> CircleSizeSlider = null!;
|
||||
protected LabelledSliderBar<float> HealthDrainSlider = null!;
|
||||
protected LabelledSliderBar<float> ApproachRateSlider = null!;
|
||||
protected LabelledSliderBar<float> OverallDifficultySlider = null!;
|
||||
protected LabelledSliderBar<double> BaseVelocitySlider = null!;
|
||||
protected LabelledSliderBar<double> TickRateSlider = null!;
|
||||
|
||||
public override LocalisableString Title => EditorSetupStrings.DifficultyHeader;
|
||||
|
||||
@ -29,7 +29,7 @@ namespace osu.Game.Screens.Edit.Setup
|
||||
{
|
||||
Children = new Drawable[]
|
||||
{
|
||||
circleSizeSlider = new LabelledSliderBar<float>
|
||||
CircleSizeSlider = new LabelledSliderBar<float>
|
||||
{
|
||||
Label = BeatmapsetsStrings.ShowStatsCs,
|
||||
FixedLabelWidth = LABEL_WIDTH,
|
||||
@ -42,7 +42,7 @@ namespace osu.Game.Screens.Edit.Setup
|
||||
Precision = 0.1f,
|
||||
}
|
||||
},
|
||||
healthDrainSlider = new LabelledSliderBar<float>
|
||||
HealthDrainSlider = new LabelledSliderBar<float>
|
||||
{
|
||||
Label = BeatmapsetsStrings.ShowStatsDrain,
|
||||
FixedLabelWidth = LABEL_WIDTH,
|
||||
@ -55,7 +55,7 @@ namespace osu.Game.Screens.Edit.Setup
|
||||
Precision = 0.1f,
|
||||
}
|
||||
},
|
||||
approachRateSlider = new LabelledSliderBar<float>
|
||||
ApproachRateSlider = new LabelledSliderBar<float>
|
||||
{
|
||||
Label = BeatmapsetsStrings.ShowStatsAr,
|
||||
FixedLabelWidth = LABEL_WIDTH,
|
||||
@ -68,7 +68,7 @@ namespace osu.Game.Screens.Edit.Setup
|
||||
Precision = 0.1f,
|
||||
}
|
||||
},
|
||||
overallDifficultySlider = new LabelledSliderBar<float>
|
||||
OverallDifficultySlider = new LabelledSliderBar<float>
|
||||
{
|
||||
Label = BeatmapsetsStrings.ShowStatsAccuracy,
|
||||
FixedLabelWidth = LABEL_WIDTH,
|
||||
@ -81,7 +81,7 @@ namespace osu.Game.Screens.Edit.Setup
|
||||
Precision = 0.1f,
|
||||
}
|
||||
},
|
||||
baseVelocitySlider = new LabelledSliderBar<double>
|
||||
BaseVelocitySlider = new LabelledSliderBar<double>
|
||||
{
|
||||
Label = EditorSetupStrings.BaseVelocity,
|
||||
FixedLabelWidth = LABEL_WIDTH,
|
||||
@ -94,7 +94,7 @@ namespace osu.Game.Screens.Edit.Setup
|
||||
Precision = 0.01f,
|
||||
}
|
||||
},
|
||||
tickRateSlider = new LabelledSliderBar<double>
|
||||
TickRateSlider = new LabelledSliderBar<double>
|
||||
{
|
||||
Label = EditorSetupStrings.TickRate,
|
||||
FixedLabelWidth = LABEL_WIDTH,
|
||||
@ -120,12 +120,12 @@ namespace osu.Game.Screens.Edit.Setup
|
||||
{
|
||||
// for now, update these on commit rather than making BeatmapMetadata bindables.
|
||||
// after switching database engines we can reconsider if switching to bindables is a good direction.
|
||||
Beatmap.Difficulty.CircleSize = circleSizeSlider.Current.Value;
|
||||
Beatmap.Difficulty.DrainRate = healthDrainSlider.Current.Value;
|
||||
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.Difficulty.CircleSize = CircleSizeSlider.Current.Value;
|
||||
Beatmap.Difficulty.DrainRate = HealthDrainSlider.Current.Value;
|
||||
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();
|
||||
|
@ -26,16 +26,18 @@ namespace osu.Game.Screens.Edit.Setup
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(EditorBeatmap beatmap, OverlayColourProvider colourProvider)
|
||||
{
|
||||
var ruleset = beatmap.BeatmapInfo.Ruleset.CreateInstance();
|
||||
|
||||
var sectionsEnumerable = new List<SetupSection>
|
||||
{
|
||||
new ResourcesSection(),
|
||||
new MetadataSection(),
|
||||
new DifficultySection(),
|
||||
ruleset.CreateEditorDifficultySection() ?? new DifficultySection(),
|
||||
new ColoursSection(),
|
||||
new DesignSection(),
|
||||
};
|
||||
|
||||
var rulesetSpecificSection = beatmap.BeatmapInfo.Ruleset.CreateInstance().CreateEditorSetupSection();
|
||||
var rulesetSpecificSection = ruleset.CreateEditorSetupSection();
|
||||
if (rulesetSpecificSection != null)
|
||||
sectionsEnumerable.Add(rulesetSpecificSection);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user