Replace map type with a category list.

This commit is contained in:
Paul Chote
2016-03-08 22:02:42 +00:00
parent 85c20e7adf
commit 96eda08677
8 changed files with 101 additions and 49 deletions

View File

@@ -96,12 +96,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");