1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-18 11:43:22 +08:00

Clean up code slightly

This commit is contained in:
Salman Alshamrani 2024-12-05 02:48:46 -05:00
parent 7c1be5eca2
commit 1b1e7b63e9
3 changed files with 17 additions and 18 deletions

View File

@ -1,7 +1,6 @@
// 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.Development;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Localisation;
@ -12,7 +11,7 @@ namespace osu.Game.Overlays.Settings.Sections
{
public partial class DebugSection : SettingsSection
{
public override LocalisableString Header => "Debug";
public override LocalisableString Header => @"Debug";
public override Drawable CreateIcon() => new SpriteIcon
{
@ -21,12 +20,12 @@ namespace osu.Game.Overlays.Settings.Sections
public DebugSection()
{
Add(new GeneralSettings());
if (DebugUtils.IsDebugBuild)
Add(new BatchImportSettings());
Add(new MemorySettings());
Children = new Drawable[]
{
new GeneralSettings(),
new BatchImportSettings(),
new MemorySettings(),
};
}
}
}

View File

@ -10,7 +10,7 @@ namespace osu.Game.Overlays.Settings.Sections.DebugSettings
{
public partial class GeneralSettings : SettingsSubsection
{
protected override LocalisableString Header => "General";
protected override LocalisableString Header => @"General";
[BackgroundDependencyLoader]
private void load(FrameworkDebugConfigManager config, FrameworkConfigManager frameworkConfig)
@ -19,7 +19,7 @@ namespace osu.Game.Overlays.Settings.Sections.DebugSettings
{
new SettingsCheckbox
{
LabelText = "Show log overlay",
LabelText = @"Show log overlay",
Current = frameworkConfig.GetBindable<bool>(FrameworkSetting.ShowLogOverlay)
},
new SettingsCheckbox

View File

@ -16,7 +16,7 @@ namespace osu.Game.Overlays.Settings.Sections.DebugSettings
{
public partial class MemorySettings : SettingsSubsection
{
protected override LocalisableString Header => "Memory";
protected override LocalisableString Header => @"Memory";
[BackgroundDependencyLoader]
private void load(GameHost host, RealmAccess realm)
@ -28,27 +28,27 @@ namespace osu.Game.Overlays.Settings.Sections.DebugSettings
{
new SettingsButton
{
Text = "Clear all caches",
Text = @"Clear all caches",
Action = host.Collect
},
new SettingsButton
{
Text = "Compact realm",
Text = @"Compact realm",
Action = () =>
{
// Blocking operations implicitly causes a Compact().
using (realm.BlockAllOperations("compact"))
using (realm.BlockAllOperations(@"compact"))
{
}
}
},
blockAction = new SettingsButton
{
Text = "Block realm",
Text = @"Block realm",
},
unblockAction = new SettingsButton
{
Text = "Unblock realm",
Text = @"Unblock realm",
},
};
@ -56,7 +56,7 @@ namespace osu.Game.Overlays.Settings.Sections.DebugSettings
{
try
{
IDisposable? token = realm.BlockAllOperations("maintenance");
IDisposable? token = realm.BlockAllOperations(@"maintenance");
blockAction.Enabled.Value = false;
@ -88,7 +88,7 @@ namespace osu.Game.Overlays.Settings.Sections.DebugSettings
}
catch (Exception e)
{
Logger.Error(e, "Blocking realm failed");
Logger.Error(e, @"Blocking realm failed");
}
};
}