fix: open localised lodestone

This commit is contained in:
Anna 2022-07-09 13:49:30 -04:00
parent cdb89fed1e
commit 625582e970
Signed by: anna
GPG Key ID: 0B391D8F06FCD9E0
1 changed files with 12 additions and 1 deletions

View File

@ -2,6 +2,7 @@ using System.Diagnostics;
using System.Numerics;
using System.Text;
using System.Threading.Channels;
using Dalamud;
using Dalamud.Interface;
using Dalamud.Plugin;
using ExtraChat.Protocol;
@ -421,8 +422,18 @@ internal class PluginUi : IDisposable {
ImGui.SameLine();
if (ImGui.Button("Open profile")) {
var region = this.Plugin.LocalPlayer?.HomeWorld.GameData?.DataCenter.Value?.Region ?? 2;
var sub = this.Plugin.ClientState.ClientLanguage switch {
ClientLanguage.Japanese => "jp",
ClientLanguage.English when region != 2 => "eu",
ClientLanguage.English => "na",
ClientLanguage.German => "de",
ClientLanguage.French => "fr",
_ => "na",
};
Process.Start(new ProcessStartInfo {
FileName = "https://na.finalfantasyxiv.com/lodestone/my/setting/profile/",
FileName = $"https://{sub}.finalfantasyxiv.com/lodestone/my/setting/profile/",
UseShellExecute = true,
});
}