public static void ShowJSON(EmoteTable emoteTable) { var jsonTable = new JSON.EmoteTable(emoteTable); var json = BuildJSON(jsonTable); Console.WriteLine(json); }
public static void OutputJSON(JSON.EmoteTable emoteTable, FileInfo jsonFile) { var json = BuildJSON(emoteTable); File.WriteAllText(jsonFile.FullName, json); Console.WriteLine($"Compiled {jsonFile.FullName}"); }
public static string BuildJSON(JSON.EmoteTable emoteTable) { var settings = new JsonSerializerSettings(); settings.NullValueHandling = NullValueHandling.Ignore; settings.Formatting = Formatting.Indented; //settings.ContractResolver = new LowercaseContractResolver(); return(JsonConvert.SerializeObject(emoteTable, settings)); }
public static void es2json(EmoteTable emoteTable, FileInfo esFile) { var jsonFilename = Path.ChangeExtension(esFile.FullName, ".json"); var jsonFile = new FileInfo(jsonFilename); emoteTable.NormalRange(); var jsonTable = new JSON.EmoteTable(emoteTable); // check if file already exists? // output json file OutputJSON(jsonTable, jsonFile); }