v1.0.2: Suppress 'That player has already been invited' toast (QuestToast + broader match)
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
|
|||||||
|
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||||
|
|
||||||
|
## [1.0.2] - 2025-02-03
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Suppress "That player has already been invited" toast (same window as other party errors). Also handle QuestToast; match "already" + "invited" for wording variants.
|
||||||
|
|
||||||
## [1.0.1] - 2025-02-03
|
## [1.0.1] - 2025-02-03
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Dalamud.NET.Sdk/14.0.1">
|
<Project Sdk="Dalamud.NET.Sdk/14.0.1">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<Version>1.0.1.0</Version>
|
<Version>1.0.2.0</Version>
|
||||||
<Author>Knack117</Author>
|
<Author>Knack117</Author>
|
||||||
<Name>HSRTools</Name>
|
<Name>HSRTools</Name>
|
||||||
<InternalName>HSRTools</InternalName>
|
<InternalName>HSRTools</InternalName>
|
||||||
|
|||||||
@@ -59,25 +59,33 @@ public sealed class ChatMonitorService
|
|||||||
_chatGui.CheckMessageHandled += OnCheckMessageHandled;
|
_chatGui.CheckMessageHandled += OnCheckMessageHandled;
|
||||||
PluginServices.ToastGui.Toast += OnToast;
|
PluginServices.ToastGui.Toast += OnToast;
|
||||||
PluginServices.ToastGui.ErrorToast += OnErrorToast;
|
PluginServices.ToastGui.ErrorToast += OnErrorToast;
|
||||||
|
PluginServices.ToastGui.QuestToast += OnQuestToast;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Stop()
|
public void Stop()
|
||||||
{
|
{
|
||||||
|
PluginServices.ToastGui.QuestToast -= OnQuestToast;
|
||||||
PluginServices.ToastGui.ErrorToast -= OnErrorToast;
|
PluginServices.ToastGui.ErrorToast -= OnErrorToast;
|
||||||
PluginServices.ToastGui.Toast -= OnToast;
|
PluginServices.ToastGui.Toast -= OnToast;
|
||||||
_chatGui.ChatMessage -= OnChatMessage;
|
_chatGui.ChatMessage -= OnChatMessage;
|
||||||
_chatGui.CheckMessageHandled -= OnCheckMessageHandled;
|
_chatGui.CheckMessageHandled -= OnCheckMessageHandled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static bool IsPartyErrorToSuppress(string msg)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(msg)) return false;
|
||||||
|
var ord = StringComparison.OrdinalIgnoreCase;
|
||||||
|
return (msg.Contains("locate", ord) && msg.Contains("that name", ord)) ||
|
||||||
|
msg.Contains("Unable to process party command", ord) ||
|
||||||
|
(msg.Contains("already", ord) && msg.Contains("invited", ord));
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>Suppress party-error toasts (big on-screen message) from our fallback invite. See BurntToast plugin.</summary>
|
/// <summary>Suppress party-error toasts (big on-screen message) from our fallback invite. See BurntToast plugin.</summary>
|
||||||
private void OnErrorToast(ref SeString message, ref bool isHandled)
|
private void OnErrorToast(ref SeString message, ref bool isHandled)
|
||||||
{
|
{
|
||||||
if (DateTime.UtcNow >= _suppressPartyErrorUntil || isHandled)
|
if (DateTime.UtcNow >= _suppressPartyErrorUntil || isHandled)
|
||||||
return;
|
return;
|
||||||
var msg = message.TextValue;
|
if (IsPartyErrorToSuppress(message.TextValue))
|
||||||
var ord = StringComparison.OrdinalIgnoreCase;
|
|
||||||
if ((msg.Contains("locate", ord) && msg.Contains("that name", ord)) ||
|
|
||||||
msg.Contains("Unable to process party command", ord))
|
|
||||||
{
|
{
|
||||||
isHandled = true;
|
isHandled = true;
|
||||||
_suppressPartyErrorUntil = DateTime.MinValue;
|
_suppressPartyErrorUntil = DateTime.MinValue;
|
||||||
@@ -88,10 +96,18 @@ public sealed class ChatMonitorService
|
|||||||
{
|
{
|
||||||
if (DateTime.UtcNow >= _suppressPartyErrorUntil || isHandled)
|
if (DateTime.UtcNow >= _suppressPartyErrorUntil || isHandled)
|
||||||
return;
|
return;
|
||||||
var msg = message.TextValue;
|
if (IsPartyErrorToSuppress(message.TextValue))
|
||||||
var ord = StringComparison.OrdinalIgnoreCase;
|
{
|
||||||
if ((msg.Contains("locate", ord) && msg.Contains("that name", ord)) ||
|
isHandled = true;
|
||||||
msg.Contains("Unable to process party command", ord))
|
_suppressPartyErrorUntil = DateTime.MinValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnQuestToast(ref SeString message, ref Dalamud.Game.Gui.Toast.QuestToastOptions options, ref bool isHandled)
|
||||||
|
{
|
||||||
|
if (DateTime.UtcNow >= _suppressPartyErrorUntil || isHandled)
|
||||||
|
return;
|
||||||
|
if (IsPartyErrorToSuppress(message.TextValue))
|
||||||
{
|
{
|
||||||
isHandled = true;
|
isHandled = true;
|
||||||
_suppressPartyErrorUntil = DateTime.MinValue;
|
_suppressPartyErrorUntil = DateTime.MinValue;
|
||||||
@@ -106,9 +122,7 @@ public sealed class ChatMonitorService
|
|||||||
var msg = message.TextValue;
|
var msg = message.TextValue;
|
||||||
if (msg.Length == 0)
|
if (msg.Length == 0)
|
||||||
return;
|
return;
|
||||||
var ord = StringComparison.OrdinalIgnoreCase;
|
if (IsPartyErrorToSuppress(msg))
|
||||||
if ((msg.Contains("locate", ord) && msg.Contains("that name", ord)) ||
|
|
||||||
msg.Contains("Unable to process party command", ord))
|
|
||||||
{
|
{
|
||||||
isHandled = true;
|
isHandled = true;
|
||||||
_suppressPartyErrorUntil = DateTime.MinValue;
|
_suppressPartyErrorUntil = DateTime.MinValue;
|
||||||
@@ -119,17 +133,12 @@ public sealed class ChatMonitorService
|
|||||||
{
|
{
|
||||||
var msg = message.TextValue;
|
var msg = message.TextValue;
|
||||||
// Suppress party-error messages from our fallback invite (same-world CWLS tries ContentId then name+world; first can fail).
|
// Suppress party-error messages from our fallback invite (same-world CWLS tries ContentId then name+world; first can fail).
|
||||||
if (DateTime.UtcNow < _suppressPartyErrorUntil)
|
if (DateTime.UtcNow < _suppressPartyErrorUntil && IsPartyErrorToSuppress(msg))
|
||||||
{
|
|
||||||
var ord = StringComparison.OrdinalIgnoreCase;
|
|
||||||
if ((msg.Contains("locate", ord) && msg.Contains("that name", ord)) ||
|
|
||||||
msg.Contains("Unable to process party command", ord))
|
|
||||||
{
|
{
|
||||||
isHandled = true;
|
isHandled = true;
|
||||||
_suppressPartyErrorUntil = DateTime.MinValue;
|
_suppressPartyErrorUntil = DateTime.MinValue;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!_config.Enabled || string.IsNullOrWhiteSpace(_config.TriggerText))
|
if (!_config.Enabled || string.IsNullOrWhiteSpace(_config.TriggerText))
|
||||||
return;
|
return;
|
||||||
|
|||||||
+4
-4
@@ -5,15 +5,15 @@
|
|||||||
"Punchline": "Auto-invite to party when a trigger word is said in FC, LS, CWLS, or tells.",
|
"Punchline": "Auto-invite to party when a trigger word is said in FC, LS, CWLS, or tells.",
|
||||||
"Description": "Detects a user-defined trigger word in Free Company, Link Shell, Cross-World Link Shell, and tell chat, then invites the sender to your party. Works for same-world and cross-world (CWLS).",
|
"Description": "Detects a user-defined trigger word in Free Company, Link Shell, Cross-World Link Shell, and tell chat, then invites the sender to your party. Works for same-world and cross-world (CWLS).",
|
||||||
"InternalName": "HSRTools",
|
"InternalName": "HSRTools",
|
||||||
"AssemblyVersion": "1.0.1.0",
|
"AssemblyVersion": "1.0.2.0",
|
||||||
"RepoUrl": "https://github.com/Knack117/HSRTools",
|
"RepoUrl": "https://github.com/Knack117/HSRTools",
|
||||||
"ApplicableVersion": "any",
|
"ApplicableVersion": "any",
|
||||||
"DalamudApiLevel": 14,
|
"DalamudApiLevel": 14,
|
||||||
"Tags": [ "chat", "party", "invite", "automation" ],
|
"Tags": [ "chat", "party", "invite", "automation" ],
|
||||||
"AcceptsFeedback": true,
|
"AcceptsFeedback": true,
|
||||||
"DownloadCount": 0,
|
"DownloadCount": 0,
|
||||||
"LastUpdate": "1738627200",
|
"LastUpdate": "1738713600",
|
||||||
"DownloadLinkInstall": "https://github.com/Knack117/HSRTools/releases/download/v1.0.1/HSRTools.zip",
|
"DownloadLinkInstall": "https://github.com/Knack117/HSRTools/releases/download/v1.0.2/HSRTools.zip",
|
||||||
"DownloadLinkUpdate": "https://github.com/Knack117/HSRTools/releases/download/v1.0.1/HSRTools.zip"
|
"DownloadLinkUpdate": "https://github.com/Knack117/HSRTools/releases/download/v1.0.2/HSRTools.zip"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user