Fix ready checkbox in the lobby being unusable after installing a map
This commit is contained in:
@@ -355,6 +355,11 @@ namespace OpenRA
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void PreloadRules()
|
||||||
|
{
|
||||||
|
var unused = Rules;
|
||||||
|
}
|
||||||
|
|
||||||
public void UpdateRemoteSearch(MapStatus status, MiniYaml yaml, Action<MapPreview> parseMetadata = null)
|
public void UpdateRemoteSearch(MapStatus status, MiniYaml yaml, Action<MapPreview> parseMetadata = null)
|
||||||
{
|
{
|
||||||
var newData = innerData.Clone();
|
var newData = innerData.Clone();
|
||||||
|
|||||||
@@ -781,7 +781,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
new Task(() =>
|
new Task(() =>
|
||||||
{
|
{
|
||||||
// Force map rules to be loaded on this background thread
|
// Force map rules to be loaded on this background thread
|
||||||
var unused = map.Rules;
|
map.PreloadRules();
|
||||||
}).Start();
|
}).Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -799,7 +799,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
new Task(() =>
|
new Task(() =>
|
||||||
{
|
{
|
||||||
// Force map rules to be loaded on this background thread
|
// Force map rules to be loaded on this background thread
|
||||||
var unused = currentMap.Rules;
|
currentMap.PreloadRules();
|
||||||
Game.RunAfterTick(() =>
|
Game.RunAfterTick(() =>
|
||||||
{
|
{
|
||||||
// Map may have changed in the meantime
|
// Map may have changed in the meantime
|
||||||
|
|||||||
@@ -109,8 +109,11 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var install = download.GetOrNull<ButtonWidget>("MAP_INSTALL");
|
var install = download.GetOrNull<ButtonWidget>("MAP_INSTALL");
|
||||||
if (install != null)
|
if (install != null)
|
||||||
{
|
{
|
||||||
install.OnClick = () => lobby.Map.Install(
|
install.OnClick = () => lobby.Map.Install(() =>
|
||||||
() => orderManager.IssueOrder(Order.Command("state {0}".F(Session.ClientState.NotReady))));
|
{
|
||||||
|
lobby.Map.PreloadRules();
|
||||||
|
Game.RunAfterTick(() => orderManager.IssueOrder(Order.Command("state {0}".F(Session.ClientState.NotReady))));
|
||||||
|
});
|
||||||
install.IsHighlighted = () => installHighlighted;
|
install.IsHighlighted = () => installHighlighted;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
foreach (var p in allPreviews)
|
foreach (var p in allPreviews)
|
||||||
{
|
{
|
||||||
p.GetMinimap();
|
p.GetMinimap();
|
||||||
var unused = p.Rules;
|
p.PreloadRules();
|
||||||
}
|
}
|
||||||
}).Start();
|
}).Start();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user