refactor(ui): route OpenLink call-sites through Plugin.PlatformUtil (F12.1)
Ten Util.OpenLink call-sites across five files now go through the IPlatformUtil indirection: WrapperUtil.TryOpenUri, the Settings Ko-Fi buttons (x2), the Information tab (issues link plus media/upstream links, x3), the Integrations tab (Honorific repo/author plus forge discord, x3), and the ThemeAndLayout 'open themes folder' button. A future addition to this pattern only needs to plug into IPlatformUtil instead of touching Dalamud.Utility.Util directly.
This commit is contained in:
@@ -199,12 +199,12 @@ public sealed class SettingsWindow : Dalamud.Interface.Windowing.Window
|
||||
);
|
||||
|
||||
if (ImGui.Button(buttonLabel2))
|
||||
Dalamud.Utility.Util.OpenLink("https://ko-fi.com/infiii");
|
||||
Plugin.PlatformUtil.OpenLink("https://ko-fi.com/infiii");
|
||||
|
||||
ImGui.SameLine();
|
||||
|
||||
if (ImGui.Button(buttonLabel))
|
||||
Dalamud.Utility.Util.OpenLink("https://ko-fi.com/lojewalo");
|
||||
Plugin.PlatformUtil.OpenLink("https://ko-fi.com/lojewalo");
|
||||
}
|
||||
|
||||
if (!save)
|
||||
|
||||
@@ -97,7 +97,7 @@ internal sealed class Information : ISettingsTab
|
||||
ImGui.TextUnformatted(Language.Options_About_Github_Issues);
|
||||
ImGui.SameLine();
|
||||
if (ImGuiUtil.IconButton(FontAwesomeIcon.ExternalLinkAlt, "githubIssues"))
|
||||
Dalamud.Utility.Util.OpenLink(
|
||||
Plugin.PlatformUtil.OpenLink(
|
||||
"https://gitea.hellion-forge.cloud/JonKazama-Hellion/HellionChat/issues"
|
||||
);
|
||||
}
|
||||
@@ -116,7 +116,7 @@ internal sealed class Information : ISettingsTab
|
||||
ImGui.TextUnformatted(HellionStrings.About_Maintainer_Website_Label);
|
||||
ImGui.SameLine();
|
||||
if (ImGuiUtil.IconButton(FontAwesomeIcon.ExternalLinkAlt, "hellionMedia"))
|
||||
Dalamud.Utility.Util.OpenLink("https://hellion-media.de");
|
||||
Plugin.PlatformUtil.OpenLink("https://hellion-media.de");
|
||||
|
||||
ImGuiHelpers.ScaledDummy(10.0f);
|
||||
|
||||
@@ -137,7 +137,7 @@ internal sealed class Information : ISettingsTab
|
||||
ImGui.TextUnformatted(HellionStrings.About_BuiltOn_Upstream_Label);
|
||||
ImGui.SameLine();
|
||||
if (ImGuiUtil.IconButton(FontAwesomeIcon.ExternalLinkAlt, "chatTwoUpstream"))
|
||||
Dalamud.Utility.Util.OpenLink("https://github.com/Infiziert90/ChatTwo");
|
||||
Plugin.PlatformUtil.OpenLink("https://github.com/Infiziert90/ChatTwo");
|
||||
|
||||
ImGuiHelpers.ScaledDummy(10.0f);
|
||||
|
||||
|
||||
@@ -79,12 +79,12 @@ internal sealed class Integrations : ISettingsTab
|
||||
ImGui.Spacing();
|
||||
if (ImGui.Button(HellionStrings.Settings_Integrations_Honorific_LinkRepo))
|
||||
{
|
||||
Dalamud.Utility.Util.OpenLink(IntegrationLinks.HonorificRepo);
|
||||
Plugin.PlatformUtil.OpenLink(IntegrationLinks.HonorificRepo);
|
||||
}
|
||||
ImGui.SameLine();
|
||||
if (ImGui.Button(HellionStrings.Settings_Integrations_Honorific_LinkAuthor))
|
||||
{
|
||||
Dalamud.Utility.Util.OpenLink(IntegrationLinks.HonorificAuthor);
|
||||
Plugin.PlatformUtil.OpenLink(IntegrationLinks.HonorificAuthor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ internal sealed class Integrations : ISettingsTab
|
||||
|
||||
if (ImGui.Button(HellionStrings.Settings_Integrations_GotAnIdea_LinkLabel))
|
||||
{
|
||||
Dalamud.Utility.Util.OpenLink(BrandingLinks.HellionForgeDiscordInvite);
|
||||
Plugin.PlatformUtil.OpenLink(BrandingLinks.HellionForgeDiscordInvite);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ internal sealed class ThemeAndLayout : ISettingsTab
|
||||
{
|
||||
var dir = Path.Combine(Plugin.Interface.ConfigDirectory.FullName, "themes");
|
||||
Directory.CreateDirectory(dir);
|
||||
Dalamud.Utility.Util.OpenLink(dir);
|
||||
Plugin.PlatformUtil.OpenLink(dir);
|
||||
}
|
||||
|
||||
ImGui.SameLine();
|
||||
|
||||
@@ -22,7 +22,7 @@ public static class WrapperUtil
|
||||
try
|
||||
{
|
||||
Plugin.Log.Debug($"Opening URI {uri} in default browser");
|
||||
Dalamud.Utility.Util.OpenLink(uri.ToString());
|
||||
Plugin.PlatformUtil.OpenLink(uri.ToString());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user