Keep dependencies in the box in ConsoleUI #3459
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Cause
The mod info screen only has room for a total of 9 dependencies and conflicts, and it assumes there will be fewer than that many. If there are more, they will overflow the dependencies box. If there are a lot more, they can overflow the screen and crash.
I think I couldn't conceive of a mod having more than 9 dependencies+conflicts when I wrote this. Now we have crazy mods like the RP1 express stuff with way more.
Changes
Formatting.ConvertCoord
now coerces all coordinates to appear on-screen, so if we have other layout problems in the future, they won't cause a crashModInfoscreen.addDependencies
now allocates its 9 lines of text proportionally between dependencies and conflicts, and limits the size of the text boxes to fit within that range. If this isn't enough room, the text boxes will display scrollbars. The user is not able to scroll the box because we already use the scroll bindings for the description box, but hopefully they won't care.