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

@@ -53,10 +53,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic
string gameSpeed;
[ObjectCreator.UseCtor]
public MissionBrowserLogic(Widget widget, World world, Action onStart, Action onExit)
public MissionBrowserLogic(Widget widget, ModData modData, World world, Action onStart, Action onExit)
{
modData = Game.ModData;
mapCache = new Cache<MapPreview, Map>(p => new Map(modData, p.Package));
this.modData = modData;
this.onStart = onStart;
missionList = widget.Get<ScrollPanelWidget>("MISSION_LIST");
@@ -230,7 +230,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
if (gameSpeedButton != null)
{
var speeds = Game.ModData.Manifest.Get<GameSpeeds>().Speeds;
var speeds = modData.Manifest.Get<GameSpeeds>().Speeds;
gameSpeed = "default";
gameSpeedButton.GetText = () => speeds[gameSpeed].Name;