mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 19:42:55 +08:00
Move stable import buttons under "debug" section
This commit is contained in:
parent
96a100d428
commit
dbc19777e0
@ -54,11 +54,6 @@ namespace osu.Game.Localisation
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static LocalisableString RestartAndReOpenRequiredForCompletion => new TranslatableString(getKey(@"restart_and_re_open_required_for_completion"), @"To complete this operation, osu! will close. Please open it again to use the new data location.");
|
public static LocalisableString RestartAndReOpenRequiredForCompletion => new TranslatableString(getKey(@"restart_and_re_open_required_for_completion"), @"To complete this operation, osu! will close. Please open it again to use the new data location.");
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// "Import beatmaps from stable"
|
|
||||||
/// </summary>
|
|
||||||
public static LocalisableString ImportBeatmapsFromStable => new TranslatableString(getKey(@"import_beatmaps_from_stable"), @"Import beatmaps from stable");
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// "Delete ALL beatmaps"
|
/// "Delete ALL beatmaps"
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -69,31 +64,16 @@ namespace osu.Game.Localisation
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static LocalisableString DeleteAllBeatmapVideos => new TranslatableString(getKey(@"delete_all_beatmap_videos"), @"Delete ALL beatmap videos");
|
public static LocalisableString DeleteAllBeatmapVideos => new TranslatableString(getKey(@"delete_all_beatmap_videos"), @"Delete ALL beatmap videos");
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// "Import scores from stable"
|
|
||||||
/// </summary>
|
|
||||||
public static LocalisableString ImportScoresFromStable => new TranslatableString(getKey(@"import_scores_from_stable"), @"Import scores from stable");
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// "Delete ALL scores"
|
/// "Delete ALL scores"
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static LocalisableString DeleteAllScores => new TranslatableString(getKey(@"delete_all_scores"), @"Delete ALL scores");
|
public static LocalisableString DeleteAllScores => new TranslatableString(getKey(@"delete_all_scores"), @"Delete ALL scores");
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// "Import skins from stable"
|
|
||||||
/// </summary>
|
|
||||||
public static LocalisableString ImportSkinsFromStable => new TranslatableString(getKey(@"import_skins_from_stable"), @"Import skins from stable");
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// "Delete ALL skins"
|
/// "Delete ALL skins"
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static LocalisableString DeleteAllSkins => new TranslatableString(getKey(@"delete_all_skins"), @"Delete ALL skins");
|
public static LocalisableString DeleteAllSkins => new TranslatableString(getKey(@"delete_all_skins"), @"Delete ALL skins");
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// "Import collections from stable"
|
|
||||||
/// </summary>
|
|
||||||
public static LocalisableString ImportCollectionsFromStable => new TranslatableString(getKey(@"import_collections_from_stable"), @"Import collections from stable");
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// "Delete ALL collections"
|
/// "Delete ALL collections"
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
|
using osu.Framework.Development;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
@ -22,11 +23,12 @@ namespace osu.Game.Overlays.Settings.Sections
|
|||||||
|
|
||||||
public DebugSection()
|
public DebugSection()
|
||||||
{
|
{
|
||||||
Children = new Drawable[]
|
Add(new GeneralSettings());
|
||||||
{
|
|
||||||
new GeneralSettings(),
|
if (DebugUtils.IsDebugBuild)
|
||||||
new MemorySettings(),
|
Add(new BatchImportSettings());
|
||||||
};
|
|
||||||
|
Add(new MemorySettings());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,66 @@
|
|||||||
|
// 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.Framework.Localisation;
|
||||||
|
using osu.Game.Database;
|
||||||
|
|
||||||
|
namespace osu.Game.Overlays.Settings.Sections.DebugSettings
|
||||||
|
{
|
||||||
|
public partial class BatchImportSettings : SettingsSubsection
|
||||||
|
{
|
||||||
|
protected override LocalisableString Header => @"Batch Import";
|
||||||
|
|
||||||
|
private SettingsButton importBeatmapsButton = null!;
|
||||||
|
private SettingsButton importCollectionsButton = null!;
|
||||||
|
private SettingsButton importScoresButton = null!;
|
||||||
|
private SettingsButton importSkinsButton = null!;
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(LegacyImportManager? legacyImportManager)
|
||||||
|
{
|
||||||
|
if (legacyImportManager?.SupportsImportFromStable != true)
|
||||||
|
return;
|
||||||
|
|
||||||
|
AddRange(new[]
|
||||||
|
{
|
||||||
|
importBeatmapsButton = new SettingsButton
|
||||||
|
{
|
||||||
|
Text = @"Import beatmaps from stable",
|
||||||
|
Action = () =>
|
||||||
|
{
|
||||||
|
importBeatmapsButton.Enabled.Value = false;
|
||||||
|
legacyImportManager.ImportFromStableAsync(StableContent.Beatmaps).ContinueWith(_ => Schedule(() => importBeatmapsButton.Enabled.Value = true));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
importSkinsButton = new SettingsButton
|
||||||
|
{
|
||||||
|
Text = @"Import skins from stable",
|
||||||
|
Action = () =>
|
||||||
|
{
|
||||||
|
importSkinsButton.Enabled.Value = false;
|
||||||
|
legacyImportManager.ImportFromStableAsync(StableContent.Skins).ContinueWith(_ => Schedule(() => importSkinsButton.Enabled.Value = true));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
importCollectionsButton = new SettingsButton
|
||||||
|
{
|
||||||
|
Text = @"Import collections from stable",
|
||||||
|
Action = () =>
|
||||||
|
{
|
||||||
|
importCollectionsButton.Enabled.Value = false;
|
||||||
|
legacyImportManager.ImportFromStableAsync(StableContent.Collections).ContinueWith(_ => Schedule(() => importCollectionsButton.Enabled.Value = true));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
importScoresButton = new SettingsButton
|
||||||
|
{
|
||||||
|
Text = @"Import scores from stable",
|
||||||
|
Action = () =>
|
||||||
|
{
|
||||||
|
importScoresButton.Enabled.Value = false;
|
||||||
|
legacyImportManager.ImportFromStableAsync(StableContent.Scores).ContinueWith(_ => Schedule(() => importScoresButton.Enabled.Value = true));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -6,7 +6,6 @@ using osu.Framework.Allocation;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Database;
|
|
||||||
using osu.Game.Localisation;
|
using osu.Game.Localisation;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
||||||
@ -15,28 +14,14 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
|||||||
{
|
{
|
||||||
protected override LocalisableString Header => CommonStrings.Beatmaps;
|
protected override LocalisableString Header => CommonStrings.Beatmaps;
|
||||||
|
|
||||||
private SettingsButton importBeatmapsButton = null!;
|
|
||||||
private SettingsButton deleteBeatmapsButton = null!;
|
private SettingsButton deleteBeatmapsButton = null!;
|
||||||
private SettingsButton deleteBeatmapVideosButton = null!;
|
private SettingsButton deleteBeatmapVideosButton = null!;
|
||||||
private SettingsButton restoreButton = null!;
|
private SettingsButton restoreButton = null!;
|
||||||
private SettingsButton undeleteButton = null!;
|
private SettingsButton undeleteButton = null!;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(BeatmapManager beatmaps, LegacyImportManager? legacyImportManager, IDialogOverlay? dialogOverlay)
|
private void load(BeatmapManager beatmaps, IDialogOverlay? dialogOverlay)
|
||||||
{
|
{
|
||||||
if (legacyImportManager?.SupportsImportFromStable == true)
|
|
||||||
{
|
|
||||||
Add(importBeatmapsButton = new SettingsButton
|
|
||||||
{
|
|
||||||
Text = MaintenanceSettingsStrings.ImportBeatmapsFromStable,
|
|
||||||
Action = () =>
|
|
||||||
{
|
|
||||||
importBeatmapsButton.Enabled.Value = false;
|
|
||||||
legacyImportManager.ImportFromStableAsync(StableContent.Beatmaps).ContinueWith(_ => Schedule(() => importBeatmapsButton.Enabled.Value = true));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
Add(deleteBeatmapsButton = new DangerousSettingsButton
|
Add(deleteBeatmapsButton = new DangerousSettingsButton
|
||||||
{
|
{
|
||||||
Text = MaintenanceSettingsStrings.DeleteAllBeatmaps,
|
Text = MaintenanceSettingsStrings.DeleteAllBeatmaps,
|
||||||
|
@ -14,8 +14,6 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
|||||||
{
|
{
|
||||||
protected override LocalisableString Header => CommonStrings.Collections;
|
protected override LocalisableString Header => CommonStrings.Collections;
|
||||||
|
|
||||||
private SettingsButton importCollectionsButton = null!;
|
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private RealmAccess realm { get; set; } = null!;
|
private RealmAccess realm { get; set; } = null!;
|
||||||
|
|
||||||
@ -23,21 +21,8 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
|||||||
private INotificationOverlay? notificationOverlay { get; set; }
|
private INotificationOverlay? notificationOverlay { get; set; }
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(LegacyImportManager? legacyImportManager, IDialogOverlay? dialogOverlay)
|
private void load(IDialogOverlay? dialogOverlay)
|
||||||
{
|
{
|
||||||
if (legacyImportManager?.SupportsImportFromStable == true)
|
|
||||||
{
|
|
||||||
Add(importCollectionsButton = new SettingsButton
|
|
||||||
{
|
|
||||||
Text = MaintenanceSettingsStrings.ImportCollectionsFromStable,
|
|
||||||
Action = () =>
|
|
||||||
{
|
|
||||||
importCollectionsButton.Enabled.Value = false;
|
|
||||||
legacyImportManager.ImportFromStableAsync(StableContent.Collections).ContinueWith(_ => Schedule(() => importCollectionsButton.Enabled.Value = true));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
Add(new DangerousSettingsButton
|
Add(new DangerousSettingsButton
|
||||||
{
|
{
|
||||||
Text = MaintenanceSettingsStrings.DeleteAllCollections,
|
Text = MaintenanceSettingsStrings.DeleteAllCollections,
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Database;
|
|
||||||
using osu.Game.Localisation;
|
using osu.Game.Localisation;
|
||||||
using osu.Game.Scoring;
|
using osu.Game.Scoring;
|
||||||
|
|
||||||
@ -14,25 +13,11 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
|||||||
{
|
{
|
||||||
protected override LocalisableString Header => CommonStrings.Scores;
|
protected override LocalisableString Header => CommonStrings.Scores;
|
||||||
|
|
||||||
private SettingsButton importScoresButton = null!;
|
|
||||||
private SettingsButton deleteScoresButton = null!;
|
private SettingsButton deleteScoresButton = null!;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(ScoreManager scores, LegacyImportManager? legacyImportManager, IDialogOverlay? dialogOverlay)
|
private void load(ScoreManager scores, IDialogOverlay? dialogOverlay)
|
||||||
{
|
{
|
||||||
if (legacyImportManager?.SupportsImportFromStable == true)
|
|
||||||
{
|
|
||||||
Add(importScoresButton = new SettingsButton
|
|
||||||
{
|
|
||||||
Text = MaintenanceSettingsStrings.ImportScoresFromStable,
|
|
||||||
Action = () =>
|
|
||||||
{
|
|
||||||
importScoresButton.Enabled.Value = false;
|
|
||||||
legacyImportManager.ImportFromStableAsync(StableContent.Scores).ContinueWith(_ => Schedule(() => importScoresButton.Enabled.Value = true));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
Add(deleteScoresButton = new DangerousSettingsButton
|
Add(deleteScoresButton = new DangerousSettingsButton
|
||||||
{
|
{
|
||||||
Text = MaintenanceSettingsStrings.DeleteAllScores,
|
Text = MaintenanceSettingsStrings.DeleteAllScores,
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Database;
|
|
||||||
using osu.Game.Localisation;
|
using osu.Game.Localisation;
|
||||||
using osu.Game.Skinning;
|
using osu.Game.Skinning;
|
||||||
|
|
||||||
@ -14,25 +13,11 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
|||||||
{
|
{
|
||||||
protected override LocalisableString Header => CommonStrings.Skins;
|
protected override LocalisableString Header => CommonStrings.Skins;
|
||||||
|
|
||||||
private SettingsButton importSkinsButton = null!;
|
|
||||||
private SettingsButton deleteSkinsButton = null!;
|
private SettingsButton deleteSkinsButton = null!;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(SkinManager skins, LegacyImportManager? legacyImportManager, IDialogOverlay? dialogOverlay)
|
private void load(SkinManager skins, IDialogOverlay? dialogOverlay)
|
||||||
{
|
{
|
||||||
if (legacyImportManager?.SupportsImportFromStable == true)
|
|
||||||
{
|
|
||||||
Add(importSkinsButton = new SettingsButton
|
|
||||||
{
|
|
||||||
Text = MaintenanceSettingsStrings.ImportSkinsFromStable,
|
|
||||||
Action = () =>
|
|
||||||
{
|
|
||||||
importSkinsButton.Enabled.Value = false;
|
|
||||||
legacyImportManager.ImportFromStableAsync(StableContent.Skins).ContinueWith(_ => Schedule(() => importSkinsButton.Enabled.Value = true));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
Add(deleteSkinsButton = new DangerousSettingsButton
|
Add(deleteSkinsButton = new DangerousSettingsButton
|
||||||
{
|
{
|
||||||
Text = MaintenanceSettingsStrings.DeleteAllSkins,
|
Text = MaintenanceSettingsStrings.DeleteAllSkins,
|
||||||
|
Loading…
Reference in New Issue
Block a user