1c2d361b77
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.
28 lines
783 B
C#
28 lines
783 B
C#
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);
|
|
}
|
|
}
|