mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
Merge pull request #576 from Caraxi/disableRmtFiltering
feat: add an option to disable RMT Filtering
This commit is contained in:
commit
597103a731
3 changed files with 20 additions and 6 deletions
|
|
@ -195,6 +195,11 @@ namespace Dalamud.Configuration.Internal
|
|||
/// </summary>
|
||||
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>
|
||||
/// Load a configuration from the provided path.
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -151,13 +151,16 @@ namespace Dalamud.Game
|
|||
|
||||
var textVal = message.TextValue;
|
||||
|
||||
var matched = this.rmtRegex.IsMatch(textVal);
|
||||
if (matched)
|
||||
if (!configuration.DisableRmtFiltering)
|
||||
{
|
||||
// This seems to be a RMT ad - let's not show it
|
||||
Log.Debug("Handled RMT ad: " + message.TextValue);
|
||||
isHandled = true;
|
||||
return;
|
||||
var matched = this.rmtRegex.IsMatch(textVal);
|
||||
if (matched)
|
||||
{
|
||||
// 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 &&
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ namespace Dalamud.Interface.Internal.Windows
|
|||
private bool printPluginsWelcomeMsg;
|
||||
private bool autoUpdatePlugins;
|
||||
private bool doButtonsSystemMenu;
|
||||
private bool disableRmtFiltering;
|
||||
|
||||
#region Experimental
|
||||
|
||||
|
|
@ -99,6 +100,7 @@ namespace Dalamud.Interface.Internal.Windows
|
|||
this.printPluginsWelcomeMsg = configuration.PrintPluginsWelcomeMsg;
|
||||
this.autoUpdatePlugins = configuration.AutoUpdatePlugins;
|
||||
this.doButtonsSystemMenu = configuration.DoButtonsSystemMenu;
|
||||
this.disableRmtFiltering = configuration.DisableRmtFiltering;
|
||||
|
||||
this.languages = Localization.ApplicableLangCodes.Prepend("en").ToArray();
|
||||
try
|
||||
|
|
@ -238,6 +240,9 @@ namespace Dalamud.Interface.Internal.Windows
|
|||
|
||||
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.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()
|
||||
|
|
@ -689,6 +694,7 @@ namespace Dalamud.Interface.Internal.Windows
|
|||
configuration.PrintPluginsWelcomeMsg = this.printPluginsWelcomeMsg;
|
||||
configuration.AutoUpdatePlugins = this.autoUpdatePlugins;
|
||||
configuration.DoButtonsSystemMenu = this.doButtonsSystemMenu;
|
||||
configuration.DisableRmtFiltering = this.disableRmtFiltering;
|
||||
|
||||
configuration.Save();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue