From c1abfc512aaad674c3112ae4bbad3854417096bb Mon Sep 17 00:00:00 2001 From: r00telement <47005506+r00telement@users.noreply.github.com> Date: Mon, 6 Dec 2021 23:14:06 +0000 Subject: [PATCH] Fixed DalamudPackager target --- PlayerTags/DalamudPackager.targets | 11 +++++++++++ PlayerTags/PlayerTags.csproj | 4 ---- PlayerTags/Plugin.cs | 22 +++++++++++++--------- 3 files changed, 24 insertions(+), 13 deletions(-) create mode 100644 PlayerTags/DalamudPackager.targets diff --git a/PlayerTags/DalamudPackager.targets b/PlayerTags/DalamudPackager.targets new file mode 100644 index 0000000..fe58a7b --- /dev/null +++ b/PlayerTags/DalamudPackager.targets @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/PlayerTags/PlayerTags.csproj b/PlayerTags/PlayerTags.csproj index 0ceb190..2af85e3 100644 --- a/PlayerTags/PlayerTags.csproj +++ b/PlayerTags/PlayerTags.csproj @@ -74,8 +74,4 @@ PreserveNewest - - - - diff --git a/PlayerTags/Plugin.cs b/PlayerTags/Plugin.cs index 2d3d27f..0f33544 100644 --- a/PlayerTags/Plugin.cs +++ b/PlayerTags/Plugin.cs @@ -62,6 +62,8 @@ namespace PlayerTags private PluginData m_PluginData = new PluginData(); + private bool m_OpenConfigClicked = false; + public Plugin() { UIColorHelper.Initialize(DataManager); @@ -116,12 +118,6 @@ namespace PlayerTags } } - private void Rehook() - { - Unhook(); - Hook(); - } - private void ClientState_Login(object? sender, EventArgs e) { Hook(); @@ -140,15 +136,23 @@ namespace PlayerTags private void UiBuilder_Draw() { - // Don't bother showing the config unless the player is in the world - if (ClientState.LocalPlayer != null) + if (m_PluginConfiguration.IsVisible) { - m_PluginConfigurationUI.Draw(); + // Only allow the config to be shown either when in the world, or when explicitly opened + if (ClientState.LocalPlayer != null || m_OpenConfigClicked) + { + m_PluginConfigurationUI.Draw(); + } + } + else + { + m_OpenConfigClicked = false; } } private void UiBuilder_OpenConfigUi() { + m_OpenConfigClicked = true; m_PluginConfiguration.IsVisible = true; }