Fix \r\n-style line endings not being properly handled for script errors
This commit is contained in:
committed by
Matthias Mailänder
parent
bc5e7d1497
commit
49c837e7d0
@@ -26,7 +26,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
var luaScript = world.WorldActor.TraitOrDefault<LuaScript>();
|
||||
if (luaScript != null)
|
||||
{
|
||||
var text = WidgetUtils.WrapText(luaScript.Context.ErrorMessage, label.Bounds.Width, font);
|
||||
// Native exceptions have OS-dependend line endings, so strip these away as WrapText doesn't handle them
|
||||
var errorMessage = luaScript.Context.ErrorMessage.Replace("\r\n", "\n");
|
||||
|
||||
var text = WidgetUtils.WrapText(errorMessage, label.Bounds.Width, font);
|
||||
label.Text = text;
|
||||
label.Bounds.Height = font.Measure(text).Y;
|
||||
panel.ScrollToTop();
|
||||
|
||||
Reference in New Issue
Block a user