Skip to content

Commit

Permalink
Prevent dialog extending off screen when there are a lot of missing m…
Browse files Browse the repository at this point in the history
…ods. Limit display to the first 10 entries. Fixes #326.
  • Loading branch information
RevZero committed Apr 23, 2024
1 parent 88cded7 commit 6cf51b6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion xcom2-launcher/xcom2-launcher/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,11 @@ public static Settings InitializeSettings()
}
else
{
message = $"{newMissingMods.Count} mods no longer exist:\n\n- " + string.Join("\n- ", newMissingMods.Select(m => m.Name)) + "\n\nDo you want to hide these mods from the mod list?";
const int displayLimit = 10;
message = $"{newMissingMods.Count} mods no longer exist:\n\n- "
+ string.Join("\n- ", newMissingMods.Take(displayLimit))
+ (newMissingMods.Count > displayLimit ? "\n..." : "")
+ "\n\nDo you want to hide these mods from the mod list?";
}

var result = MessageBox.Show(message, "Missing mods", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
Expand Down

0 comments on commit 6cf51b6

Please sign in to comment.