From 62273e51a252287d1c60228e8a8e8939ecaa73c6 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sun, 8 Jan 2017 22:40:00 -0300 Subject: Moved JSON functions to built-in to_json, parse_json, validate_json --- tools/editor/asset_library_editor_plugin.cpp | 12 ++++++++++-- tools/editor/editor_import_export.cpp | 6 +++--- 2 files changed, 13 insertions(+), 5 deletions(-) (limited to 'tools') diff --git a/tools/editor/asset_library_editor_plugin.cpp b/tools/editor/asset_library_editor_plugin.cpp index 986f235499..aca4a512fd 100644 --- a/tools/editor/asset_library_editor_plugin.cpp +++ b/tools/editor/asset_library_editor_plugin.cpp @@ -29,7 +29,7 @@ #include "asset_library_editor_plugin.h" #include "editor_node.h" #include "editor_settings.h" - +#include "io/json.h" @@ -1076,8 +1076,16 @@ void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const } print_line("response: "+itos(p_status)+" code: "+itos(p_code)); + Dictionary d; - d.parse_json(str); + { + Variant js; + String errs; + int errl; + JSON::parse(str,js,errs,errl); + d=js; + } + print_line(Variant(d).get_construct_string()); diff --git a/tools/editor/editor_import_export.cpp b/tools/editor/editor_import_export.cpp index c1be2cd940..1804016f47 100644 --- a/tools/editor/editor_import_export.cpp +++ b/tools/editor/editor_import_export.cpp @@ -783,7 +783,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func if (atlas_valid) { //compare options - Dictionary options; + /*Dictionary options; options.parse_json(f->get_line()); if (!options.has("lossy_quality") || float(options["lossy_quality"])!=group_lossy_quality) atlas_valid=false; @@ -794,7 +794,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func if (!atlas_valid) print_line("JSON INVALID"); - +*/ } @@ -921,7 +921,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func options["lossy_quality"]=group_lossy_quality; options["shrink"]=EditorImportExport::get_singleton()->image_export_group_get_shrink(E->get()); options["image_format"]=group_format; - f->store_line(options.to_json()); +// f->store_line(options.to_json()); f->store_line(image_list_md5); } -- cgit v1.2.3