Merge pull request #576 from Caraxi/disableRmtFiltering

feat: add an option to disable RMT Filtering
This commit is contained in:
goaaats 2021-09-22 10:13:42 +02:00 committed by GitHub
commit 597103a731
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 6 deletions

View file

@ -195,6 +195,11 @@ namespace Dalamud.Configuration.Internal
/// </summary> /// </summary>
public bool PluginSafeMode { get; set; } public bool PluginSafeMode { get; set; }
/// <summary>
/// Gets or sets a value indicating whether or not Dalamud RMT filtering should be disabled.
/// </summary>
public bool DisableRmtFiltering { get; set; }
/// <summary> /// <summary>
/// Load a configuration from the provided path. /// Load a configuration from the provided path.
/// </summary> /// </summary>

View file

@ -151,13 +151,16 @@ namespace Dalamud.Game
var textVal = message.TextValue; var textVal = message.TextValue;
var matched = this.rmtRegex.IsMatch(textVal); if (!configuration.DisableRmtFiltering)
if (matched)
{ {
// This seems to be a RMT ad - let's not show it var matched = this.rmtRegex.IsMatch(textVal);
Log.Debug("Handled RMT ad: " + message.TextValue); if (matched)
isHandled = true; {
return; // This seems to be a RMT ad - let's not show it
Log.Debug("Handled RMT ad: " + message.TextValue);
isHandled = true;
return;
}
} }
if (configuration.BadWords != null && if (configuration.BadWords != null &&

View file

@ -59,6 +59,7 @@ namespace Dalamud.Interface.Internal.Windows
private bool printPluginsWelcomeMsg; private bool printPluginsWelcomeMsg;
private bool autoUpdatePlugins; private bool autoUpdatePlugins;
private bool doButtonsSystemMenu; private bool doButtonsSystemMenu;
private bool disableRmtFiltering;
#region Experimental #region Experimental
@ -99,6 +100,7 @@ namespace Dalamud.Interface.Internal.Windows
this.printPluginsWelcomeMsg = configuration.PrintPluginsWelcomeMsg; this.printPluginsWelcomeMsg = configuration.PrintPluginsWelcomeMsg;
this.autoUpdatePlugins = configuration.AutoUpdatePlugins; this.autoUpdatePlugins = configuration.AutoUpdatePlugins;
this.doButtonsSystemMenu = configuration.DoButtonsSystemMenu; this.doButtonsSystemMenu = configuration.DoButtonsSystemMenu;
this.disableRmtFiltering = configuration.DisableRmtFiltering;
this.languages = Localization.ApplicableLangCodes.Prepend("en").ToArray(); this.languages = Localization.ApplicableLangCodes.Prepend("en").ToArray();
try try
@ -238,6 +240,9 @@ namespace Dalamud.Interface.Internal.Windows
ImGui.Checkbox(Loc.Localize("DalamudSettingsSystemMenu", "Dalamud buttons in system menu"), ref this.doButtonsSystemMenu); ImGui.Checkbox(Loc.Localize("DalamudSettingsSystemMenu", "Dalamud buttons in system menu"), ref this.doButtonsSystemMenu);
ImGui.TextColored(this.hintTextColor, Loc.Localize("DalamudSettingsSystemMenuMsgHint", "Add buttons for Dalamud plugins and settings to the system menu.")); ImGui.TextColored(this.hintTextColor, Loc.Localize("DalamudSettingsSystemMenuMsgHint", "Add buttons for Dalamud plugins and settings to the system menu."));
ImGui.Checkbox(Loc.Localize("DalamudSettingsDisableRmtFiltering", "Disable RMT Filtering"), ref this.disableRmtFiltering);
ImGui.TextColored(this.hintTextColor, Loc.Localize("DalamudSettingsDisableRmtFilteringMsgHint", "Disable dalamud's built-in RMT ad filtering."));
} }
private void DrawLookAndFeelTab() private void DrawLookAndFeelTab()
@ -689,6 +694,7 @@ namespace Dalamud.Interface.Internal.Windows
configuration.PrintPluginsWelcomeMsg = this.printPluginsWelcomeMsg; configuration.PrintPluginsWelcomeMsg = this.printPluginsWelcomeMsg;
configuration.AutoUpdatePlugins = this.autoUpdatePlugins; configuration.AutoUpdatePlugins = this.autoUpdatePlugins;
configuration.DoButtonsSystemMenu = this.doButtonsSystemMenu; configuration.DoButtonsSystemMenu = this.doButtonsSystemMenu;
configuration.DisableRmtFiltering = this.disableRmtFiltering;
configuration.Save(); configuration.Save();