Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
fix: scary don't crash! Come on, Dalamud!
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Aug 19, 2023
1 parent a7ec210 commit 883da6f
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion RotationSolver/UI/RotationConfigWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,24 @@ public override void Draw()
{
try
{
if (ImGui.BeginTable("Rotation Config Table", 2, ImGuiTableFlags.Resizable))
var leftTop = ImGui.GetWindowPos() + ImGui.GetCursorPos();
var rightDown = leftTop + ImGui.GetWindowSize();
var screenSize = ImGuiHelpers.MainViewport.Size;
if (leftTop.X <= 0 || leftTop.Y <= 0 || rightDown.X >= screenSize.X || rightDown.Y >= screenSize.Y)
{
var str = string.Empty;
for (int i = 0; i < 150; i++)
{
str += "Move away! Don't crash! ";
}

ImGui.PushFont(ImGuiHelper.GetFont(24));
ImGui.PushStyleColor(ImGuiCol.Text, ImGui.ColorConvertFloat4ToU32(ImGuiColors.DalamudYellow));
ImGui.TextWrapped(str);
ImGui.PopStyleColor();
ImGui.PopFont();
}
else if (ImGui.BeginTable("Rotation Config Table", 2, ImGuiTableFlags.Resizable))
{
ImGui.TableSetupColumn("Rotation Config Side Bar", ImGuiTableColumnFlags.WidthFixed, 100 * _scale);
ImGui.TableNextColumn();
Expand Down Expand Up @@ -1413,6 +1430,17 @@ private static void DrawRotationsGitHub()

ImGui.Spacing();

foreach (var gitHubLink in DownloadHelper.LinkLibraries ?? Array.Empty<string>())
{
var strs = gitHubLink.Split('|');
var userName = strs.FirstOrDefault() ?? string.Empty;
var repository = strs.Length > 1 ? strs[1] : string.Empty;
var fileName = strs.LastOrDefault() ?? string.Empty;

DrawGitHubBadge(userName, repository, fileName, center: true);
ImGui.Spacing();
}

int removeIndex = -1;
for (int i = 0; i < Service.Config.GlobalConfig.GitHubLibs.Length; i++)
{
Expand Down

0 comments on commit 883da6f

Please sign in to comment.