Exemplo n.º 1
0
        public static void json2es(FileInfo jsonFile)
        {
            var settings = new JsonSerializerSettings();

            settings.ContractResolver = new JSON.LowercaseContractResolver();

            var json = File.ReadAllText(jsonFile.FullName);

            var jsonEmoteTable = JsonConvert.DeserializeObject <JSON.EmoteTable>(json, settings);

            var emoteTable = new EmoteTable(jsonEmoteTable);

            emoteTable.SetValidBranches();

            emoteTable.BuildLinks();

            //ShowScript(emoteTable.EmoteSets);

            var esFilename = Path.ChangeExtension(jsonFile.FullName, ".es");

            // check if file already exists?

            var esFile = new FileInfo(esFilename);

            OutputScript(emoteTable.EmoteSets, esFile);
        }
Exemplo n.º 2
0
        public static List <string> json2es(string json)
        {
            var settings = new JsonSerializerSettings();

            settings.ContractResolver = new JSON.LowercaseContractResolver();

            var jsonEmoteTable = JsonConvert.DeserializeObject <JSON.EmoteTable>(json, settings);

            var emoteTable = new EmoteTable(jsonEmoteTable);

            emoteTable.SetValidBranches();

            emoteTable.BuildLinks();

            var esLines = BuildScript(emoteTable.EmoteSets);

            return(esLines);
        }