- Loc updates

- Add access URL to webinterface panel
This commit is contained in:
Infi
2024-08-28 14:31:25 +02:00
parent 2ababa82b0
commit 8d6f59f9fa
5 changed files with 59 additions and 26 deletions
+16 -1
View File
@@ -1,4 +1,5 @@
using Dalamud.Interface.ImGuiNotification;
using ChatTwo.Resources;
using Dalamud.Interface.ImGuiNotification;
namespace ChatTwo.Util;
@@ -9,6 +10,20 @@ public static class WrapperUtil
Plugin.Notification.AddNotification(new Notification { Content = content, Type = type, Minimized = minimized });
}
public static void TryOpenURI(Uri uri)
{
try
{
Plugin.Log.Debug($"Opening URI {uri} in default browser");
Dalamud.Utility.Util.OpenLink(uri.ToString());
}
catch (Exception ex)
{
Plugin.Log.Error($"Error opening URI: {ex}");
AddNotification(Language.Context_OpenInBrowserError, NotificationType.Error);
}
}
public static IEnumerable<(T Value, int Index)> WithIndex<T>(this IEnumerable<T> list)
=> list.Select((x, i) => (x, i));
}