Implement loading screens.

This commit is contained in:
Paul Chote
2019-04-20 10:32:21 +00:00
committed by reaperrr
parent 1f3b30c2d2
commit 3a693d8def
16 changed files with 260 additions and 10 deletions

View File

@@ -12,6 +12,7 @@
using System;
using System.Linq;
using OpenRA.GameRules;
using OpenRA.Graphics;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
@@ -38,7 +39,7 @@ namespace OpenRA.Mods.Common.Traits
public object Create(ActorInitializer init) { return new MusicPlaylist(init.World, this); }
}
public class MusicPlaylist : INotifyActorDisposing, IGameOver
public class MusicPlaylist : INotifyActorDisposing, IGameOver, IWorldLoaded, INotifyGameLoaded
{
readonly MusicPlaylistInfo info;
readonly World world;
@@ -89,7 +90,16 @@ namespace OpenRA.Mods.Common.Traits
currentSong = world.Map.Rules.Music[info.StartingMusic];
CurrentSongIsBackground = false;
}
}
void IWorldLoaded.WorldLoaded(World world, WorldRenderer wr)
{
if (!world.IsLoadingGameSave)
Play();
}
void INotifyGameLoaded.GameLoaded(World world)
{
Play();
}