Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor RotationConfigWindow and update submodule #608

Merged
merged 1 commit into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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