Aragas / Bannerlord.MBOptionScreen

Mod Configuration Menu. A Module for easy Setting integration. Documentation available.
https://www.nexusmods.com/mountandblade2bannerlord/mods/612
MIT License
42 stars 12 forks source link

Long texts in string settings #15

Open sebaslavigne opened 4 years ago

sebaslavigne commented 4 years ago

When using very long texts in the settings they overflow the text box. The text editing dialog also presents some glitches, and when trying to select the whole text the game throws:

System.ArgumentOutOfRangeException: 'Length cannot be less than zero.
Parameter name: length'

The example images are settings containing banner codes generated with the online banner editor

Images ![image](https://user-images.githubusercontent.com/44443629/80837147-8ce11b80-8bf6-11ea-8567-dcd163cba45d.png) ![image](https://user-images.githubusercontent.com/44443629/80837519-388a6b80-8bf7-11ea-823a-78ea494b2900.png)
Aragas commented 4 years ago

Can't say it's expected that the game would handle this, but adding length checks in MCM would be a good thing anyway. Thanks for reporting!

Aragas commented 4 years ago

This concrete error, if I remember right, is caused by some strange condition Basically, it will trigger when casually using the edit dialog and randomly selecting text. The game's logic is causing this. I added a simple workaround that ignores the exception. Further investigation is needed