show a user friendly description of the starting unit template

closes #6209
This commit is contained in:
Matthias Mailänder
2014-08-09 13:07:45 +02:00
parent 381505cd19
commit 24a3fd3196
7 changed files with 46 additions and 9 deletions

View File

@@ -552,9 +552,13 @@ namespace OpenRA.Mods.RA.Server
return true;
}
var startUnitsInfo = server.Map.Rules.Actors["world"].Traits.WithInterface<MPStartUnitsInfo>();
var selectedClass = startUnitsInfo.Where(u => u.Class == s).Select(u => u.ClassName).FirstOrDefault();
var className = selectedClass != null ? selectedClass : s;
server.LobbyInfo.GlobalSettings.StartingUnitsClass = s;
server.SyncLobbyGlobalSettings();
server.SendMessage("{0} changed Starting Units to {1}.".F(client.Name, s));
server.SendMessage("{0} changed Starting Units to {1}.".F(client.Name, className));
return true;
}},