Remove MapPreview.CacheRules.

This commit is contained in:
Paul Chote
2016-02-05 22:03:56 +00:00
parent 4328f24276
commit 3708a7649d
5 changed files with 13 additions and 32 deletions

View File

@@ -129,7 +129,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var startButton = widget.Get<ButtonWidget>("STARTGAME_BUTTON");
startButton.OnClick = StartMissionClicked;
startButton.IsDisabled = () => selectedMapPreview == null || selectedMapPreview.RuleStatus != MapRuleStatus.Cached;
startButton.IsDisabled = () => selectedMap == null || selectedMap.InvalidCustomRules;
widget.Get<ButtonWidget>("BACK_BUTTON").OnClick = () =>
{
@@ -166,7 +166,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
selectedMapPreview = Game.ModData.MapCache[map.Uid];
// Cache the rules on a background thread to avoid jank
new Thread(selectedMapPreview.CacheRules).Start();
new Thread(() => selectedMap.PreloadRules()).Start();
var briefingVideo = map.Videos.Briefing;
var briefingVideoVisible = briefingVideo != null;
@@ -290,7 +290,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
StopVideo(videoPlayer);
if (selectedMapPreview.RuleStatus != MapRuleStatus.Cached)
if (selectedMap.InvalidCustomRules)
return;
var gameStartVideo = selectedMap.Videos.GameStart;