From 882099affe6fde5621b3c3de44730e6297e6f3cf Mon Sep 17 00:00:00 2001 From: Infi Date: Sat, 6 Apr 2024 17:35:23 +0200 Subject: [PATCH] Add ko-fi and switch crowdin project --- ChatTwo/ChatTwo.csproj | 2 +- ChatTwo/Resources/Language.Designer.cs | 9 ---- ChatTwo/Resources/Language.de.resx | 3 -- ChatTwo/Resources/Language.es.resx | 3 -- ChatTwo/Resources/Language.fr.resx | 3 -- ChatTwo/Resources/Language.nl.resx | 3 -- ChatTwo/Resources/Language.pt-BR.resx | 3 -- ChatTwo/Resources/Language.resx | 3 -- ChatTwo/Resources/Language.ro.resx | 3 -- ChatTwo/Resources/Language.ru.resx | 3 -- ChatTwo/Resources/Language.sv.resx | 3 -- ChatTwo/Resources/Language.zh-Hans.resx | 3 -- ChatTwo/Resources/Language.zh-Hant.resx | 3 -- ChatTwo/Ui/Settings.cs | 16 ++++-- ChatTwo/Ui/SettingsTabs/About.cs | 65 +++++++++---------------- crowdin.yml | 2 +- 16 files changed, 35 insertions(+), 92 deletions(-) diff --git a/ChatTwo/ChatTwo.csproj b/ChatTwo/ChatTwo.csproj index c3a870a..d462ec6 100755 --- a/ChatTwo/ChatTwo.csproj +++ b/ChatTwo/ChatTwo.csproj @@ -1,7 +1,7 @@ - 1.19.3 + 1.19.4 net8.0-windows enable enable diff --git a/ChatTwo/Resources/Language.Designer.cs b/ChatTwo/Resources/Language.Designer.cs index 4f3d0dd..09b93f0 100755 --- a/ChatTwo/Resources/Language.Designer.cs +++ b/ChatTwo/Resources/Language.Designer.cs @@ -2183,15 +2183,6 @@ namespace ChatTwo.Resources { } } - /// - /// Looks up a localized string similar to Support {0} on Ko-fi. - /// - internal static string Settings_Kofi { - get { - return ResourceManager.GetString("Settings_Kofi", resourceCulture); - } - } - /// /// Looks up a localized string similar to Save. /// diff --git a/ChatTwo/Resources/Language.de.resx b/ChatTwo/Resources/Language.de.resx index 35d5ac4..0964a0b 100644 --- a/ChatTwo/Resources/Language.de.resx +++ b/ChatTwo/Resources/Language.de.resx @@ -235,9 +235,6 @@ Neuer Tab - - {0} auf Ko-fi unterstützen - Speichern und schließen diff --git a/ChatTwo/Resources/Language.es.resx b/ChatTwo/Resources/Language.es.resx index 07f7fce..256defd 100644 --- a/ChatTwo/Resources/Language.es.resx +++ b/ChatTwo/Resources/Language.es.resx @@ -235,9 +235,6 @@ Nueva pestaña - - Apoyar {0} en Ko-fi - Guardar y cerrar diff --git a/ChatTwo/Resources/Language.fr.resx b/ChatTwo/Resources/Language.fr.resx index 1673306..9437c29 100644 --- a/ChatTwo/Resources/Language.fr.resx +++ b/ChatTwo/Resources/Language.fr.resx @@ -235,9 +235,6 @@ Nouvel onglet - - Soutenir {0} sur Ko-fi - Sauvegarder et fermer diff --git a/ChatTwo/Resources/Language.nl.resx b/ChatTwo/Resources/Language.nl.resx index 28033a2..66c05b5 100644 --- a/ChatTwo/Resources/Language.nl.resx +++ b/ChatTwo/Resources/Language.nl.resx @@ -235,9 +235,6 @@ Nieuw Tabblad - - Ondersteun {0} op Ko-fi - Opslaan en afsluiten diff --git a/ChatTwo/Resources/Language.pt-BR.resx b/ChatTwo/Resources/Language.pt-BR.resx index 0f51684..6b6ca48 100644 --- a/ChatTwo/Resources/Language.pt-BR.resx +++ b/ChatTwo/Resources/Language.pt-BR.resx @@ -235,9 +235,6 @@ Nova aba - - Apoie {0} no Ko-fi - Salvar e Fechar diff --git a/ChatTwo/Resources/Language.resx b/ChatTwo/Resources/Language.resx index 49f5bb5..82bbee8 100644 --- a/ChatTwo/Resources/Language.resx +++ b/ChatTwo/Resources/Language.resx @@ -235,9 +235,6 @@ New tab - - Support {0} on Ko-fi - Save and close diff --git a/ChatTwo/Resources/Language.ro.resx b/ChatTwo/Resources/Language.ro.resx index 350783a..35d1804 100644 --- a/ChatTwo/Resources/Language.ro.resx +++ b/ChatTwo/Resources/Language.ro.resx @@ -235,9 +235,6 @@ Tab nou - - Suportă {0} pe Ko-fi - Salvează si închide diff --git a/ChatTwo/Resources/Language.ru.resx b/ChatTwo/Resources/Language.ru.resx index 44d9281..267ee9a 100644 --- a/ChatTwo/Resources/Language.ru.resx +++ b/ChatTwo/Resources/Language.ru.resx @@ -235,9 +235,6 @@ Новая вкладка - - Поддержать {0} через Ko-fi - Сохранить и закрыть diff --git a/ChatTwo/Resources/Language.sv.resx b/ChatTwo/Resources/Language.sv.resx index fd0fd95..b94f6b6 100644 --- a/ChatTwo/Resources/Language.sv.resx +++ b/ChatTwo/Resources/Language.sv.resx @@ -235,9 +235,6 @@ Ny flik - - Stöd {0} på Ko-fi - Spara och stäng diff --git a/ChatTwo/Resources/Language.zh-Hans.resx b/ChatTwo/Resources/Language.zh-Hans.resx index 11304d2..3454a92 100644 --- a/ChatTwo/Resources/Language.zh-Hans.resx +++ b/ChatTwo/Resources/Language.zh-Hans.resx @@ -235,9 +235,6 @@ 新建标签页 - - 在 Ko-Fi 上支持 {0} - 保存并关闭 diff --git a/ChatTwo/Resources/Language.zh-Hant.resx b/ChatTwo/Resources/Language.zh-Hant.resx index e73f655..9f4a1ea 100644 --- a/ChatTwo/Resources/Language.zh-Hant.resx +++ b/ChatTwo/Resources/Language.zh-Hant.resx @@ -235,9 +235,6 @@ 新建標籤頁 - - 在 Ko-Fi 上支持 {0} - 儲存並關閉 diff --git a/ChatTwo/Ui/Settings.cs b/ChatTwo/Ui/Settings.cs index 50a78bc..49e2a50 100755 --- a/ChatTwo/Ui/Settings.cs +++ b/ChatTwo/Ui/Settings.cs @@ -117,7 +117,8 @@ internal sealed class Settings : IUiComponent { this.Ui.SettingsVisible = false; } - var buttonLabel = string.Format(Language.Settings_Kofi, Plugin.PluginName); + var buttonLabel = "Anna's Ko-fi"; + var buttonLabel2 = "Infi's Ko-fi"; ImGui.PushStyleColor(ImGuiCol.Button, ColourUtil.RgbaToAbgr(0xFF5E5BFF)); ImGui.PushStyleColor(ImGuiCol.ButtonHovered, ColourUtil.RgbaToAbgr(0xFF7775FF)); @@ -126,12 +127,17 @@ internal sealed class Settings : IUiComponent { try { var buttonWidth = ImGui.CalcTextSize(buttonLabel).X + ImGui.GetStyle().FramePadding.X * 2; - ImGui.SameLine(ImGui.GetContentRegionAvail().X - buttonWidth); + var buttonWidth2 = ImGui.CalcTextSize(buttonLabel2).X + ImGui.GetStyle().FramePadding.X * 2; + ImGui.SameLine(ImGui.GetContentRegionAvail().X - buttonWidth - buttonWidth2); + + if (ImGui.Button(buttonLabel2)) { + Dalamud.Utility.Util.OpenLink("https://ko-fi.com/infiii"); + } + + ImGui.SameLine(); if (ImGui.Button(buttonLabel)) { - Process.Start(new ProcessStartInfo("https://ko-fi.com/lojewalo") { - UseShellExecute = true, - }); + Dalamud.Utility.Util.OpenLink("https://ko-fi.com/lojewalo"); } } finally { ImGui.PopStyleColor(4); diff --git a/ChatTwo/Ui/SettingsTabs/About.cs b/ChatTwo/Ui/SettingsTabs/About.cs index ad53c71..4c212e2 100755 --- a/ChatTwo/Ui/SettingsTabs/About.cs +++ b/ChatTwo/Ui/SettingsTabs/About.cs @@ -1,4 +1,3 @@ -using System.Diagnostics; using System.Numerics; using ChatTwo.Resources; using ChatTwo.Util; @@ -10,37 +9,21 @@ namespace ChatTwo.Ui.SettingsTabs; internal sealed class About : ISettingsTab { public string Name => string.Format(Language.Options_About_Tab, Plugin.PluginName) + "###tabs-about"; - private readonly List _translators = new() { - "q673135110", - "Akizem", - "d0tiKs", - "Moonlight_Everlit", - "Dark32", - "andreycout", - "Button_", - "Cali666", - "cassandra308", - "lokinmodar", - "jtabox", - "AkiraYorumoto", - "MKhayle", - "elena.space", - "imlisa", - "andrei5125", - "ShivaMaheshvara", - "aislinn87", - "nishinatsu051", - "lichuyuan", - "Risu64", - "yummypillow", - "witchymary", - "Yuzumi", - "zomsakura", - "Sirayuki", - }; + private readonly List _translators = + [ + "q673135110", "Akizem", "d0tiKs", + "Moonlight_Everlit", "Dark32", "andreycout", + "Button_", "Cali666", "cassandra308", + "lokinmodar", "jtabox", "AkiraYorumoto", + "MKhayle", "elena.space", "imlisa", + "andrei5125", "ShivaMaheshvara", "aislinn87", + "nishinatsu051", "lichuyuan", "Risu64", + "yummypillow", "witchymary", "Yuzumi", + "zomsakura", "Sirayuki" + ]; internal About() { - this._translators.Sort((a, b) => string.Compare(a.ToLowerInvariant(), b.ToLowerInvariant(), StringComparison.Ordinal)); + _translators.Sort((a, b) => string.Compare(a.ToLowerInvariant(), b.ToLowerInvariant(), StringComparison.Ordinal)); } public void Draw(bool changed) { @@ -50,19 +33,17 @@ internal sealed class About : ISettingsTab { ImGui.Spacing(); - if (ImGuiUtil.IconButton(FontAwesomeIcon.ExternalLinkAlt, "clickup")) { - Process.Start(new ProcessStartInfo("https://sharing.clickup.com/b/h/6-122378074-2/1047d21a39a4140") { - UseShellExecute = true, - }); + if (ImGuiUtil.IconButton(FontAwesomeIcon.ExternalLinkAlt, "clickup")) + { + Dalamud.Utility.Util.OpenLink("https://sharing.clickup.com/b/h/6-122378074-2/1047d21a39a4140"); } ImGui.SameLine(); ImGui.TextUnformatted(Language.Options_About_ClickUp); - if (ImGuiUtil.IconButton(FontAwesomeIcon.ExternalLinkAlt, "crowdin")) { - Process.Start(new ProcessStartInfo("https://crowdin.com/project/chat-2") { - UseShellExecute = true, - }); + if (ImGuiUtil.IconButton(FontAwesomeIcon.ExternalLinkAlt, "crowdin")) + { + Dalamud.Utility.Util.OpenLink("https://crowdin.com/project/chattwo"); } ImGui.SameLine(); @@ -70,13 +51,11 @@ internal sealed class About : ISettingsTab { ImGui.Spacing(); - var height = ImGui.GetContentRegionAvail().Y - - ImGui.CalcTextSize("A").Y - - ImGui.GetStyle().ItemSpacing.Y * 2; + var height = ImGui.GetContentRegionAvail().Y - ImGui.CalcTextSize("A").Y - ImGui.GetStyle().ItemSpacing.Y * 2; if (ImGui.BeginChild("about", new Vector2(-1, height))) { if (ImGui.TreeNodeEx(Language.Options_About_Translators)) { if (ImGui.BeginChild("translators")) { - foreach (var translator in this._translators) { + foreach (var translator in _translators) { ImGui.TextUnformatted(translator); } @@ -89,7 +68,7 @@ internal sealed class About : ISettingsTab { ImGui.EndChild(); } - ImGuiUtil.HelpText($"{Plugin.PluginName} v{this.GetType().Assembly.GetName().Version?.ToString(3)}"); + ImGuiUtil.HelpText($"{Plugin.PluginName} v{GetType().Assembly.GetName().Version?.ToString(3)}"); ImGui.PopTextWrapPos(); } } diff --git a/crowdin.yml b/crowdin.yml index c3e0c97..e7418ba 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -1,4 +1,4 @@ -"project_id" : "498233" +"project_id" : "663694" "base_path" : "." "base_url" : "https://api.crowdin.com" "preserve_hierarchy": true