Remove static Game.ModData references from widget logic.

This commit is contained in:
Paul Chote
2016-02-17 02:39:13 +00:00
parent ff2aabda9b
commit 84b470017f
20 changed files with 78 additions and 67 deletions

View File

@@ -21,7 +21,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
int blinkTick;
[ObjectCreator.UseCtor]
internal LobbyMapPreviewLogic(Widget widget, OrderManager orderManager, LobbyLogic lobby)
internal LobbyMapPreviewLogic(Widget widget, ModData modData, OrderManager orderManager, LobbyLogic lobby)
{
var available = widget.GetOrNull("MAP_AVAILABLE");
if (available != null)
@@ -162,7 +162,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
if (lobby.MapPreview.Status == MapStatus.DownloadError)
lobby.MapPreview.Install();
else if (lobby.MapPreview.Status == MapStatus.Unavailable)
Game.ModData.MapCache.QueryRemoteMapDetails(new[] { lobby.MapPreview.Uid });
modData.MapCache.QueryRemoteMapDetails(new[] { lobby.MapPreview.Uid });
};
retry.GetText = () => lobby.MapPreview.Status == MapStatus.DownloadError ? "Retry Install" : "Retry Search";