mirror of
https://github.com/osukey/osukey.git
synced 2025-08-08 09:03:50 +09:00
Add VisibilitySection
and its bindables in IssueList
This commit is contained in:
@ -34,12 +34,22 @@ namespace osu.Game.Screens.Edit.Verify
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private Bindable<Issue> selectedIssue { get; set; }
|
private Bindable<Issue> selectedIssue { get; set; }
|
||||||
|
|
||||||
|
public Dictionary<IssueType, Bindable<bool>> ShowType { get; set; }
|
||||||
|
|
||||||
private IBeatmapVerifier rulesetVerifier;
|
private IBeatmapVerifier rulesetVerifier;
|
||||||
private BeatmapVerifier generalVerifier;
|
private BeatmapVerifier generalVerifier;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OverlayColourProvider colours)
|
private void load(OverlayColourProvider colours)
|
||||||
{
|
{
|
||||||
|
// Reflects the user interface. Only types in this dictionary have configurable visibility.
|
||||||
|
ShowType = new Dictionary<IssueType, Bindable<bool>>
|
||||||
|
{
|
||||||
|
{ IssueType.Warning, new Bindable<bool>(true) },
|
||||||
|
{ IssueType.Error, new Bindable<bool>(true) },
|
||||||
|
{ IssueType.Negligible, new Bindable<bool>(false) }
|
||||||
|
};
|
||||||
|
|
||||||
generalVerifier = new BeatmapVerifier();
|
generalVerifier = new BeatmapVerifier();
|
||||||
rulesetVerifier = beatmap.BeatmapInfo.Ruleset?.CreateInstance()?.CreateBeatmapVerifier();
|
rulesetVerifier = beatmap.BeatmapInfo.Ruleset?.CreateInstance()?.CreateBeatmapVerifier();
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@ namespace osu.Game.Screens.Edit.Verify
|
|||||||
|
|
||||||
protected override IReadOnlyList<Drawable> CreateSections() => new Drawable[]
|
protected override IReadOnlyList<Drawable> CreateSections() => new Drawable[]
|
||||||
{
|
{
|
||||||
|
new VisibilitySection(issueList)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
38
osu.Game/Screens/Edit/Verify/VisibilitySection.cs
Normal file
38
osu.Game/Screens/Edit/Verify/VisibilitySection.cs
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
// 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.Graphics;
|
||||||
|
using osu.Game.Overlays;
|
||||||
|
using osu.Game.Overlays.Settings;
|
||||||
|
using osu.Game.Rulesets.Edit.Checks.Components;
|
||||||
|
|
||||||
|
namespace osu.Game.Screens.Edit.Verify
|
||||||
|
{
|
||||||
|
internal class VisibilitySection : Section
|
||||||
|
{
|
||||||
|
public VisibilitySection(IssueList issueList)
|
||||||
|
: base(issueList)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override string Header => "Visibility";
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(OverlayColourProvider colours)
|
||||||
|
{
|
||||||
|
foreach (IssueType issueType in IssueList.ShowType.Keys)
|
||||||
|
{
|
||||||
|
var checkbox = new SettingsCheckbox
|
||||||
|
{
|
||||||
|
Anchor = Anchor.CentreLeft,
|
||||||
|
Origin = Anchor.CentreLeft,
|
||||||
|
LabelText = issueType.ToString()
|
||||||
|
};
|
||||||
|
|
||||||
|
checkbox.Current.BindTo(IssueList.ShowType[issueType]);
|
||||||
|
Flow.Add(checkbox);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user