+ Switch to dalamud method for opening URLs
+ Fix popout min size
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Version>1.20.0</Version>
|
<Version>1.20.1</Version>
|
||||||
<TargetFramework>net8.0-windows</TargetFramework>
|
<TargetFramework>net8.0-windows</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
|
|||||||
+1
-3
@@ -157,7 +157,7 @@ internal class Message {
|
|||||||
/// It matches URLs with www. or https:// prefix, and also matches URLs
|
/// It matches URLs with www. or https:// prefix, and also matches URLs
|
||||||
/// without a prefix on specific TLDs.
|
/// without a prefix on specific TLDs.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private static Regex URLRegex = new Regex(
|
private static Regex URLRegex = new(
|
||||||
@"((https?:\/\/|www\.)[a-z0-9-]+(\.[a-z0-9-]+)*|([a-z0-9-]+(\.[a-z0-9-]+)*\.(com|net|org|co|io|app)))(:[\d]{1,5})?(\/[^\s]+)?",
|
@"((https?:\/\/|www\.)[a-z0-9-]+(\.[a-z0-9-]+)*|([a-z0-9-]+(\.[a-z0-9-]+)*\.(com|net|org|co|io|app)))(:[\d]{1,5})?(\/[^\s]+)?",
|
||||||
RegexOptions.Compiled | RegexOptions.IgnoreCase
|
RegexOptions.Compiled | RegexOptions.IgnoreCase
|
||||||
);
|
);
|
||||||
@@ -218,10 +218,8 @@ internal class Message {
|
|||||||
|
|
||||||
// Add the text after the last URL.
|
// Add the text after the last URL.
|
||||||
if (remainderIndex < text.Content.Length)
|
if (remainderIndex < text.Content.Length)
|
||||||
{
|
|
||||||
AddChunkWithMessage(text.NewWithStyle(chunk.Source, null, text.Content[remainderIndex..]));
|
AddChunkWithMessage(text.NewWithStyle(chunk.Source, null, text.Content[remainderIndex..]));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return newChunks;
|
return newChunks;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ using Lumina.Excel.GeneratedSheets;
|
|||||||
using Action = System.Action;
|
using Action = System.Action;
|
||||||
using DalamudPartyFinderPayload = Dalamud.Game.Text.SeStringHandling.Payloads.PartyFinderPayload;
|
using DalamudPartyFinderPayload = Dalamud.Game.Text.SeStringHandling.Payloads.PartyFinderPayload;
|
||||||
using ChatTwoPartyFinderPayload = ChatTwo.Util.PartyFinderPayload;
|
using ChatTwoPartyFinderPayload = ChatTwo.Util.PartyFinderPayload;
|
||||||
using System.Diagnostics;
|
|
||||||
|
|
||||||
namespace ChatTwo;
|
namespace ChatTwo;
|
||||||
|
|
||||||
@@ -681,8 +680,8 @@ public sealed class PayloadHandler {
|
|||||||
new Thread(() => {
|
new Thread(() => {
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Plugin.Log.Info($"Opening URI {uri} in default browser");
|
Plugin.Log.Debug($"Opening URI {uri} in default browser");
|
||||||
Process.Start(new ProcessStartInfo(uri.ToString()) { UseShellExecute = true });
|
Dalamud.Utility.Util.OpenLink(uri.ToString());
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -16,12 +16,8 @@ internal class Popout : Window
|
|||||||
Tab = tab;
|
Tab = tab;
|
||||||
Idx = idx;
|
Idx = idx;
|
||||||
|
|
||||||
|
Size = new Vector2(350, 350);
|
||||||
SizeCondition = ImGuiCond.FirstUseEver;
|
SizeCondition = ImGuiCond.FirstUseEver;
|
||||||
SizeConstraints = new WindowSizeConstraints
|
|
||||||
{
|
|
||||||
MinimumSize = new Vector2(350, 350),
|
|
||||||
MaximumSize = new Vector2(float.MaxValue, float.MaxValue)
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void PreDraw()
|
public override void PreDraw()
|
||||||
|
|||||||
Reference in New Issue
Block a user