コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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();
        }
コード例 #3
0
        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");
            }
        }