From 364934231747e12e3d385f30c7496f4b28ef49aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sat, 20 Apr 2013 21:36:57 +0200 Subject: [PATCH] be more verbose about missing sequences and files as requested in #3039 --- OpenRA.Game/Graphics/SequenceProvider.cs | 10 +++++++--- OpenRA.Game/ModData.cs | 3 ++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/OpenRA.Game/Graphics/SequenceProvider.cs b/OpenRA.Game/Graphics/SequenceProvider.cs index 2bd2652f5e..fc4f122477 100644 --- a/OpenRA.Game/Graphics/SequenceProvider.cs +++ b/OpenRA.Game/Graphics/SequenceProvider.cs @@ -40,7 +40,11 @@ namespace OpenRA.Graphics var seq = sequences.NodesDict.ToDictionary(x => x.Key, x => new Sequence(unit,x.Key,x.Value)); units.Add(unit, seq); } - catch (FileNotFoundException) {} // Do nothing; we can crash later if we actually wanted art + catch (FileNotFoundException) + { + // Do nothing; we can crash later if we actually wanted art + Console.WriteLine("Can't find all files for unit {0}.".F(unit)); + } } public static Sequence GetSequence(string unitName, string sequenceName) @@ -53,7 +57,7 @@ namespace OpenRA.Graphics "Unit `{0}` does not have a sequence `{1}`".F(unitName, sequenceName)); else throw new InvalidOperationException( - "Unit `{0}` does not have any sequences defined.".F(unitName)); + "Unit `{0}` does not have all sequences defined.".F(unitName)); } } @@ -61,7 +65,7 @@ namespace OpenRA.Graphics { if (!units.ContainsKey(unit)) throw new InvalidOperationException( - "Unit `{0}` does not have any sequences defined.".F(unit)); + "Unit `{0}` does not have sequence `{1}` defined.".F(unit, seq)); return units[unit].ContainsKey(seq); } diff --git a/OpenRA.Game/ModData.cs b/OpenRA.Game/ModData.cs index c614d4604b..2a183e4141 100755 --- a/OpenRA.Game/ModData.cs +++ b/OpenRA.Game/ModData.cs @@ -73,7 +73,8 @@ namespace OpenRA FileSystem.Mount(FileSystem.OpenPackage(map.Path, int.MaxValue)); Rules.LoadRules(Manifest, map); - SpriteLoader = new SpriteLoader( Rules.TileSets[map.Tileset].Extensions, SheetBuilder ); + SpriteLoader = new SpriteLoader(Rules.TileSets[map.Tileset].Extensions, SheetBuilder); + // TODO: Don't load the sequences for assets that are not used in this tileset. Maybe use the existing EditorTilesetFilters. SequenceProvider.Initialize(Manifest.Sequences, map.Sequences); return map;