From 0ed5ec3a318126bac79dea295deb9ed956713426 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=8B=E6=B0=B4?= <1123993881@qq.com> Date: Tue, 3 Oct 2023 09:32:01 +0800 Subject: [PATCH] fix: add supporters list in about page. --- ECommons | 2 +- Resources/Supporters.json | 25 +++++++++++++++++++++++ RotationSolver/Helpers/DownloadHelper.cs | 3 +++ RotationSolver/Localization/Strings.cs | 2 ++ RotationSolver/UI/RotationConfigWindow.cs | 21 +++++++++++++++++++ 5 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 Resources/Supporters.json diff --git a/ECommons b/ECommons index ee1f83685..1ad0decf6 160000 --- a/ECommons +++ b/ECommons @@ -1 +1 @@ -Subproject commit ee1f8368541e5f82e820bebae40731ee79862397 +Subproject commit 1ad0decf6d6a169dc0d5779b1c40a5ca733a51d0 diff --git a/Resources/Supporters.json b/Resources/Supporters.json new file mode 100644 index 000000000..21fb9eeb9 --- /dev/null +++ b/Resources/Supporters.json @@ -0,0 +1,25 @@ +[ + "Constantinescu Marius", + "lizardbreath", + "Kito Kito ✨", + "Iugh", + "Chan Myae Thu", + "Poireau", + "Ishtaria", + "McGlub", + "Sinclair", + "Hanako Yoshimura", + "Unavailable", + "LTS", + "Pee Pee", + "Desunya", + "AussieGlenn", + "Shutup2hu", + "IncognitoWater", + "Artemiss", + "Konta", + "Luai", + "Arke", + "Pee Pee", + "Ray Chan" +] \ No newline at end of file diff --git a/RotationSolver/Helpers/DownloadHelper.cs b/RotationSolver/Helpers/DownloadHelper.cs index 28920260f..22d358417 100644 --- a/RotationSolver/Helpers/DownloadHelper.cs +++ b/RotationSolver/Helpers/DownloadHelper.cs @@ -10,6 +10,7 @@ public static class DownloadHelper public static string[] LinkLibraries { get; private set; } = Array.Empty(); public static string[] ContributorsHash { get; private set; } = Array.Empty(); public static string[] UsersHash { get; private set; } = Array.Empty(); + public static string[] Supporters { get; private set; } = Array.Empty(); public static IncompatiblePlugin[] IncompatiblePlugins { get; private set; } = Array.Empty(); public static async Task DownloadAsync() @@ -20,6 +21,8 @@ public static async Task DownloadAsync() ContributorsHash = await DownloadOneAsync($"https://raw.githubusercontent.com/{Service.USERNAME}/{Service.REPO}/main/Resources/ContributorsHash.json") ?? Array.Empty(); UsersHash = await DownloadOneAsync($"https://raw.githubusercontent.com/{Service.USERNAME}/{Service.REPO}/main/Resources/UsersHash.json") ?? Array.Empty(); + + Supporters = await DownloadOneAsync($"https://raw.githubusercontent.com/{Service.USERNAME}/{Service.REPO}/main/Resources/Supporters.json") ?? Array.Empty(); } private static async Task DownloadOneAsync(string url) diff --git a/RotationSolver/Localization/Strings.cs b/RotationSolver/Localization/Strings.cs index 5e2f47fcd..3acc91991 100644 --- a/RotationSolver/Localization/Strings.cs +++ b/RotationSolver/Localization/Strings.cs @@ -620,6 +620,7 @@ internal class Strings public string ConfigWindow_About_Macros { get; set; } = "Macros"; public string ConfigWindow_About_Links { get; set; } = "Links"; public string ConfigWindow_About_Compatibility { get; set; } = "Compatibility"; + public string ConfigWindow_About_Supporters { get; set; } = "Supporters"; public string ConfigWindow_About_Compatibility_Description { get; set; } = "Literally, Rotation Solver helps you to choose the target and then click the action. So any plugin that changes these will affect its decision.\n\nHere is a list of known incompatible plugins:"; public string ConfigWindow_About_Compatibility_Others { get; set; } = "Please don't relog without closing the game. Crashes may occur."; @@ -753,4 +754,5 @@ internal class Strings public string ConfigWindow_About_Clicking100k { get; set; } = "Well, you must be a lazy player!"; public string ConfigWindow_About_Clicking500k { get; set; } = "You're tiring RS out, give it a break!"; + public string ConfigWindow_About_ThanksToSupporters { get; set; } = "Many thanks to the sponsors."; } \ No newline at end of file diff --git a/RotationSolver/UI/RotationConfigWindow.cs b/RotationSolver/UI/RotationConfigWindow.cs index ea466276b..57b52ecaf 100644 --- a/RotationSolver/UI/RotationConfigWindow.cs +++ b/RotationSolver/UI/RotationConfigWindow.cs @@ -22,6 +22,8 @@ using RotationSolver.UI.SearchableSettings; using RotationSolver.Updaters; using System.Diagnostics; +using System.Diagnostics.Metrics; +using System.Xml.Linq; using GAction = Lumina.Excel.GeneratedSheets.Action; namespace RotationSolver.UI; @@ -528,6 +530,7 @@ private static void DrawAbout() { { () => LocalizationManager.RightLang.ConfigWindow_About_Macros, DrawAboutMacros}, { () => LocalizationManager.RightLang.ConfigWindow_About_Compatibility, DrawAboutCompatibility}, + { () => LocalizationManager.RightLang.ConfigWindow_About_Supporters, DrawAboutSupporters}, { () => LocalizationManager.RightLang.ConfigWindow_About_Links, DrawAboutLinks}, }); @@ -643,6 +646,24 @@ private static void DrawAboutCompatibility() } } } + private static void DrawAboutSupporters() + { + ImGui.TextWrapped(LocalizationManager.RightLang.ConfigWindow_About_ThanksToSupporters); + + var width = ImGui.GetWindowWidth(); + using (var font = ImRaii.PushFont(ImGuiHelper.GetFont(12))) + { + using var color = ImRaii.PushColor(ImGuiCol.Text, ImGui.ColorConvertFloat4ToU32(ImGuiColors.DalamudYellow)); + + foreach (var name in DownloadHelper.Supporters) + { + ImGuiHelper.DrawItemMiddle(() => + { + ImGui.TextWrapped(name); + }, width, ImGui.CalcTextSize(name).X); + } + } + } private static void DrawAboutLinks() {