feat(safety): refuse to load when Chat 2 is also active
When the user has both Hellion Chat and upstream Chat 2 installed and loaded, the parallel chat-window replacement and Hook collisions can crash FFXIV at frame boundaries. The new detector inspects IDalamudPluginInterface.InstalledPlugins and throws an InvalidOperationException with a localized message if Chat 2 is loaded, which Dalamud surfaces cleanly instead of letting the load proceed into a runtime crash. Bilingual messages (EN/DE) follow the existing HellionStrings pattern.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
using System.Linq;
|
||||
using ChatTwo.Resources;
|
||||
using Dalamud.Plugin;
|
||||
|
||||
namespace ChatTwo;
|
||||
|
||||
internal static class ChatTwoConflictDetector
|
||||
{
|
||||
private const string UpstreamInternalName = "ChatTwo";
|
||||
|
||||
public static void ThrowIfChatTwoIsLoaded(IDalamudPluginInterface pluginInterface)
|
||||
{
|
||||
var conflict = pluginInterface.InstalledPlugins
|
||||
.FirstOrDefault(p =>
|
||||
p.InternalName == UpstreamInternalName &&
|
||||
p.IsLoaded);
|
||||
|
||||
if (conflict is null)
|
||||
return;
|
||||
|
||||
var message = HellionStrings.ChatTwoConflictTitle + "\n\n" +
|
||||
HellionStrings.ChatTwoConflictBody + "\n\n" +
|
||||
HellionStrings.ChatTwoConflictAction;
|
||||
|
||||
throw new System.InvalidOperationException(message);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user