Fix ready checkbox in the lobby being unusable after installing a map

This commit is contained in:
Oliver Brakmann
2016-04-11 22:25:18 +02:00
parent f911a80b04
commit b25eb81a42
4 changed files with 13 additions and 5 deletions

View File

@@ -355,6 +355,11 @@ namespace OpenRA
return true;
}
public void PreloadRules()
{
var unused = Rules;
}
public void UpdateRemoteSearch(MapStatus status, MiniYaml yaml, Action<MapPreview> parseMetadata = null)
{
var newData = innerData.Clone();

View File

@@ -781,7 +781,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
new Task(() =>
{
// Force map rules to be loaded on this background thread
var unused = map.Rules;
map.PreloadRules();
}).Start();
}
@@ -799,7 +799,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
new Task(() =>
{
// Force map rules to be loaded on this background thread
var unused = currentMap.Rules;
currentMap.PreloadRules();
Game.RunAfterTick(() =>
{
// Map may have changed in the meantime

View File

@@ -109,8 +109,11 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var install = download.GetOrNull<ButtonWidget>("MAP_INSTALL");
if (install != null)
{
install.OnClick = () => lobby.Map.Install(
() => orderManager.IssueOrder(Order.Command("state {0}".F(Session.ClientState.NotReady))));
install.OnClick = () => lobby.Map.Install(() =>
{
lobby.Map.PreloadRules();
Game.RunAfterTick(() => orderManager.IssueOrder(Order.Command("state {0}".F(Session.ClientState.NotReady))));
});
install.IsHighlighted = () => installHighlighted;
}
}

View File

@@ -134,7 +134,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
foreach (var p in allPreviews)
{
p.GetMinimap();
var unused = p.Rules;
p.PreloadRules();
}
}).Start();