Add yaml-defined FMV playback to GUI elements
This commit is contained in:
@@ -88,6 +88,15 @@ namespace OpenRA
|
||||
}
|
||||
}
|
||||
|
||||
public class MapVideos
|
||||
{
|
||||
public string BackgroundInfo;
|
||||
public string Briefing;
|
||||
public string GameStart;
|
||||
public string GameWon;
|
||||
public string GameLost;
|
||||
}
|
||||
|
||||
public class Map
|
||||
{
|
||||
[FieldLoader.Ignore] public IFolder Container;
|
||||
@@ -102,7 +111,6 @@ namespace OpenRA
|
||||
|
||||
public string Title;
|
||||
public string Type = "Conquest";
|
||||
public string PreviewVideo;
|
||||
public string Description;
|
||||
public string Author;
|
||||
public string Tileset;
|
||||
@@ -131,6 +139,19 @@ namespace OpenRA
|
||||
return options;
|
||||
}
|
||||
|
||||
[FieldLoader.LoadUsing("LoadVideos")]
|
||||
public MapVideos Videos;
|
||||
|
||||
static object LoadVideos(MiniYaml y)
|
||||
{
|
||||
var videos = new MapVideos();
|
||||
var nodesDict = y.ToDictionary();
|
||||
if (nodesDict.ContainsKey("Videos"))
|
||||
FieldLoader.Load(videos, nodesDict["Videos"]);
|
||||
|
||||
return videos;
|
||||
}
|
||||
|
||||
[FieldLoader.Ignore] public Lazy<Dictionary<string, ActorReference>> Actors;
|
||||
|
||||
public int PlayerCount { get { return Players.Count(p => p.Value.Playable); } }
|
||||
@@ -372,7 +393,6 @@ namespace OpenRA
|
||||
"Title",
|
||||
"Description",
|
||||
"Author",
|
||||
"PreviewVideo",
|
||||
"Tileset",
|
||||
"MapSize",
|
||||
"Bounds",
|
||||
|
||||
Reference in New Issue
Block a user