Music installation

This commit is contained in:
Paul Chote
2011-05-11 15:36:28 +12:00
parent dfb07153c6
commit 80d5b67bb9
3 changed files with 175 additions and 4 deletions

View File

@@ -16,8 +16,8 @@ namespace OpenRA.GameRules
{
public readonly string Filename = null;
public readonly string Title = null;
public readonly int Length = 0; // seconds
public readonly bool Exists = false;
public int Length { get; private set; } // seconds
public bool Exists { get; private set; }
public MusicInfo( string key, MiniYaml value )
{
@@ -30,5 +30,14 @@ namespace OpenRA.GameRules
Exists = true;
Length = (int)AudLoader.SoundLength(FileSystem.Open(Filename));
}
public void Reload()
{
if (!FileSystem.Exists(Filename))
return;
Exists = true;
Length = (int)AudLoader.SoundLength(FileSystem.Open(Filename));
}
}
}