make to_json work on StyleP and IndexMap

This commit is contained in:
GenevensiS
2026-01-15 18:08:34 +01:00
parent 8afd412021
commit 2e68014612
5 changed files with 42 additions and 11 deletions
+2 -3
View File
@@ -271,10 +271,9 @@ SCRIPT_FUNCTION(to_json) {
SCRIPT_PARAM_C(ScriptValueP, input);
SCRIPT_PARAM_C(Set*, set);
SCRIPT_PARAM_DEFAULT(bool, pretty_print, true);
SCRIPT_PARAM_DEFAULT(bool, console_print, false);
boost::json::value jv = mse_to_json(input, set);
queue_message(MESSAGE_ERROR, json_pretty_print(jv));
if (console_print) queue_message(MESSAGE_INFO, json_pretty_print(jv));
if (pretty_print) return to_script(json_pretty_print(jv));
else return to_script(json_ugly_print(jv));
}