Add support for TS-style random tile variants.

This commit is contained in:
Paul Chote
2015-03-28 19:05:50 +00:00
parent 0b4ec5a815
commit 4be5334a0e
10 changed files with 285 additions and 250 deletions

View File

@@ -210,7 +210,7 @@ namespace OpenRA.Editor
var template = t.Value;
tilePalette.Controls.Add(ibox);
tt.SetToolTip(ibox, "{1}:{0} ({2}x{3})".F(template.Image, template.Id, template.Size.X, template.Size.Y));
tt.SetToolTip(ibox, "{1}:{0} ({2}x{3})".F(template.Image[0], template.Id, template.Size.X, template.Size.Y));
}
catch { }
}

View File

@@ -53,7 +53,7 @@ namespace OpenRA.Editor
var frameCache = new FrameCache(Game.ModData.SpriteLoaders);
foreach (var t in tileset.Templates)
{
var allFrames = frameCache[t.Value.Image];
var allFrames = frameCache[t.Value.Image[0]];
var frames = t.Value.Frames != null ? t.Value.Frames.Select(f => allFrames[f]).ToArray() : allFrames;
templates.Add(t.Value.Id, frames.Select(f => ExtractSquareTile(f)).ToArray());
}