1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 21:02:54 +08:00

Merge remote-tracking branch 'upstream/master' into abstract-menu

This commit is contained in:
Dean Herbert 2019-06-28 18:13:44 +09:00
commit 3902da9135

View File

@ -2,9 +2,7 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System; using System;
using System.Runtime;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Configuration; using osu.Framework.Configuration;
using osu.Framework.Graphics; using osu.Framework.Graphics;
@ -14,37 +12,17 @@ namespace osu.Game.Overlays.Settings.Sections.Debug
{ {
protected override string Header => "Garbage Collector"; protected override string Header => "Garbage Collector";
private readonly Bindable<LatencyMode> latencyMode = new Bindable<LatencyMode>();
private Bindable<GCLatencyMode> configLatencyMode;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(FrameworkDebugConfigManager config) private void load(FrameworkDebugConfigManager config)
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new SettingsEnumDropdown<LatencyMode>
{
LabelText = "Active mode",
Bindable = latencyMode
},
new SettingsButton new SettingsButton
{ {
Text = "Force garbage collection", Text = "Force garbage collection",
Action = GC.Collect Action = GC.Collect
}, },
}; };
configLatencyMode = config.GetBindable<GCLatencyMode>(DebugSetting.ActiveGCMode);
configLatencyMode.BindValueChanged(mode => latencyMode.Value = (LatencyMode)mode.NewValue, true);
latencyMode.BindValueChanged(mode => configLatencyMode.Value = (GCLatencyMode)mode.NewValue);
}
private enum LatencyMode
{
Batch = GCLatencyMode.Batch,
Interactive = GCLatencyMode.Interactive,
LowLatency = GCLatencyMode.LowLatency,
SustainedLowLatency = GCLatencyMode.SustainedLowLatency
} }
} }
} }