public static void CreatePackFromDirectory() { string sourceFolder = DialogUtils.OpenDirectory( "Select folder that contains the assets you wish to pack", "", "", DialogUtils.DirectoryIsEmpty); if (sourceFolder == null) { return; } string[] files = Directory.GetFiles(sourceFolder); var destinationFile = DialogUtils.SaveFile( "Select destination to save created pack file", sourceFolder, "Assets_256", "pack"); if (destinationFile != null) { CreatePackFromFiles(files, destinationFile); DialogUtils.DisplayDialog("Export Successful", "Successfully packed and saved " + files.Length + " assets to " + destinationFile); } }
public override void Execute() { var designer = mainForm.ActiveDesigner; if (!designer.IsModified) { return; } string fileName; if (!DialogUtils.SaveFile(mainForm, out fileName)) { return; } designer.FilePath = fileName; designer.IsFileNameSet = true; mainForm.FileSaveCommand.Execute(); }
public void ExportZoneFile() { if (ForgelightExtension.Instance.ZoneManager.LoadedZone != null) { string path = DialogUtils.SaveFile( "Save zone file", ForgelightExtension.Instance.ForgelightGameFactory.ActiveForgelightGame.PackDirectory, Path.GetFileNameWithoutExtension(ForgelightExtension.Instance.ZoneManager.LoadedZone.Name), "zone"); if (path == null) { return; } SaveZone(path); } else { DialogUtils.DisplayDialog("Cannot save zone", "An existing zone file needs to be loaded first. Please import a zone file, then try again"); } }