plugins/cheat*: indent the output (nw)

This commit is contained in:
cracyc 2016-04-28 21:17:09 -05:00
parent 7e394b5dbe
commit 6bbd290d31
3 changed files with 3 additions and 3 deletions

View File

@ -8,4 +8,4 @@ function readAll(file)
return content
end
print(json.stringify(xml.conv_cheat(readAll(arg[1]))))
print(json.stringify(xml.conv_cheat(readAll(arg[1])), {indent = true}))

View File

@ -477,7 +477,7 @@ function cheat.startplugin()
cheats = load_cheats()
local json = require("json")
local file = io.open(manager:machine():options().entries.cheatpath:value() .. "/output.json", "w")
file:write(json.stringify(cheats))
file:write(json.stringify(cheats, {indent = true}))
file:close()
for num, cheat in pairs(cheats) do
parse_cheat(cheat)

View File

@ -518,7 +518,7 @@ function cheatfind.startplugin()
local filename = string.format("%s/%s_%08X_cheat", manager:machine():options().entries.cheatpath:value(), emu.romname(), match.addr)
local json = require("json")
local file = io.open(filename .. ".json", "w")
file:write(json.stringify({[1] = cheat}))
file:write(json.stringify({[1] = cheat}, {indent = true}))
file:close()
file = io.open(filename .. ".xml", "w")
file:write(xmlcheat)