#438. Show # Players in the map selector.

This commit is contained in:
Paul Chote
2011-01-04 10:50:50 +13:00
parent 6e7156e023
commit 6287b132a0
3 changed files with 34 additions and 9 deletions

View File

@@ -55,7 +55,7 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
};
var itemTemplate = ml.GetWidget<ContainerWidget>("MAP_TEMPLATE");
foreach (var kv in Game.modData.AvailableMaps.OrderBy(kv => kv.Value.Title))
foreach (var kv in Game.modData.AvailableMaps.OrderBy(kv => kv.Value.Title).OrderBy(kv => kv.Value.PlayerCount))
{
var map = kv.Value;
if (!map.Selectable)
@@ -66,8 +66,9 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
template.GetBackground = () => ((Map == map) ? "dialog2" : null);
template.OnMouseDown = mi => { if (mi.Button != MouseButton.Left) return false; Map = map; return true; };
template.IsVisible = () => true;
template.GetWidget<LabelWidget>("TITLE").GetText = () => " " + map.Title;
template.GetWidget<LabelWidget>("TYPE").GetText = () => map.Type + " ";
template.GetWidget<LabelWidget>("TITLE").GetText = () => map.Title;
template.GetWidget<LabelWidget>("PLAYERS").GetText = () => "{0}".F(map.PlayerCount);
template.GetWidget<LabelWidget>("TYPE").GetText = () => map.Type;
ml.AddChild(template);
}
}

View File

@@ -453,12 +453,18 @@ Background@MAP_CHOOSER:
Visible:false
Children:
Label@TITLE:
X:10
Id:TITLE
Width:PARENT_RIGHT-100
Height:25
Label@PLAYERS:
Id:PLAYERS
X:PARENT_RIGHT-150
Width:30
Height:25
Label@TYPE:
Id:TYPE
Width:100
Width:90
X:PARENT_RIGHT-100
Align:Right
Height:25
@@ -469,18 +475,24 @@ Background@MAP_CHOOSER:
Y:40
Children:
Label@TITLE:
Width:150
Width:125
Height:25
X:0
Y:0
Text:Title
Align:Center
Bold:True
Label@PLAYERS:
Text:Players
Bold:true
Width:50
X:304
Height:25
Label@TYPE:
Text:Type
Bold:true
Width:50
X:415
X:420
Height:25
Background@MAPCHOOSER_MAP_BG:
X:PARENT_RIGHT-268

View File

@@ -453,12 +453,18 @@ Background@MAP_CHOOSER:
Visible:false
Children:
Label@TITLE:
X:10
Id:TITLE
Width:PARENT_RIGHT-100
Height:25
Label@PLAYERS:
Id:PLAYERS
X:PARENT_RIGHT-150
Width:30
Height:25
Label@TYPE:
Id:TYPE
Width:100
Width:90
X:PARENT_RIGHT-100
Align:Right
Height:25
@@ -469,18 +475,24 @@ Background@MAP_CHOOSER:
Y:40
Children:
Label@TITLE:
Width:150
Width:125
Height:25
X:0
Y:0
Text:Title
Align:Center
Bold:True
Label@PLAYERS:
Text:Players
Bold:true
Width:50
X:304
Height:25
Label@TYPE:
Text:Type
Bold:true
Width:50
X:415
X:420
Height:25
Background@MAPCHOOSER_MAP_BG:
X:PARENT_RIGHT-268