diff --git a/OpenRA.Mods.Common/Widgets/Logic/MapChooserLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/MapChooserLogic.cs index 45349bfcd6..72f5f4b3d8 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/MapChooserLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/MapChooserLogic.cs @@ -235,7 +235,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic item.IsVisible = () => item.RenderBounds.IntersectsWith(scrollpanels[tab].RenderBounds); var titleLabel = item.Get("TITLE"); - titleLabel.GetText = () => preview.Title; + if (titleLabel != null) + { + var font = Game.Renderer.Fonts[titleLabel.Font]; + var title = WidgetUtils.TruncateText(preview.Title, titleLabel.Bounds.Width, font); + titleLabel.GetText = () => title; + } var previewWidget = item.Get("PREVIEW"); previewWidget.Preview = () => preview; @@ -246,7 +251,11 @@ namespace OpenRA.Mods.Common.Widgets.Logic var authorWidget = item.GetOrNull("AUTHOR"); if (authorWidget != null) - authorWidget.GetText = () => "Created by {0}".F(preview.Author); + { + var font = Game.Renderer.Fonts[authorWidget.Font]; + var author = WidgetUtils.TruncateText("Created by {0}".F(preview.Author), authorWidget.Bounds.Width, font); + authorWidget.GetText = () => author; + } var sizeWidget = item.GetOrNull("SIZE"); if (sizeWidget != null) diff --git a/mods/cnc/chrome/mapchooser.yaml b/mods/cnc/chrome/mapchooser.yaml index dba8ae35d4..8efcd90c89 100644 --- a/mods/cnc/chrome/mapchooser.yaml +++ b/mods/cnc/chrome/mapchooser.yaml @@ -89,25 +89,25 @@ Container@MAPCHOOSER_PANEL: IgnoreMouseOver: true IgnoreMouseInput: true Label@TITLE: - X: 2 + X: 4 Y: PARENT_BOTTOM-48 - Width: PARENT_RIGHT-4 + Width: PARENT_RIGHT-8 Align: Center Label@DETAILS: - Width: PARENT_RIGHT-4 - X: 2 + Width: PARENT_RIGHT-8 + X: 4 Y: PARENT_BOTTOM-34 Align: Center Font: Tiny Label@AUTHOR: - Width: PARENT_RIGHT-4 - X: 2 + Width: PARENT_RIGHT-8 + X: 4 Y: PARENT_BOTTOM-22 Align: Center Font: Tiny Label@SIZE: - Width: PARENT_RIGHT-4 - X: 2 + Width: PARENT_RIGHT-8 + X: 4 Y: PARENT_BOTTOM-10 Align: Center Font: Tiny diff --git a/mods/ra/chrome/map-chooser.yaml b/mods/ra/chrome/map-chooser.yaml index d3af5d646d..ac633e9141 100644 --- a/mods/ra/chrome/map-chooser.yaml +++ b/mods/ra/chrome/map-chooser.yaml @@ -60,25 +60,25 @@ Background@MAPCHOOSER_PANEL: IgnoreMouseOver: true IgnoreMouseInput: true Label@TITLE: - X: 2 + X: 4 Y: PARENT_BOTTOM-53 - Width: PARENT_RIGHT-4 + Width: PARENT_RIGHT-8 Align: Center Label@DETAILS: - Width: PARENT_RIGHT-4 - X: 2 + Width: PARENT_RIGHT-8 + X: 4 Y: PARENT_BOTTOM-37 Align: Center Font: Tiny Label@AUTHOR: - Width: PARENT_RIGHT-4 - X: 2 + Width: PARENT_RIGHT-8 + X: 4 Y: PARENT_BOTTOM-25 Align: Center Font: Tiny Label@SIZE: - Width: PARENT_RIGHT-4 - X: 2 + Width: PARENT_RIGHT-8 + X: 4 Y: PARENT_BOTTOM-13 Align: Center Font: Tiny