Allow non-hosts to open the map chooser

This commit is contained in:
Oliver Brakmann
2015-01-15 13:27:07 +01:00
parent c76fb51b14
commit 72c0f9b8dc
2 changed files with 16 additions and 4 deletions

View File

@@ -155,7 +155,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var mapButton = lobby.GetOrNull<ButtonWidget>("CHANGEMAP_BUTTON");
if (mapButton != null)
{
mapButton.IsDisabled = configurationDisabled;
mapButton.IsDisabled = () => gameStarting || panel == PanelType.Kick || panel == PanelType.ForceStart ||
orderManager.LocalClient == null || orderManager.LocalClient.IsReady;
mapButton.OnClick = () =>
{
var onSelect = new Action<string>(uid =>
@@ -173,7 +174,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
{ "initialMap", Map.Uid },
{ "onExit", DoNothing },
{ "onSelect", onSelect },
{ "onSelect", Game.IsHost ? onSelect : null },
{ "filter", MapVisibility.Lobby },
});
};