From a1a9fa58865f661978c154004f7c02f1ff64cdff Mon Sep 17 00:00:00 2001 From: Meisterlala <6453306+Meisterlala@users.noreply.github.com> Date: Fri, 30 Dec 2022 17:07:00 +0100 Subject: [PATCH] Twitter list bug --- Neko/Gui/ImageSourcesWindow.cs | 5 ++++- Neko/Neko.csproj | 2 +- Neko/Neko.json | 2 +- Neko/Plugin.cs | 6 +++++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Neko/Gui/ImageSourcesWindow.cs b/Neko/Gui/ImageSourcesWindow.cs index c25fc09..cc4701e 100644 --- a/Neko/Gui/ImageSourcesWindow.cs +++ b/Neko/Gui/ImageSourcesWindow.cs @@ -608,7 +608,10 @@ private void DrawTwitter() ImGui.SameLine(ImGui.GetWindowContentRegionMax().X - ImGui.GetWindowContentRegionMin().X - length); if (ImGui.Button("Remove##Twitter") && selectedTwitterEntry >= 0) { - Plugin.Config.Sources.Twitter.queries.RemoveAll(q => q == TwitterTableEntries[selectedTwitterEntry].Query); + if (!Plugin.Config.Sources.Twitter.queries.Remove(TwitterTableEntries[selectedTwitterEntry].Query)) + { + PluginLog.LogError("Failed to remove Twitter query: " + TwitterTableEntries[selectedTwitterEntry].Query.searchText); + } TwitterTableEntries.RemoveAt(selectedTwitterEntry); if (TwitterTableEntries.Count == 0) { diff --git a/Neko/Neko.csproj b/Neko/Neko.csproj index 6051512..1d1708e 100644 --- a/Neko/Neko.csproj +++ b/Neko/Neko.csproj @@ -1,7 +1,7 @@  - 1.2.1 + 1.2.2 net6.0-windows latest true diff --git a/Neko/Neko.json b/Neko/Neko.json index dde733c..52a5b00 100644 --- a/Neko/Neko.json +++ b/Neko/Neko.json @@ -4,7 +4,7 @@ "Punchline": "Frustrated in a dungeon? Look at a cute cat girl!", "Description": "Shows you an image of a random neko character. Click on the image to view the next one.\nYou can choose different image sources, allowing you to look at Catboys, Waifus, Cats, Dogs and more.\n\nSupported APIs:\nTwitter, nekos.best, Nekos.life, Catboys, Dog CEO, The Cat API, Pic.re, Waifu.im, Waifu.pics and shibe.online\n\nWarning: You might see naughty images", "InternalName": "Neko", - "AssemblyVersion": "1.2.1", + "AssemblyVersion": "1.2.2", "RepoUrl": "https://github.com/Meisterlala/NekoFans", "ApplicableVersion": "any", "Tags": [ diff --git a/Neko/Plugin.cs b/Neko/Plugin.cs index 22a79ae..96785c2 100644 --- a/Neko/Plugin.cs +++ b/Neko/Plugin.cs @@ -39,7 +39,8 @@ public class Plugin : IDalamudPlugin DefaultRequestHeaders = { UserAgent = { - new($"NekoFans/{Assembly.GetExecutingAssembly().GetName().Version?.ToString()}(a Plugin for Final Fantasy XIV)"), + new("NekoFans", Assembly.GetExecutingAssembly().GetName().Version?.ToString()), + new("(a Plugin for Final Fantasy XIV)") }, }, }; @@ -80,6 +81,9 @@ public void Dispose() { CommandManager.RemoveHandler(CommandConfig); CommandManager.RemoveHandler(CommandMain); + + // Stop loading images + GuiMain?.Slideshow?.Stop(); } public static void UpdateImageSource() => ImageSource.UpdateFrom(Config.LoadSources());