From 56bd8976666ee49318ab22d4dcfa86f5f7b627ae Mon Sep 17 00:00:00 2001 From: Naxess <30292137+Naxesss@users.noreply.github.com> Date: Thu, 13 May 2021 04:29:27 +0200 Subject: [PATCH] Move `ShowIssueTypes` to `VerifyScreen` --- osu.Game/Screens/Edit/Verify/IssueList.cs | 14 ++------------ osu.Game/Screens/Edit/Verify/VerifyScreen.cs | 8 ++++++++ osu.Game/Screens/Edit/Verify/VisibilitySection.cs | 4 ++-- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/osu.Game/Screens/Edit/Verify/IssueList.cs b/osu.Game/Screens/Edit/Verify/IssueList.cs index befffdd9db..f2d3ef9dda 100644 --- a/osu.Game/Screens/Edit/Verify/IssueList.cs +++ b/osu.Game/Screens/Edit/Verify/IssueList.cs @@ -35,8 +35,6 @@ namespace osu.Game.Screens.Edit.Verify [Resolved] private VerifyScreen verify { get; set; } - public Dictionary> ShowType { get; set; } - public Bindable InterpretedDifficulty { get; set; } private IBeatmapVerifier rulesetVerifier; @@ -45,14 +43,6 @@ namespace osu.Game.Screens.Edit.Verify [BackgroundDependencyLoader] private void load(OverlayColourProvider colours) { - // Reflects the user interface. Only types in this dictionary have configurable visibility. - ShowType = new Dictionary> - { - { IssueType.Warning, new Bindable(true) }, - { IssueType.Error, new Bindable(true) }, - { IssueType.Negligible, new Bindable(false) } - }; - generalVerifier = new BeatmapVerifier(); rulesetVerifier = beatmap.BeatmapInfo.Ruleset?.CreateInstance()?.CreateBeatmapVerifier(); @@ -116,9 +106,9 @@ namespace osu.Game.Screens.Edit.Verify private IEnumerable filter(IEnumerable issues) { - foreach (IssueType issueType in ShowType.Keys) + foreach (var issueType in verify.ShowIssueType.Keys) { - if (!ShowType[issueType].Value) + if (!verify.ShowIssueType[issueType].Value) issues = issues.Where(issue => issue.Template.Type != issueType); } diff --git a/osu.Game/Screens/Edit/Verify/VerifyScreen.cs b/osu.Game/Screens/Edit/Verify/VerifyScreen.cs index afd0c8760d..cf1a471714 100644 --- a/osu.Game/Screens/Edit/Verify/VerifyScreen.cs +++ b/osu.Game/Screens/Edit/Verify/VerifyScreen.cs @@ -1,6 +1,7 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System.Collections.Generic; using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Graphics; @@ -17,6 +18,13 @@ namespace osu.Game.Screens.Edit.Verify public readonly Bindable InterpretedDifficulty = new Bindable(); + public readonly Dictionary> ShowIssueType = new Dictionary> + { + { IssueType.Warning, new Bindable(true) }, + { IssueType.Error, new Bindable(true) }, + { IssueType.Negligible, new Bindable(false) } + }; + public IssueList IssueList { get; private set; } public VerifyScreen() diff --git a/osu.Game/Screens/Edit/Verify/VisibilitySection.cs b/osu.Game/Screens/Edit/Verify/VisibilitySection.cs index ce755bdcb4..71f3740d86 100644 --- a/osu.Game/Screens/Edit/Verify/VisibilitySection.cs +++ b/osu.Game/Screens/Edit/Verify/VisibilitySection.cs @@ -19,7 +19,7 @@ namespace osu.Game.Screens.Edit.Verify [BackgroundDependencyLoader] private void load(OverlayColourProvider colours) { - foreach (IssueType issueType in verify.IssueList.ShowType.Keys) + foreach (IssueType issueType in verify.ShowIssueType.Keys) { var checkbox = new SettingsCheckbox { @@ -28,7 +28,7 @@ namespace osu.Game.Screens.Edit.Verify LabelText = issueType.ToString() }; - checkbox.Current.BindTo(verify.IssueList.ShowType[issueType]); + checkbox.Current.BindTo(verify.ShowIssueType[issueType]); checkbox.Current.BindValueChanged(_ => verify.IssueList.Refresh()); Flow.Add(checkbox); }