Merge pull request #10898 from pchote/map-format-eleven

Add support for multiple map categories.
This commit is contained in:
Pavel Penev
2016-03-27 18:16:51 +03:00
191 changed files with 249 additions and 197 deletions

View File

@@ -98,12 +98,17 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var titleText = widget.Get<LabelWidget>("TITLE");
var titleTextNoTabs = widget.GetOrNull<LabelWidget>("TITLE_NO_TABS");
var mapTitle = world.Map.Title;
var firstCategory = world.Map.Categories.FirstOrDefault();
if (firstCategory != null)
mapTitle = firstCategory + ": " + mapTitle;
titleText.IsVisible = () => numTabs > 1 || (numTabs == 1 && titleTextNoTabs == null);
titleText.GetText = () => string.Concat(world.Map.Type, ": ", world.Map.Title);
titleText.GetText = () => mapTitle;
if (titleTextNoTabs != null)
{
titleTextNoTabs.IsVisible = () => numTabs == 1;
titleTextNoTabs.GetText = () => string.Concat(world.Map.Type, ": ", world.Map.Title);
titleTextNoTabs.GetText = () => mapTitle;
}
var bg = widget.Get<BackgroundWidget>("BACKGROUND");