Skip to content

Commit

Permalink
Merge pull request #608 from FFXIV-CombatReborn/hotfix69
Browse files Browse the repository at this point in the history
Refactor RotationConfigWindow and update submodule
  • Loading branch information
LTS-FFXIV authored Jan 31, 2025
2 parents bf31547 + 4d3d21f commit 5047caa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
2 changes: 1 addition & 1 deletion ECommons
19 changes: 7 additions & 12 deletions RotationSolver/UI/RotationConfigWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,22 +145,17 @@ private static void DrawDutyRotation()
private void DrawErrorZone()
{
var incompatiblePlugins = DownloadHelper.IncompatiblePlugins ?? Array.Empty<IncompatiblePlugin>();
var installedIncompatiblePlugin = incompatiblePlugins.FirstOrDefault(p => p.IsInstalled && (int)p.Type == 5);

bool hasIncompatiblePlugin = incompatiblePlugins.Any(p => p.IsInstalled);

if (hasIncompatiblePlugin)
if (installedIncompatiblePlugin.Name != null)
{
string message = "Disable incompatible plugin";
var installedPlugin = incompatiblePlugins.FirstOrDefault(p => p.IsInstalled);
message = $"Disable {installedPlugin.Name}, causes targetting issues.";
string message = $"Disable {installedIncompatiblePlugin.Name}, causes targetting issues.";

float availableWidth = ImGui.GetContentRegionAvail().X; // Get the available width dynamically
using (var color = ImRaii.PushColor(ImGuiCol.Text, ImGui.ColorConvertFloat4ToU32(ImGuiColors.DalamudOrange)))
{
ImGui.PushTextWrapPos(ImGui.GetCursorPos().X + availableWidth); // Set text wrapping position dynamically
ImGui.Text(message);
ImGui.PopTextWrapPos(); // Reset text wrapping position
}
using var color = ImRaii.PushColor(ImGuiCol.Text, ImGui.ColorConvertFloat4ToU32(ImGuiColors.DalamudOrange));
ImGui.PushTextWrapPos(ImGui.GetCursorPos().X + availableWidth); // Set text wrapping position dynamically
ImGui.Text(message);
ImGui.PopTextWrapPos(); // Reset text wrapping position
}

if (DataCenter.SystemWarnings != null && DataCenter.SystemWarnings.Any())
Expand Down

0 comments on commit 5047caa

Please sign in to comment.