diff --git a/Pal.Client/Pal.Client.csproj b/Pal.Client/Pal.Client.csproj index 269f5ae..9dc1b50 100644 --- a/Pal.Client/Pal.Client.csproj +++ b/Pal.Client/Pal.Client.csproj @@ -3,7 +3,7 @@ net6.0-windows 9.0 - 1.21 + 1.22 enable diff --git a/Pal.Client/Plugin.cs b/Pal.Client/Plugin.cs index b4a8111..b47944c 100644 --- a/Pal.Client/Plugin.cs +++ b/Pal.Client/Plugin.cs @@ -2,6 +2,7 @@ using Dalamud.Game.ClientState.Conditions; using Dalamud.Game.ClientState.Objects.Types; using Dalamud.Game.Command; +using Dalamud.Game.Gui; using Dalamud.Game.Text; using Dalamud.Game.Text.SeStringHandling; using Dalamud.Interface.Windowing; @@ -50,12 +51,24 @@ namespace Pal.Client public PomanderState PomanderOfSight { get; set; } = PomanderState.Inactive; public PomanderState PomanderOfIntuition { get; set; } = PomanderState.Inactive; public string? DebugMessage { get; set; } - public bool IsUnsupported { get; set; } public string Name => "Palace Pal"; - public Plugin(DalamudPluginInterface pluginInterface) + public Plugin(DalamudPluginInterface pluginInterface, ChatGui chat) { + PluginLog.Information($"Install source: {pluginInterface.SourceRepository}"); + +#if RELEASE + // You're welcome to remove this code in your fork, as long as: + // - none of the links accessible within FFXIV open the original repo (e.g. in the plugin installer), and + // - you host your own server instance + if (!pluginInterface.IsDev && !pluginInterface.SourceRepository.StartsWith("https://raw.githubusercontent.com/carvelli/")) + { + chat.PrintError("[Palace Pal] Please install this plugin from the official repository at https://github.com/carvelli/Dalamud-Plugins to continue using it."); + throw new InvalidOperationException(); + } +#endif + ECommonsMain.Init(pluginInterface, this, Module.SplatoonAPI); pluginInterface.Create(); @@ -63,9 +76,6 @@ namespace Pal.Client Service.Configuration = (Configuration?)pluginInterface.GetPluginConfig() ?? pluginInterface.Create()!; Service.Configuration.Migrate(); - IsUnsupported = !pluginInterface.IsDev && !pluginInterface.SourceRepository.StartsWith("https://raw.githubusercontent.com/carvelli/"); - PluginLog.Information($"Install source: {pluginInterface.SourceRepository}"); - var agreementWindow = pluginInterface.Create(); if (agreementWindow is not null) { diff --git a/Pal.Client/Windows/ConfigWindow.cs b/Pal.Client/Windows/ConfigWindow.cs index 6978961..ed3b71f 100644 --- a/Pal.Client/Windows/ConfigWindow.cs +++ b/Pal.Client/Windows/ConfigWindow.cs @@ -36,7 +36,7 @@ namespace Pal.Client.Windows public ConfigWindow() : base("Palace Pal###PalPalaceConfig") { var version = typeof(Plugin).Assembly.GetName().Version!.ToString(2); - WindowName = $"Palace Pal v{version}{(Service.Plugin.IsUnsupported ? " - Unsupported" : "")}###PalPalaceConfig"; + WindowName = $"Palace Pal v{version}###PalPalaceConfig"; Size = new Vector2(500, 400); SizeCondition = ImGuiCond.FirstUseEver; Position = new Vector2(300, 300);