Skip to content

Commit

Permalink
code analyzer fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
CarnifexOptimus committed Jun 5, 2024
1 parent 8a9ce38 commit d6f9530
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion BossMod/AI/AIManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Dalamud.Game.Text.SeStringHandling;
using Dalamud.Game.Text.SeStringHandling.Payloads;
using ImGuiNET;
using System.Globalization;

namespace BossMod.AI;

Expand Down Expand Up @@ -280,7 +281,7 @@ private void OnCommand(string cmd, string message)

private void SetPositional(string positional)
{
switch (positional.ToLower())
switch (positional.ToLower(CultureInfo.InvariantCulture))
{
case "any":
_config.DesiredPositional = Positional.Any;
Expand Down
8 changes: 4 additions & 4 deletions BossMod/Config/ConfigUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,18 @@ private void DrawInformation()
ImGui.Text("Please do not ask him for any support for problems you encounter while using this fork.");
ImGui.Spacing();
ImGui.Text("Instead visit the Combat Reborn Discord and ask for support there:");
RenderTextWithLink("https://discord.gg/p54TZMPnC9", "https://discord.gg/p54TZMPnC9");
RenderTextWithLink("https://discord.gg/p54TZMPnC9", new Uri("https://discord.gg/p54TZMPnC9"));
}

static void RenderTextWithLink(string displayText, string url)
static void RenderTextWithLink(string displayText, Uri url)
{
ImGui.PushID(url);
ImGui.PushID(url.ToString());
ImGui.Text(displayText);
if (ImGui.IsItemHovered())
{
ImGui.SetMouseCursor(ImGuiMouseCursor.Hand);
if (ImGui.IsMouseClicked(ImGuiMouseButton.Left))
Process.Start(new ProcessStartInfo(url) { UseShellExecute = true });
Process.Start(new ProcessStartInfo(url.ToString()) { UseShellExecute = true });
}
var textSize = ImGui.CalcTextSize(displayText);
var drawList = ImGui.GetWindowDrawList();
Expand Down

0 comments on commit d6f9530

Please sign in to comment.