Пример #1
0
    public void ExportCHPackage()
    {
        string saveDirectory;

        if (FileExplorer.OpenFolderPanel(out saveDirectory))
        {
            Song  song       = editor.currentSong;
            float songLength = editor.currentSongLength;

            saveDirectory = saveDirectory.Replace('\\', '/');
            saveDirectory = Path.Combine(saveDirectory, FileExplorer.StripIllegalChars(song.name));

            // Check if files exist at the current directory and ask user before overwriting.
            if (Directory.Exists(saveDirectory))
            {
                NativeWindow            window    = ChartEditor.Instance.windowHandleManager.nativeWindow;
                NativeMessageBox.Result overwrite = NativeMessageBox.Show("Exported files exist. Overwrite?", "Warning", NativeMessageBox.Type.YesNo, window);

                if (overwrite != NativeMessageBox.Result.Yes)
                {
                    return;
                }
            }

            StartCoroutine(ExportCHPackage(saveDirectory, song, songLength, exportOptions));
        }
    }
Пример #2
0
    public void ExportCHPackage()
    {
        string saveDirectory;

        if (FileExplorer.OpenFolderPanel(out saveDirectory))
        {
            Song song = editor.currentSong;

            saveDirectory = saveDirectory.Replace('\\', '/');

            if (!saveDirectory.EndsWith("/"))
            {
                saveDirectory += '/';
            }

            saveDirectory += song.name + "/";

            StartCoroutine(ExportCHPackage(saveDirectory, song, exportOptions));
        }
    }