mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 07:32:55 +08:00
Merge pull request #400 from peppy/add-debug-options
Add basic GC options.
This commit is contained in:
commit
0014208782
2
.gitignore
vendored
2
.gitignore
vendored
@ -11,7 +11,7 @@
|
||||
*.userprefs
|
||||
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
bin/[Dd]ebug/
|
||||
[Dd]ebugPublic/
|
||||
[Rr]elease/
|
||||
[Rr]eleases/
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 2305b8825929dbed244675aa92676ec2225c24ff
|
||||
Subproject commit 7c7edc0c3f4504c179e050ac98dc9ca2831602c9
|
37
osu.Game/Overlays/Options/Sections/Debug/GCOptions.cs
Normal file
37
osu.Game/Overlays/Options/Sections/Debug/GCOptions.cs
Normal file
@ -0,0 +1,37 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.Runtime;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
|
||||
namespace osu.Game.Overlays.Options.Sections.Debug
|
||||
{
|
||||
public class GCOptions : OptionsSubsection
|
||||
{
|
||||
protected override string Header => "Garbage Collector";
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(FrameworkDebugConfigManager config)
|
||||
{
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new OptionEnumDropDown<GCLatencyMode>
|
||||
{
|
||||
LabelText = "Active mode",
|
||||
Bindable = config.GetBindable<GCLatencyMode>(FrameworkDebugConfig.ActiveGCMode)
|
||||
},
|
||||
new OsuButton
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Text = "Force garbage collection",
|
||||
Action = () => GC.Collect()
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
23
osu.Game/Overlays/Options/Sections/DebugSection.cs
Normal file
23
osu.Game/Overlays/Options/Sections/DebugSection.cs
Normal file
@ -0,0 +1,23 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Overlays.Options.Sections.Debug;
|
||||
|
||||
namespace osu.Game.Overlays.Options.Sections
|
||||
{
|
||||
public class DebugSection : OptionsSection
|
||||
{
|
||||
public override string Header => "Debug";
|
||||
public override FontAwesome Icon => FontAwesome.fa_bug;
|
||||
|
||||
public DebugSection()
|
||||
{
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new GCOptions(),
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
@ -55,6 +55,7 @@ namespace osu.Game.Overlays
|
||||
new EditorSection(),
|
||||
new OnlineSection(),
|
||||
new MaintenanceSection(),
|
||||
new DebugSection(),
|
||||
};
|
||||
Children = new Drawable[]
|
||||
{
|
||||
|
@ -118,6 +118,8 @@
|
||||
<Compile Include="Graphics\UserInterface\OsuDropDownHeader.cs" />
|
||||
<Compile Include="Graphics\UserInterface\OsuDropDownMenu.cs" />
|
||||
<Compile Include="Graphics\UserInterface\OsuDropDownMenuItem.cs" />
|
||||
<Compile Include="Overlays\Options\Sections\DebugSection.cs" />
|
||||
<Compile Include="Overlays\Options\Sections\Debug\GCOptions.cs" />
|
||||
<Compile Include="Overlays\Toolbar\ToolbarHomeButton.cs" />
|
||||
<Compile Include="Overlays\Toolbar\ToolbarMusicButton.cs" />
|
||||
<Compile Include="Overlays\Toolbar\ToolbarNotificationButton.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user