Move mission videos to rules.
This commit is contained in:
@@ -63,10 +63,13 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
if (world.LocalPlayer != null)
|
||||
{
|
||||
var scriptContext = world.WorldActor.TraitOrDefault<LuaScript>();
|
||||
var video = world.LocalPlayer.WinState == WinState.Won ? world.Map.Videos.GameWon : world.Map.Videos.GameLost;
|
||||
|
||||
if (!string.IsNullOrEmpty(video) && !(scriptContext != null && scriptContext.FatalErrorOccurred))
|
||||
Media.PlayFMVFullscreen(world, video, () => { });
|
||||
var missionData = world.WorldActor.Info.TraitInfoOrDefault<MissionDataInfo>();
|
||||
if (missionData != null && !(scriptContext != null && scriptContext.FatalErrorOccurred))
|
||||
{
|
||||
var video = world.LocalPlayer.WinState == WinState.Won ? missionData.WinVideo : missionData.LossVideo;
|
||||
if (!string.IsNullOrEmpty(video))
|
||||
Media.PlayFMVFullscreen(world, video, () => { });
|
||||
}
|
||||
}
|
||||
|
||||
var optionsButton = playerRoot.GetOrNull<MenuButtonWidget>("OPTIONS_BUTTON");
|
||||
|
||||
Reference in New Issue
Block a user