Merge pull request #13002 from rob-v/LobbyOptionsEditableByHost

Host can change Team and Spawn of any player. #12936
This commit is contained in:
reaperrr
2017-05-04 19:15:01 +02:00
committed by GitHub
5 changed files with 71 additions and 18 deletions

View File

@@ -641,6 +641,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
if (orderManager.LocalClient == null)
return;
var isHost = Game.IsHost;
var idx = 0;
foreach (var kv in orderManager.LobbyInfo.Slots)
{
@@ -659,7 +660,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
if (template == null || template.Id != emptySlotTemplate.Id)
template = emptySlotTemplate.Clone();
if (Game.IsHost)
if (isHost)
LobbyUtils.SetupEditableSlotWidget(this, template, slot, client, orderManager);
else
LobbyUtils.SetupSlotWidget(template, slot, client);
@@ -670,7 +671,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
join.OnClick = () => orderManager.IssueOrder(Order.Command("slot " + key));
}
else if ((client.Index == orderManager.LocalClient.Index) ||
(client.Bot != null && Game.IsHost))
(client.Bot != null && isHost))
{
// Editable player in slot
if (template == null || template.Id != editablePlayerTemplate.Id)
@@ -701,8 +702,17 @@ namespace OpenRA.Mods.Common.Widgets.Logic
() => panel = PanelType.Kick, () => panel = PanelType.Players);
LobbyUtils.SetupColorWidget(template, slot, client);
LobbyUtils.SetupFactionWidget(template, slot, client, factions);
LobbyUtils.SetupTeamWidget(template, slot, client);
LobbyUtils.SetupSpawnWidget(template, slot, client);
if (isHost)
{
LobbyUtils.SetupEditableTeamWidget(template, slot, client, orderManager, Map);
LobbyUtils.SetupEditableSpawnWidget(template, slot, client, orderManager, Map);
}
else
{
LobbyUtils.SetupTeamWidget(template, slot, client);
LobbyUtils.SetupSpawnWidget(template, slot, client);
}
LobbyUtils.SetupReadyWidget(template, slot, client);
}