Remove highlighted/mentioned words

This commit is contained in:
Craftplacer
2020-01-19 17:26:43 +01:00
parent 32c2023517
commit dd5478fe1f
4 changed files with 1 additions and 65 deletions

View File

@ -52,8 +52,6 @@ namespace osu.Game.Configuration
Set(OsuSetting.ChatHighlightName, true);
Set(OsuSetting.ChatMessageNotification, true);
Set(OsuSetting.HighlightWords, string.Empty);
// Audio
Set(OsuSetting.VolumeInactive, 0.25, 0, 1, 0.01);

View File

@ -141,17 +141,6 @@ namespace osu.Game.Online.Chat
continue;
}
if (!string.IsNullOrWhiteSpace(highlightWords.Value))
{
var matchedWord = hasCaseInsensitive(words, getWords(highlightWords.Value));
if (matchedWord != null)
{
var notification = new HighlightNotification(message.Sender.Username, matchedWord, onClick);
notificationOverlay?.Post(notification);
}
}
}
}
@ -164,30 +153,7 @@ namespace osu.Game.Online.Chat
private static bool anyCaseInsensitive(IEnumerable<string> x, string y) => x.Any(x2 => x2.Equals(y, StringComparison.OrdinalIgnoreCase));
public class HighlightNotification : SimpleNotification
{
public HighlightNotification(string highlighter, string word, Action onClick)
{
Icon = FontAwesome.Solid.Highlighter;
Text = $"'{word}' was mentioned in chat by '{highlighter}'. Click to find out why!";
this.onClick = onClick;
}
private readonly Action onClick;
public override bool IsImportant => false;
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
IconBackgound.Colour = colours.PurpleDark;
Activated = delegate
{
onClick?.Invoke();
return true;
};
}
}
public class PrivateMessageNotification : SimpleNotification
{

View File

@ -1,27 +0,0 @@
// 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.Configuration;
namespace osu.Game.Overlays.Settings.Sections.Online
{
public class InGameChatSettings : SettingsSubsection
{
protected override string Header => "In-Game Chat";
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
{
Children = new Drawable[]
{
new SettingsTextBox
{
LabelText = "Chat highlight words (space-separated list)",
Bindable = config.GetBindable<string>(OsuSetting.HighlightWords)
}
};
}
}
}

View File

@ -17,8 +17,7 @@ namespace osu.Game.Overlays.Settings.Sections
Children = new Drawable[]
{
new WebSettings(),
new AlertsAndPrivacySettings(),
new InGameChatSettings()
new AlertsAndPrivacySettings()
};
}
}