Reset spawn previews for empty servers.
This commit is contained in:
@@ -403,6 +403,17 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
currentServer = server;
|
currentServer = server;
|
||||||
currentMap = server != null ? modData.MapCache[server.Map] : null;
|
currentMap = server != null ? modData.MapCache[server.Map] : null;
|
||||||
|
|
||||||
|
// Can only show factions if the server is running the same mod
|
||||||
|
if (server != null && mapPreview != null)
|
||||||
|
{
|
||||||
|
var spawns = currentMap.SpawnPoints;
|
||||||
|
var occupants = server.Clients
|
||||||
|
.Where(c => (c.SpawnPoint - 1 >= 0) && (c.SpawnPoint - 1 < spawns.Length))
|
||||||
|
.ToDictionary(c => spawns[c.SpawnPoint - 1], c => new SpawnOccupant(c, server.Mod != modData.Manifest.Id));
|
||||||
|
|
||||||
|
mapPreview.SpawnOccupants = () => occupants;
|
||||||
|
}
|
||||||
|
|
||||||
if (server == null || !server.Clients.Any())
|
if (server == null || !server.Clients.Any())
|
||||||
{
|
{
|
||||||
if (joinButton != null)
|
if (joinButton != null)
|
||||||
@@ -414,19 +425,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
if (joinButton != null)
|
if (joinButton != null)
|
||||||
joinButton.Bounds.Y = clientContainer.Bounds.Bottom;
|
joinButton.Bounds.Y = clientContainer.Bounds.Bottom;
|
||||||
|
|
||||||
// Can only show factions if the server is running the same mod
|
|
||||||
var disableFactionDisplay = server.Mod != modData.Manifest.Id;
|
|
||||||
|
|
||||||
if (server != null && mapPreview != null)
|
|
||||||
{
|
|
||||||
var spawns = currentMap.SpawnPoints;
|
|
||||||
var occupants = server.Clients
|
|
||||||
.Where(c => (c.SpawnPoint - 1 >= 0) && (c.SpawnPoint - 1 < spawns.Length))
|
|
||||||
.ToDictionary(c => spawns[c.SpawnPoint - 1], c => new SpawnOccupant(c, disableFactionDisplay));
|
|
||||||
|
|
||||||
mapPreview.SpawnOccupants = () => occupants;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (clientList == null)
|
if (clientList == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -464,7 +462,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var o = option;
|
var o = option;
|
||||||
|
|
||||||
var item = ScrollItemWidget.Setup(clientTemplate, () => false, () => { });
|
var item = ScrollItemWidget.Setup(clientTemplate, () => false, () => { });
|
||||||
if (!o.IsSpectator && !disableFactionDisplay)
|
if (!o.IsSpectator && server.Mod == modData.Manifest.Id)
|
||||||
{
|
{
|
||||||
var label = item.Get<LabelWidget>("LABEL");
|
var label = item.Get<LabelWidget>("LABEL");
|
||||||
var font = Game.Renderer.Fonts[label.Font];
|
var font = Game.Renderer.Fonts[label.Font];
|
||||||
|
|||||||
Reference in New Issue
Block a user