Skip to content

Commit

Permalink
Fix too many buttons inside condition
Browse files Browse the repository at this point in the history
  • Loading branch information
smoogipoo authored and peppy committed Jun 22, 2022
1 parent 321920b commit ff440fc
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 38 deletions.
74 changes: 37 additions & 37 deletions osu.Game/Overlays/Settings/Sections/Maintenance/BeatmapSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,54 +35,54 @@ private void load(BeatmapManager beatmaps, LegacyImportManager? legacyImportMana
legacyImportManager.ImportFromStableAsync(StableContent.Beatmaps).ContinueWith(t => Schedule(() => importBeatmapsButton.Enabled.Value = true));
}
});
}

Add(deleteBeatmapsButton = new DangerousSettingsButton
Add(deleteBeatmapsButton = new DangerousSettingsButton
{
Text = MaintenanceSettingsStrings.DeleteAllBeatmaps,
Action = () =>
{
Text = MaintenanceSettingsStrings.DeleteAllBeatmaps,
Action = () =>
dialogOverlay?.Push(new MassDeleteConfirmationDialog(() =>
{
dialogOverlay?.Push(new MassDeleteConfirmationDialog(() =>
{
deleteBeatmapsButton.Enabled.Value = false;
Task.Run(() => beatmaps.Delete()).ContinueWith(t => Schedule(() => deleteBeatmapsButton.Enabled.Value = true));
}));
}
});
deleteBeatmapsButton.Enabled.Value = false;
Task.Run(() => beatmaps.Delete()).ContinueWith(t => Schedule(() => deleteBeatmapsButton.Enabled.Value = true));
}));
}
});

Add(deleteBeatmapVideosButton = new DangerousSettingsButton
Add(deleteBeatmapVideosButton = new DangerousSettingsButton
{
Text = MaintenanceSettingsStrings.DeleteAllBeatmapVideos,
Action = () =>
{
dialogOverlay?.Push(new MassVideoDeleteConfirmationDialog(() =>
{
deleteBeatmapVideosButton.Enabled.Value = false;
Task.Run(beatmaps.DeleteAllVideos).ContinueWith(t => Schedule(() => deleteBeatmapVideosButton.Enabled.Value = true));
}));
}
});
AddRange(new Drawable[]
{
restoreButton = new SettingsButton
{
Text = MaintenanceSettingsStrings.DeleteAllBeatmapVideos,
Text = MaintenanceSettingsStrings.RestoreAllHiddenDifficulties,
Action = () =>
{
dialogOverlay?.Push(new MassVideoDeleteConfirmationDialog(() =>
{
deleteBeatmapVideosButton.Enabled.Value = false;
Task.Run(beatmaps.DeleteAllVideos).ContinueWith(t => Schedule(() => deleteBeatmapVideosButton.Enabled.Value = true));
}));
restoreButton.Enabled.Value = false;
Task.Run(beatmaps.RestoreAll).ContinueWith(t => Schedule(() => restoreButton.Enabled.Value = true));
}
});
AddRange(new Drawable[]
},
undeleteButton = new SettingsButton
{
restoreButton = new SettingsButton
{
Text = MaintenanceSettingsStrings.RestoreAllHiddenDifficulties,
Action = () =>
{
restoreButton.Enabled.Value = false;
Task.Run(beatmaps.RestoreAll).ContinueWith(t => Schedule(() => restoreButton.Enabled.Value = true));
}
},
undeleteButton = new SettingsButton
Text = MaintenanceSettingsStrings.RestoreAllRecentlyDeletedBeatmaps,
Action = () =>
{
Text = MaintenanceSettingsStrings.RestoreAllRecentlyDeletedBeatmaps,
Action = () =>
{
undeleteButton.Enabled.Value = false;
Task.Run(beatmaps.UndeleteAll).ContinueWith(t => Schedule(() => undeleteButton.Enabled.Value = true));
}
undeleteButton.Enabled.Value = false;
Task.Run(beatmaps.UndeleteAll).ContinueWith(t => Schedule(() => undeleteButton.Enabled.Value = true));
}
});
}
}
});
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ private void load(CollectionManager? collectionManager, LegacyImportManager? leg
if (collectionManager == null) return;

if (legacyImportManager?.SupportsImportFromStable == true)

{
Add(importCollectionsButton = new SettingsButton
{
Expand Down

0 comments on commit ff440fc

Please sign in to comment.