Third party repo stuff

This commit is contained in:
Liza 2022-11-30 22:15:26 +01:00
parent bdc8187492
commit e6c56e5bce
3 changed files with 17 additions and 7 deletions

View File

@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<LangVersion>9.0</LangVersion>
<Version>1.21</Version>
<Version>1.22</Version>
<Nullable>enable</Nullable>
</PropertyGroup>

View File

@ -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<Service>();
@ -63,9 +76,6 @@ namespace Pal.Client
Service.Configuration = (Configuration?)pluginInterface.GetPluginConfig() ?? pluginInterface.Create<Configuration>()!;
Service.Configuration.Migrate();
IsUnsupported = !pluginInterface.IsDev && !pluginInterface.SourceRepository.StartsWith("https://raw.githubusercontent.com/carvelli/");
PluginLog.Information($"Install source: {pluginInterface.SourceRepository}");
var agreementWindow = pluginInterface.Create<AgreementWindow>();
if (agreementWindow is not null)
{

View File

@ -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);