Don't crash and burn if vqa files aren't found
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.IO;
|
||||||
using OpenRA.Widgets;
|
using OpenRA.Widgets;
|
||||||
|
|
||||||
namespace OpenRA.Scripting
|
namespace OpenRA.Scripting
|
||||||
@@ -19,8 +20,19 @@ namespace OpenRA.Scripting
|
|||||||
{
|
{
|
||||||
var playerRoot = Game.OpenWindow(w, "FMVPLAYER");
|
var playerRoot = Game.OpenWindow(w, "FMVPLAYER");
|
||||||
var player = playerRoot.Get<VqaPlayerWidget>("PLAYER");
|
var player = playerRoot.Get<VqaPlayerWidget>("PLAYER");
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
player.Load(movie);
|
||||||
|
}
|
||||||
|
catch (FileNotFoundException)
|
||||||
|
{
|
||||||
|
Ui.CloseWindow();
|
||||||
|
onComplete();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
w.EnableTick = false;
|
w.EnableTick = false;
|
||||||
player.Load(movie);
|
|
||||||
|
|
||||||
// Mute world sounds
|
// Mute world sounds
|
||||||
var oldModifier = Sound.SoundVolumeModifier;
|
var oldModifier = Sound.SoundVolumeModifier;
|
||||||
|
|||||||
Reference in New Issue
Block a user