Пример #1
0
    static void GenerateSongIni(string path, Song song, float songLengthSeconds, bool isChPackage = false)
    {
        Metadata  metaData = song.metaData;
        INIParser parser   = new INIParser();

        try
        {
            parser.Open(Path.Combine(path, "song.ini"));

            // Clone explicit properties
            parser.WriteValue(song.iniProperties);

            SongIniFunctions.AddDefaultIniTags(song, parser, songLengthSeconds);

            if (isChPackage)
            {
                // Write defaults for any missing CH tags
                SongIniFunctions.AddCloneHeroIniTags(song, parser, songLengthSeconds);
            }
        }
        catch (System.Exception e)
        {
            Debug.LogError("Error encountered when trying to generate song.ini. " + e.Message);
        }
        finally
        {
            parser.Close();
        }
    }
    public void AddCloneHeroIniTags()
    {
        RefreshIniDisplay();

        var song      = editor.currentSong;
        var iniParser = song.iniProperties;

        SongIniFunctions.AddCloneHeroIniTags(song, iniParser, editor.currentSongLength);
        UpdateIniTextFromSongProperties();
        ChartEditor.isDirty = true;
    }