diff --git a/OpenRA.Game/Widgets/Delegates/VideoPlayerDelegate.cs b/OpenRA.Game/Widgets/Delegates/VideoPlayerDelegate.cs index 6bbe7a403c..a705faf653 100644 --- a/OpenRA.Game/Widgets/Delegates/VideoPlayerDelegate.cs +++ b/OpenRA.Game/Widgets/Delegates/VideoPlayerDelegate.cs @@ -1,7 +1,3 @@ -using System.Collections.Generic; -using OpenRA.FileFormats; -using System.Drawing; -using System.Linq; #region Copyright & License Information /* * Copyright 2007-2010 The OpenRA Developers (see AUTHORS) @@ -10,13 +6,17 @@ using System.Linq; * as published by the Free Software Foundation. For more information, * see LICENSE. */ -#endregion - +#endregion + +using System.Drawing; +using OpenRA.FileFormats; + namespace OpenRA.Widgets.Delegates { public class VideoPlayerDelegate : IWidgetDelegate { string Selected; + public VideoPlayerDelegate() { var bg = Widget.RootWidget.GetWidget("VIDEOPLAYER_MENU"); @@ -49,16 +49,15 @@ namespace OpenRA.Widgets.Delegates var itemTemplate = vl.GetWidget("VIDEO_TEMPLATE"); int offset = itemTemplate.Bounds.Y; - Selected = Rules.Movies.Keys.FirstOrDefault(); - if (Selected != null) - player.Load(Selected); - foreach (var kv in Rules.Movies) { var video = kv.Key; var title = kv.Value; if (!FileSystem.Exists(video)) - continue; + continue; + + if (Selected == null) + player.Load(Selected = video); var template = itemTemplate.Clone() as LabelWidget; template.Id = "VIDEO_{0}".F(video);