mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-14 12:44:19 +01:00
Add Join Discord button.
This commit is contained in:
parent
1874de38d0
commit
e5b739fc52
2 changed files with 30 additions and 0 deletions
|
|
@ -47,6 +47,7 @@ public partial class ConfigWindow
|
|||
DrawAdvancedSettings();
|
||||
|
||||
_dialogManager.Draw();
|
||||
DrawDiscordButton();
|
||||
}
|
||||
|
||||
// Changing the base mod directory.
|
||||
|
|
@ -199,5 +200,33 @@ public partial class ConfigWindow
|
|||
|
||||
ImGui.NewLine();
|
||||
}
|
||||
|
||||
private static void DrawDiscordButton()
|
||||
{
|
||||
const string discord = "Join Discord for Support";
|
||||
const string address = @"https://discord.gg/kVva7DHV4r";
|
||||
var width = ImGui.CalcTextSize( discord ).X + ImGui.GetStyle().FramePadding.X * 2;
|
||||
if( ImGui.GetScrollMaxY() > 0 )
|
||||
width += ImGui.GetStyle().ScrollbarSize + ImGui.GetStyle().ItemSpacing.X;
|
||||
ImGui.SetCursorPos( new Vector2( ImGui.GetWindowWidth() - width, 0 ) );
|
||||
using var color = ImRaii.PushColor( ImGuiCol.Button, Colors.DiscordColor );
|
||||
if( ImGui.Button( discord ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
var process = new ProcessStartInfo( address )
|
||||
{
|
||||
UseShellExecute = true,
|
||||
};
|
||||
Process.Start( process );
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
|
||||
ImGuiUtil.HoverTooltip( $"Open {address}" );
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue