Add a bot type identifier.

This commit is contained in:
Paul Chote
2017-05-28 21:04:58 +00:00
parent e88754cd4a
commit b0906e1836
13 changed files with 71 additions and 21 deletions

View File

@@ -50,13 +50,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var bots = new List<SlotDropDownOption>();
if (slot.AllowBots)
{
foreach (var b in map.Rules.Actors["player"].TraitInfos<IBotInfo>().Select(t => t.Name))
foreach (var b in map.Rules.Actors["player"].TraitInfos<IBotInfo>())
{
var bot = b;
var botController = orderManager.LobbyInfo.Clients.FirstOrDefault(c => c.IsAdmin);
bots.Add(new SlotDropDownOption(bot,
"slot_bot {0} {1} {2}".F(slot.PlayerReference, botController.Index, bot),
() => client != null && client.Bot == bot));
bots.Add(new SlotDropDownOption(b.Name,
"slot_bot {0} {1} {2}".F(slot.PlayerReference, botController.Index, b.Type),
() => client != null && client.Bot == b.Type));
}
}