Notify the server after installing a map.
This commit is contained in:
@@ -314,7 +314,7 @@ namespace OpenRA
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Install()
|
public void Install(Action onSuccess)
|
||||||
{
|
{
|
||||||
if (Status != MapStatus.DownloadAvailable || !Game.Settings.Game.AllowDownloading)
|
if (Status != MapStatus.DownloadAvailable || !Game.Settings.Game.AllowDownloading)
|
||||||
return;
|
return;
|
||||||
@@ -372,6 +372,7 @@ namespace OpenRA
|
|||||||
{
|
{
|
||||||
var package = modData.ModFiles.OpenPackage(mapFilename, mapInstallPackage);
|
var package = modData.ModFiles.OpenPackage(mapFilename, mapInstallPackage);
|
||||||
UpdateFromMap(package, mapInstallPackage, MapClassification.User, null, GridType);
|
UpdateFromMap(package, mapInstallPackage, MapClassification.User, null, GridType);
|
||||||
|
onSuccess();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -99,7 +99,8 @@ 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))));
|
||||||
install.IsHighlighted = () => installHighlighted;
|
install.IsHighlighted = () => installHighlighted;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -160,7 +161,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
retry.OnClick = () =>
|
retry.OnClick = () =>
|
||||||
{
|
{
|
||||||
if (lobby.Map.Status == MapStatus.DownloadError)
|
if (lobby.Map.Status == MapStatus.DownloadError)
|
||||||
lobby.Map.Install();
|
lobby.Map.Install(() => orderManager.IssueOrder(Order.Command("state {0}".F(Session.ClientState.NotReady))));
|
||||||
else if (lobby.Map.Status == MapStatus.Unavailable)
|
else if (lobby.Map.Status == MapStatus.Unavailable)
|
||||||
modData.MapCache.QueryRemoteMapDetails(new[] { lobby.Map.Uid });
|
modData.MapCache.QueryRemoteMapDetails(new[] { lobby.Map.Uid });
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user