Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
fix: add supporters list in about page.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Oct 3, 2023
1 parent 7578487 commit 0ed5ec3
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 1 deletion.
25 changes: 25 additions & 0 deletions Resources/Supporters.json
Original file line number Diff line number Diff line change
@@ -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"
]
3 changes: 3 additions & 0 deletions RotationSolver/Helpers/DownloadHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public static class DownloadHelper
public static string[] LinkLibraries { get; private set; } = Array.Empty<string>();
public static string[] ContributorsHash { get; private set; } = Array.Empty<string>();
public static string[] UsersHash { get; private set; } = Array.Empty<string>();
public static string[] Supporters { get; private set; } = Array.Empty<string>();
public static IncompatiblePlugin[] IncompatiblePlugins { get; private set; } = Array.Empty<IncompatiblePlugin>();

public static async Task DownloadAsync()
Expand All @@ -20,6 +21,8 @@ public static async Task DownloadAsync()
ContributorsHash = await DownloadOneAsync<string[]>($"https://raw.githubusercontent.com/{Service.USERNAME}/{Service.REPO}/main/Resources/ContributorsHash.json") ?? Array.Empty<string>();

UsersHash = await DownloadOneAsync<string[]>($"https://raw.githubusercontent.com/{Service.USERNAME}/{Service.REPO}/main/Resources/UsersHash.json") ?? Array.Empty<string>();

Supporters = await DownloadOneAsync<string[]>($"https://raw.githubusercontent.com/{Service.USERNAME}/{Service.REPO}/main/Resources/Supporters.json") ?? Array.Empty<string>();
}

private static async Task<T> DownloadOneAsync<T>(string url)
Expand Down
2 changes: 2 additions & 0 deletions RotationSolver/Localization/Strings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.";

Expand Down Expand Up @@ -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.";
}
21 changes: 21 additions & 0 deletions RotationSolver/UI/RotationConfigWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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},
});

Expand Down Expand Up @@ -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()
{
Expand Down

0 comments on commit 0ed5ec3

Please sign in to comment.