Only update the loading screen from the main thread

Fixes the crash experienced by pchote. It's a hack but it's easy
to get rid of and it will have to do for now, until the messy
LoadScreen gets fixed.
This commit is contained in:
Pavlos Touboulidis
2014-05-13 17:56:27 +03:00
parent a845947e0f
commit ca44be7b2e
4 changed files with 22 additions and 25 deletions

View File

@@ -22,12 +22,8 @@ namespace OpenRA.Graphics
Dictionary<string, CursorSequence> cursors;
Cache<string, PaletteReference> palettes;
public Action OnProgress;
public CursorProvider(ModData modData)
{
OnProgress = () => { if (modData.LoadScreen != null) modData.LoadScreen.Display(); };
var sequenceFiles = modData.Manifest.Cursors;
cursors = new Dictionary<string, CursorSequence>();
@@ -65,8 +61,6 @@ namespace OpenRA.Graphics
void LoadSequencesForCursor(SpriteLoader loader, string cursorSrc, MiniYaml cursor)
{
OnProgress();
foreach (var sequence in cursor.Nodes)
cursors.Add(sequence.Key, new CursorSequence(loader, cursorSrc, cursor.Value, sequence.Value));
}