Skip to content

Commit

Permalink
Rename parameter to be more clear
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed Nov 28, 2024
1 parent 238a1ce commit 4d9d5ad
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
16 changes: 8 additions & 8 deletions osu.Game/Screens/Edit/Setup/FormBeatmapFileSelector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ namespace osu.Game.Screens.Edit.Setup
/// </remarks>
public partial class FormBeatmapFileSelector : FormFileSelector
{
private readonly bool multipleDifficulties;
private readonly bool beatmapHasMultipleDifficulties;

public readonly Bindable<bool> ApplyToAllDifficulties = new Bindable<bool>(true);

public FormBeatmapFileSelector(bool multipleDifficulties, params string[] handledExtensions)
public FormBeatmapFileSelector(bool beatmapHasMultipleDifficulties, params string[] handledExtensions)
: base(handledExtensions)
{
this.multipleDifficulties = multipleDifficulties;
this.beatmapHasMultipleDifficulties = beatmapHasMultipleDifficulties;
}

protected override FileChooserPopover CreatePopover(string[] handledExtensions, Bindable<FileInfo?> current, string? chooserPath)
{
var popover = new BeatmapFileChooserPopover(handledExtensions, current, chooserPath, multipleDifficulties);
var popover = new BeatmapFileChooserPopover(handledExtensions, current, chooserPath, beatmapHasMultipleDifficulties);

popover.ApplyToAllDifficulties.ValueChanged += v =>
{
Expand All @@ -52,16 +52,16 @@ protected override FileChooserPopover CreatePopover(string[] handledExtensions,

private partial class BeatmapFileChooserPopover : FileChooserPopover
{
private readonly bool multipleDifficulties;
private readonly bool beatmapHasMultipleDifficulties;

public readonly Bindable<bool?> ApplyToAllDifficulties = new Bindable<bool?>();

private Container changeScopeContainer = null!;

public BeatmapFileChooserPopover(string[] handledExtensions, Bindable<FileInfo?> current, string? chooserPath, bool multipleDifficulties)
public BeatmapFileChooserPopover(string[] handledExtensions, Bindable<FileInfo?> current, string? chooserPath, bool beatmapHasMultipleDifficulties)
: base(handledExtensions, current, chooserPath)
{
this.multipleDifficulties = multipleDifficulties;
this.beatmapHasMultipleDifficulties = beatmapHasMultipleDifficulties;
}

[BackgroundDependencyLoader]
Expand Down Expand Up @@ -142,7 +142,7 @@ protected override void LoadComplete()

protected override void OnFileSelected(FileInfo file)
{
if (multipleDifficulties)
if (beatmapHasMultipleDifficulties)
changeScopeContainer.FadeIn(200, Easing.InQuint);
else
base.OnFileSelected(file);
Expand Down
6 changes: 3 additions & 3 deletions osu.Game/Screens/Edit/Setup/ResourcesSection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ private void load()
Height = 110,
};

bool multipleDifficulties = working.Value.BeatmapSetInfo.Beatmaps.Count > 1;
bool beatmapHasMultipleDifficulties = working.Value.BeatmapSetInfo.Beatmaps.Count > 1;

Children = new Drawable[]
{
backgroundChooser = new FormBeatmapFileSelector(multipleDifficulties, ".jpg", ".jpeg", ".png")
backgroundChooser = new FormBeatmapFileSelector(beatmapHasMultipleDifficulties, ".jpg", ".jpeg", ".png")
{
Caption = GameplaySettingsStrings.BackgroundHeader,
PlaceholderText = EditorSetupStrings.ClickToSelectBackground,
},
audioTrackChooser = new FormBeatmapFileSelector(multipleDifficulties, ".mp3", ".ogg")
audioTrackChooser = new FormBeatmapFileSelector(beatmapHasMultipleDifficulties, ".mp3", ".ogg")
{
Caption = EditorSetupStrings.AudioTrack,
PlaceholderText = EditorSetupStrings.ClickToSelectTrack,
Expand Down

0 comments on commit 4d9d5ad

Please sign in to comment.