From b6217a1125ad8e7081f4ba7f76f40e3d6b034661 Mon Sep 17 00:00:00 2001 From: RisaDev <151885272+RisaDev@users.noreply.github.com> Date: Sat, 23 Nov 2024 21:37:35 +0300 Subject: [PATCH] Donation button, change log --- CustomizePlus/UI/Windows/CPlusChangeLog.cs | 13 ++++++++-- .../UI/Windows/MainWindow/Tabs/SettingsTab.cs | 24 +++++++++++-------- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/CustomizePlus/UI/Windows/CPlusChangeLog.cs b/CustomizePlus/UI/Windows/CPlusChangeLog.cs index fe180c4..a90c4ac 100644 --- a/CustomizePlus/UI/Windows/CPlusChangeLog.cs +++ b/CustomizePlus/UI/Windows/CPlusChangeLog.cs @@ -26,6 +26,7 @@ public class CPlusChangeLog Add2_0_6_3(Changelog); Add2_0_7_0(Changelog); Add2_0_7_2(Changelog); + Add2_0_7_9(Changelog); } private (int, ChangeLogDisplayType) ConfigData() @@ -38,11 +39,19 @@ public class CPlusChangeLog _config.Save(); } + private static void Add2_0_7_9(Changelog log) + => log.NextVersion("Version 2.0.7.9") + .RegisterEntry("Added donation button to settings tab.") + .RegisterEntry("Saving changes to the template used in the active profile will now tell other plugins that the profile was changed by sending OnProfileUpdate IPC event. (2.0.7.8)") + .RegisterEntry("Root bone position edits no longer require character to move in order to apply. (2.0.7.6)") + + .RegisterEntry("Fixed \"Apply to any character you are logged in with\" profile option being ignored by Profile.GetActiveProfileIdOnCharacter IPC function preventing other plugins from being able to detect active profile with this option enabled. (2.0.7.8)") + + .RegisterEntry("Source code maintenance - external libraries update."); + private static void Add2_0_7_2(Changelog log) => log.NextVersion("Version 2.0.7.2") .RegisterHighlight("Support for 7.1 and Dalamud API 11.") - //.RegisterImportant("As an experiment Customize+ will no longer run if you are running testing or development version of Dalamud. Please leave your feedback about this change in support Discord.") - //.RegisterEntry("Developers can prevent this from triggering by manually compiling \"Debug\" or \"ReleaseValidate\" builds of Customize+.", 1) .RegisterHighlight("Fixed an issue which prevented owned characters (such as Carbuncles and Trust NPCs) from being detected. (2.0.7.1)") .RegisterEntry("Source code maintenance - external libraries update."); diff --git a/CustomizePlus/UI/Windows/MainWindow/Tabs/SettingsTab.cs b/CustomizePlus/UI/Windows/MainWindow/Tabs/SettingsTab.cs index 2287d63..65fad7c 100644 --- a/CustomizePlus/UI/Windows/MainWindow/Tabs/SettingsTab.cs +++ b/CustomizePlus/UI/Windows/MainWindow/Tabs/SettingsTab.cs @@ -21,6 +21,7 @@ namespace CustomizePlus.UI.Windows.MainWindow.Tabs; public class SettingsTab { private const uint DiscordColor = 0xFFDA8972; + private const uint DonateColor = 0xFF5B5EFF; private readonly IDalamudPluginInterface _pluginInterface; private readonly PluginConfiguration _configuration; @@ -63,6 +64,7 @@ public class SettingsTab ImGui.NewLine(); ImGui.NewLine(); ImGui.NewLine(); + ImGui.NewLine(); using (var child2 = ImRaii.Child("SettingsChild")) { @@ -366,9 +368,12 @@ public class SettingsTab xPos -= ImGui.GetStyle().ScrollbarSize + ImGui.GetStyle().FramePadding.X; ImGui.SetCursorPos(new Vector2(xPos, 0)); - DrawDiscordButton(width); + DrawUrlButton("Join Discord for Support", "https://discord.gg/KvGJCCnG8t", DiscordColor, width); - ImGui.SetCursorPos(new Vector2(xPos, 1 * ImGui.GetFrameHeightWithSpacing())); + ImGui.SetCursorPos(new Vector2(xPos, ImGui.GetFrameHeightWithSpacing())); + DrawUrlButton("Support developer using Ko-fi", "https://ko-fi.com/risadev", DonateColor, width); + + ImGui.SetCursorPos(new Vector2(xPos, 2 * ImGui.GetFrameHeightWithSpacing())); if (ImGui.Button("Copy Support Info to Clipboard")) { var text = _supportLogBuilderService.BuildSupportLog(); @@ -376,20 +381,19 @@ public class SettingsTab _messageService.NotificationMessage($"Copied Support Info to Clipboard.", NotificationType.Success, false); } - ImGui.SetCursorPos(new Vector2(xPos, 2 * ImGui.GetFrameHeightWithSpacing())); + ImGui.SetCursorPos(new Vector2(xPos, 3 * ImGui.GetFrameHeightWithSpacing())); if (ImGui.Button("Show update history", new Vector2(width, 0))) _changeLog.Changelog.ForceOpen = true; } /// Draw a button to open the official discord server. - private void DrawDiscordButton(float width) + private void DrawUrlButton(string text, string url, uint buttonColor, float width) { - const string address = @"https://discord.gg/KvGJCCnG8t"; - using var color = ImRaii.PushColor(ImGuiCol.Button, DiscordColor); - if (ImGui.Button("Join Discord for Support", new Vector2(width, 0))) + using var color = ImRaii.PushColor(ImGuiCol.Button, buttonColor); + if (ImGui.Button(text, new Vector2(width, 0))) try { - var process = new ProcessStartInfo(address) + var process = new ProcessStartInfo(url) { UseShellExecute = true, }; @@ -397,10 +401,10 @@ public class SettingsTab } catch { - _messageService.NotificationMessage($"Unable to open Discord at {address}.", NotificationType.Error, false); + _messageService.NotificationMessage($"Unable to open url {url}.", NotificationType.Error, false); } - ImGuiUtil.HoverTooltip($"Open {address}"); + ImGuiUtil.HoverTooltip($"Open {url}"); } #endregion }