added button to extract the selected SHP and convert it to PNG

This commit is contained in:
Matthias Mailänder
2013-04-28 19:42:01 +02:00
parent 6a6776754b
commit 7f40f59d85
8 changed files with 189 additions and 3 deletions

View File

@@ -95,6 +95,30 @@ namespace OpenRA.Mods.RA.Widgets.Logic
template = panel.Get<ScrollItemWidget>("ASSET_TEMPLATE");
PopulateAssetList();
panel.Get<ButtonWidget>("EXPORT_BUTTON").OnClick = () =>
{
var palette = (WidgetUtils.ActiveModId() == "d2k") ? "d2k.pal" : "egopal.pal";
var ExtractGameFiles = new string[][]
{
new string[] {"--extract", WidgetUtils.ActiveModId(), palette},
new string[] {"--extract", WidgetUtils.ActiveModId(), "{0}.shp".F(spriteImage.Image)},
};
var ExportToPng = new string[][]
{
new string[] {"--png", "{0}.shp".F(spriteImage.Image), palette},
};
var args = new WidgetArgs()
{
{ "ExtractGameFiles", ExtractGameFiles },
{ "ExportToPng", ExportToPng }
};
Ui.OpenWindow("EXTRACT_ASSETS_PANEL", args);
};
panel.Get<ButtonWidget>("CLOSE_BUTTON").OnClick = () => { Ui.CloseWindow(); onExit(); };
}