unhardcode and increase the exit delay

This commit is contained in:
Matthias Mailänder
2015-07-05 20:50:31 +02:00
parent f6ae27b4b7
commit 5378b6225c
4 changed files with 16 additions and 4 deletions

View File

@@ -9,8 +9,10 @@
#endregion
using System;
using System.Linq;
using OpenRA.Graphics;
using OpenRA.Mods.Common.Traits;
using OpenRA.Traits;
using OpenRA.Widgets;
namespace OpenRA.Mods.Common.Widgets.Logic
@@ -41,7 +43,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
resumeDisabled = true;
var exitDelay = 1200;
var iop = world.WorldActor.TraitsImplementing<IObjectivesPanel>().FirstOrDefault();
var exitDelay = iop != null ? iop.ExitDelay : 0;
if (mpe != null)
{
Game.RunAfterDelay(exitDelay, () => mpe.Fade(MenuPaletteEffect.EffectType.Black));

View File

@@ -106,7 +106,7 @@ namespace OpenRA.Mods.Common.Widgets
Sound.PlayNotification(world.Map.Rules, null, "Speech", "Leave",
world.LocalPlayer == null ? null : world.LocalPlayer.Country.Race);
var exitDelay = 1200;
var exitDelay = iop != null ? iop.ExitDelay : 0;
if (mpe != null)
{
Game.RunAfterDelay(exitDelay, () => mpe.Fade(MenuPaletteEffect.EffectType.Black));